Sending Commands from Visual Basic about IR to Pic


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I would suggest you try to send data to your PC to a terminal software first (Hyperterm, MicroCode Serial communicator or whatever else).

    Then from your PC to your PIC.

    I you have good results, then move on VB. I had some bad experiments in the past on some computer on low baudrate.

    High likely, you're using the internal OSC of your PIC? Don't forget at least the OSCCAL_1K define. Not a bad idea to use DEBUG/DEBUGIN as well. It perform better on some case.

    Use current limiting resistor & the InvertedMode on the PIC side, and it should work on small distance between your PIC and the PC.

    On VB side, I would suggest you to use ReadLine. To use it, you'll need to modify your PIC code to send a LF character (10) at the end.
    Last edited by mister_e; - 2nd April 2009 at 14:49.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Feb 2009
    Location
    Southern California
    Posts
    86


    Did you find this post helpful? Yes | No

    Default

    I think the problem is with "1" vs 1 (SOH)

    [HTML]My PBP Code for sender
    Code:

    main:
    SEROUT led5,12,["9999",1]
    PAUSE 100
    SEROUT led5,12,["9999",5]
    PAUSE 100
    GOTO main

    With this PBP Code it works regarding Pic to Pic communication.
    But if I send "99991" or "99995" by my Visual Basic programm it does not work. [/HTML]

    Your pic is sending out hex 1 and your vb is sending out hex 31
    To get vb to send out a 1 try
    txtDatatoSend.txt = "9999" & chr(1)
    this will add a 1 to it, though if you ever want to send 0 it will actually be sending nul characters

    On the other hand you could send a "1" and on the pic side once you receive your dat variable, just subtract "0" from it to give you the value you want or change your if statements to check for "1"

  3. #3
    Join Date
    Apr 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Arrow

    Hi Sougata

    needed a bit of help on inverters using pic16f72
    read ur posts on the following thread
    http://www.letbasic.com/forum/showth...?t=1846&page=4

    this thread is a year or more old so i believe u have advanced ur inverter quite a lot

    can u help on pic 16f72 code as i'm very bad on coding weras i ve pretty gud hardware knowledge.......

    sam
    [email protected]
    Last edited by samrulezzz; - 29th April 2009 at 06:14.

Similar Threads

  1. Basic PIC circuit acting weird
    By FIONEX in forum General
    Replies: 3
    Last Post: - 9th October 2008, 01:04
  2. PIC BASIC Compiler for ARM machines?
    By stone20008 in forum General
    Replies: 2
    Last Post: - 22nd August 2008, 07:14
  3. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  4. How to use 93C46 Type EEPROM using PIC Basic PRo
    By in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 1st April 2003, 04:07
  5. Help with MPASM and PIC Basic
    By johngb in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 21st February 2003, 13:07

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts