1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

USART/RS232 VB6 communication

Discussion in 'Microcontrollers' started by Mark Lazarides, Feb 8, 2004.

  1. reeve333

    reeve333 New Member

    Joined:
    Apr 7, 2011
    Messages:
    41
    Likes:
    0
    Yup, I already change it which program i sent back to you before.

    But the baud rate is set in the program already right??
    so should i sent the baud rate again during the command mode?

    Or it will do automatic done it??
     
  2. reeve333

    reeve333 New Member

    Joined:
    Apr 7, 2011
    Messages:
    41
    Likes:
    0
    Sorry, i feel bad for my english......
    I mean that, so i do anythings during the command mode??


     
  3. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,233
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi,
    The factory default is 115,200 baud, so change the VB program to '115200,n,8,1'
    Then check that you have a good connection using the $$$ and get the CMD reply...

    I assume you have not changed the bit switch settings for the baud rate..????
    Look at the image in post #40
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. reeve333

    reeve333 New Member

    Joined:
    Apr 7, 2011
    Messages:
    41
    Likes:
    0

    Actually I did, but after I get the CMD reply, i can't sent any data.

    For baud rate, just change 2 things as the pic below right??



     

    Attached Files:

  6. reeve333

    reeve333 New Member

    Joined:
    Apr 7, 2011
    Messages:
    41
    Likes:
    0
    And I feel that there are no data transfer because I found that in the document, it say when the data transfer, the Yellow LED should blind.May i correct??

    Thanks for you help, and sorry for make you trouble.......
     

    Attached Files:

  7. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,233
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi,
    Is the GREEN LED lit when you are connected.???
     
  8. reeve333

    reeve333 New Member

    Joined:
    Apr 7, 2011
    Messages:
    41
    Likes:
    0
    yup......
    when I press port open......
    The green Led is lit.
    Then i press sent $$$
    Green LED is still On and the RED LED is Blind
     
  9. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,233
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    OK,
    Do you see the 'CMD' reply.??


    BUMP.!
     
    Last edited: Apr 19, 2011
  10. reeve333

    reeve333 New Member

    Joined:
    Apr 7, 2011
    Messages:
    41
    Likes:
    0
    Yup.......
    i get the reply CMD
     
  11. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,233
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    OK, this means the PC can communicate with its OWN RN41
    I would do the same test at the PIC end with its RN41, ie: make sure the PIC can communicate with its OWN RN41

    So send "---" & vbcrlf to exit the command mode.

    Do NOT send a 'K', this is the KILL command and will disconnect the RN41 RF link.

    Send Data and it should be read by the remote PIC via its RN41..

    Both RN41's must be set up the same and connected by the RF link, read the RN41 datasheet and follow the instructions on how the two RN41's connect to each other.
     
  12. reeve333

    reeve333 New Member

    Joined:
    Apr 7, 2011
    Messages:
    41
    Likes:
    0
    Sorry, I din get it........
    You mean that test PIC end with its RN41, but how to test it???
    and you say both RN41must be set up the same and connected by the RF link, but I only got one RN41 device o.......

    So sorry for that.......
     
  13. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,233
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi,
    Look at this diagram, how do you expect the PIC to get the data from the RN41 thats connected to the PC.???:)

    Please draw on this diagram and post it to the thread.
     

    Attached Files:

  14. reeve333

    reeve333 New Member

    Joined:
    Apr 7, 2011
    Messages:
    41
    Likes:
    0
    Sorry, i dun know I can't save your pic, so I make a simple one.
    Since there are 6pin on the RN41
    So i connect VCC and GND to the power supply.
    TX connected to the RC6 pin (pin 25) since this pin is also TX pin
    Same as TX, RX connected to the RC7 pin (pin 26) since this pin is also RX pin

    Summary

    TX ===>> TX (pin25 RC6)
    RX ===>> RX (pin26 RC7)
    VCC ===>> 3.3V power supply
    GND ===>> Gound

    Is it correct??

    And when the RN41 received signal from PC, It will straigh away trasfer the data to PIC by RX pin right??
     

    Attached Files:

    • RN41.jpg
      RN41.jpg
      File size:
      11.5 KB
      Views:
      108
  15. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,233
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    ok,
    Is this how you have it connected.??
    In your simple drawings show how the wires are connected.

    EDIT:
    Are you confusing CTS and RTS as CTX and RTX.?????????
     

    Attached Files:

    Last edited: Apr 20, 2011
  16. reeve333

    reeve333 New Member

    Joined:
    Apr 7, 2011
    Messages:
    41
    Likes:
    0
    yaya......i wrote wrong.

    no, i din use serial connect. Since it is a bluetooth device, so i din connect it with PC.It just communication with PC by wireless
     
  17. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,233
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    That means the PC must have a Bluetooth/RN41 module already connected.???
     
  18. reeve333

    reeve333 New Member

    Joined:
    Apr 7, 2011
    Messages:
    41
    Likes:
    0
    Yup.......my laptop have bluetooth..............
     
  19. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,233
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi,
    Why have you been asking for USART/RS232 VB Communication with a RN41, when you already have a laptop with Bluetooth.????

    You should be testing the PIC with its RN41, so that it can communicate with your laptop.
     
  20. reeve333

    reeve333 New Member

    Joined:
    Apr 7, 2011
    Messages:
    41
    Likes:
    0
    but i need to control the PIC (sent signal to PIC) by my laptop o.........
    so first things, i need to connect the PC with the RN41 first right??

    Then the RN41 is just connect the pin to PIC right??
    Am I wrong??
    Cause I am thinking this way.......
     
  21. reeve333

    reeve333 New Member

    Joined:
    Apr 7, 2011
    Messages:
    41
    Likes:
    0
    Hi......

    So do think what should i change now??Do you know where I make wrong or miss anything??

    Really thanks for your help......
     

Share This Page