PIC to serial with visual basic


Results 1 to 8 of 8

Threaded View

  1. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mbw123 View Post
    Code on PIC:
    ------------------
    Include "modedefs.bas"
    define HSER_CLROERR 1 : define HSER_RCSTA 90h : define HSER_BAUD 9600
    define HSER_TXSTA 20h : define OSC 4 : rts var porta.2:cts var portd.3
    led var portd.2 : rx var portc.7 : OK var word : input rts : output cts
    output led : ADCON1=15 : low led : low cts
    main:
    while rts = 1
    high cts : SERIN rx,N9600,OK
    if ok = "4" then
    high led
    endif
    wend
    low cts
    goto main
    Why are you using the RTS & CTS lines? Just curious...I've never used them, never had a need, kinda complicates thing unneccesarily. Try this whole thing without the RTS and CTS lines. Set Windows to 'Handshaking-None' in the serial properties. See what happens then. Again, you're breaking it down, starting super-simple, then working your way up.

    Another thing, you're using SERIN with HSER defines. Why?

    And SERIN @ 4mhz isn't exactly reliable. Switch down to 2400 and see what happens.

    You're also not using a MAX232. It should work with a PC using the inverted serial modes, but the voltage levels might not be high enough. You might end up using one. It's always worked for me, but you never know.

    Incidentally, I got over 100 threads here on this site alone all about serial interfacing, PC's, visual basic, hyperterminal, etc.
    Last edited by skimask; - 31st March 2007 at 01:44. Reason: Added info

Similar Threads

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