PIC to serial with visual basic


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Jul 2006
    Posts
    76


    Did you find this post helpful? Yes | No

    Default

    Yeah, I switched it to 2400 baud rate and turned off the handshake. Maybe the visual basic code is wrong or the code on the PIC should be "if OK = 4" instead of 4 being in quotation marks. Or am I missing something that's staring me in the face?

    Thanks for the help.

    -Mike

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mbw123 View Post
    Yeah, I switched it to 2400 baud rate and turned off the handshake. Maybe the visual basic code is wrong or the code on the PIC should be "if OK = 4" instead of 4 being in quotation marks. Or am I missing something that's staring me in the face?

    Thanks for the help.

    -Mike
    Try this. It echo's everything you type on hyperterminal, but echo the same character 3 times and toggle the led every time you hit a key, that way you know it's really working..

    Include "modedefs.bas"
    DEFINE OSC 4
    rx var portc.7 : output rx : tx var portc.6 : input tx
    led var portd.2 : output led : serialdata var byte : ADCON1 = $F
    main:
    toggle led 'just show the program is running
    serin rx , N2400 , serialdata
    serout tx , n2400 , [ serialdata , serialdata , serialdata ]
    goto main


    Once again, you break it down, make it super simple, then build it back up...
    Last edited by skimask; - 31st March 2007 at 03:29.

  3. #3
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Hardware Tx/Rx RTFM

    Hi,

    Here is a portion from the PBP manual
    Since the serial reception is done in hardware, it is not possible to set
    the levels to an inverted state to eliminate an RS-232 driver.
    Therefore
    a suitable driver should be used with HSERIN.
    Any idea what this means ? I don't know or may be I do

    Using the hardware pins with a software serial (inverted) works but makes no sense as anyway you don't use the hardware peripheral. So time to spend on MAX or be happy with soft serial.
    Regards

    Sougata

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sougata View Post
    Hi,

    Here is a portion from the PBP manual


    Any idea what this means ? I don't know or may be I do

    Using the hardware pins with a software serial (inverted) works but makes no sense as anyway you don't use the hardware peripheral. So time to spend on MAX or be happy with soft serial.
    Sure ya do. HSERIN/OUT uses the UART, which is monitored by PBP for input/output. So you need the correct RS232 voltages...

Similar Threads

  1. Serial VB 2005 pic 16f877a problems
    By Snap in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 8th July 2013, 01:52
  2. serial to PIC
    By kindows in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 14th July 2009, 14:58
  3. Replies: 11
    Last Post: - 12th July 2008, 03:36
  4. vb6 to pic basic
    By Darrenmac in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 19th December 2005, 02:56
  5. Serial communication PIC to PIC help.
    By Rubicon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th January 2005, 16:45

Members who have read this thread : 1

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