Serial VB 2005 pic 16f877a problems


Closed Thread
Results 1 to 29 of 29

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Location
    Southern Ontario
    Posts
    50


    Did you find this post helpful? Yes | No

    Default

    Thanks for the reply but the problem is that the program is now (after fixing port a) locking up as soon as I connect the rx pin on the 232 adapter, the serial cable is not even connected and it locks up.
    if i comment out the serin code with the 232 connected it works (without serin)
    I think the serin command is locking up the program but I don't know why.
    The voltage is always 5 volts untill a code comes threw would a constant 5 volts mess up the serin pin? this is a falling trigger do i need to tell the pic what type to look for?
    t2400 ? n2400?
    I hope I have given enough information, I have been.
    what would cause the program to lock up as soon as i connect the serin pin?

    thanks again
    Beer is proof that God loves us and wants us to be happy.

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


    Did you find this post helpful? Yes | No

    Default

    Well that's strange indeed, why it locks... well it will lock anyways until you have some valid data.

    You said you're using a MAX232 and you're capable of sending data to your PC... T2400 is the setting. Weird enough.. my computer don't work with such low baudrates...

    Code:
    serout portd.3,t2400,[#temp]
    pause 1000
    serin porta.1,t2400,pcsig
    i would suggest to remove the pause 1000, and change your SERIN line


    Code:
    serout portd.3,t2400,[#temp]
    serin porta.1,t2400,#pcsig
    Steve

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

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Snap View Post
    what would cause the program to lock up as soon as i connect the serin pin?
    Post #20 here...http://www.picbasic.co.uk/forum/show...ght=serin+idle
    might help you out a bit...

    Or this might:
    http://www.picbasic.co.uk/forum/show...highlight=idle

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


    Did you find this post helpful? Yes | No

    Default

    Valid for Timeout use...
    Steve

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

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Valid for Timeout use...
    Ayy......good point...
    But what if the serial cable is 'amplifying' the unloaded pin, as in a floating input, and it ends up causing garbage to try to get into the SERIN statement.

    How about adding a pullup or pulldown as appropriate?

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


    Did you find this post helpful? Yes | No

    Default

    He said he use MAX232

    But yes i see what you mean.
    Steve

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

  7. #7
    Join Date
    Apr 2007
    Location
    Southern Ontario
    Posts
    50


    Did you find this post helpful? Yes | No

    Default

    ok, I took out the pause, added the #, so the serin now looks like this...
    serin portc.3,t2400,10,mainloop,[#pcsig]
    it still locks up,
    i added a 4.7 pull down to rx, no luck
    pull up no luck
    serial cable still not even connected (just trying to get it to run first with serin command intact)
    will keep trying
    thanks
    Beer is proof that God loves us and wants us to be happy.

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


    Did you find this post helpful? Yes | No

    Default

    nope... no square brackets in that.
    Steve

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

Similar Threads

  1. Midi, Interrupts and Pic better than SX28?
    By Lajko in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th September 2008, 00:26
  2. Automatic VB6 to pic serial connection
    By arniepj in forum Code Examples
    Replies: 13
    Last Post: - 10th January 2008, 07:57
  3. PIC serial going to sleep!
    By stma in forum Off Topic
    Replies: 0
    Last Post: - 31st October 2007, 08:17
  4. PIC to serial with visual basic
    By mbw123 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 31st March 2007, 16:06
  5. serial comm from Pic to STAMP
    By d1camero in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th April 2004, 23:58

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