Serin serout problem


Closed Thread
Results 1 to 40 of 337

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    On the receiver side, first line; empty, second line: 'Waiting... 000,000'
    It's not incrementing at all on the receiving side? Try1 should be going up about once a second.


    Add:
    DEFINE CHAR_PACING 16667

    to the transmit program's defines at the beginning. Maybe the receiver is missing characters 'cause they're coming too fast with the software based serin command. If that fixes it, it'll probably work with a value much less than 16667, but it's a start.
    Last edited by skimask; - 24th December 2006 at 06:11. Reason: added info

  2. #2
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    NO incrementation on the receiver. The same with all zeros all the time
    what about using the serin2 command ??

    with the new define, I can see glitches of 'Sending...' on the second line of the sending side. But most often it is on like before, 'Getting...'
    Last edited by lerameur; - 24th December 2006 at 06:18.

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    NO incrementation on the receiver. The same with all zeros all the time
    what about using the serin2 command ??

    with the new define, I can see glitches of 'Sending...' on the second line of the sending side. But most often it is on like before, 'Getting...'
    Transmit side - sounds like it's doing like it should.

    Receive side - try this one:

    'RECEIVE
    INCLUDE "modedefs.bas"
    DEFINE OSC 20 'use external 20mhz crystal
    CMCON = 7 : ANSEL = 0 : ADCON1 = 7
    DEFINE LCD_DREG PORTA ' Set LCD Data port
    DEFINE LCD_DBIT 0 ' Set starting Data bit (0 or 4) if 4-bit bus
    DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
    DEFINE LCD_RSBIT 1 ' Set LCD Register Select bit
    DEFINE LCD_EREG PORTB ' Set LCD Enable port
    DEFINE LCD_EBIT 0 ' Set LCD Enable bit
    DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
    DEFINE LCD_LINES 2 ' Set number of lines on LCD

    'try1 = count of times waiting for data, try2 = count of bytes received
    try1 var byte : try2 var byte : temp var word : tempf var word : input portb.2 : pause 2500
    try1 = 0 : try2 = 0

    loop:
    lcdout $fe , $c0 , "Waiting.." , DEC3 try1 , "," , DEC3 try2
    try1 = try1 + 1 : temp = 0 : tempf = 0
    serin portB.2 , n2400 , [ temp.highbyte , temp.lowbyte , tempf.highbyte , tempf.lowbyte ]
    if temp + tempf > 0 then try2 = try2 + 1 'if temp+tempf are not 0 then data received
    lcdout $fe , $c0 , "Received." , DEC3 try1 , "," , DEC3 try2 : pause 100
    lcdout $fe , $c0 , "Display.." , DEC3 try1 , "," , DEC3 try2 : pause 100
    lcdout $fe , $80 , "Tc=" , DEC3 temp , "C,Tf=" , DEC3 tempf , ".." : pause 100
    lcdout $fe , $c0 , "Shown...." , DEC3 try1 , "," , DEC3 try2 : pause 100
    goto loop
    End

  4. #4
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    absolutely no changes

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    absolutely no changes
    On the receiver side...
    Change the word 'Waiting..' to
    'Wait 4 it'
    and see what happens

  6. #6
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    O my I changed to this
    serin portB.2 , t2400 , [ temp.highbyte , temp.lowbyte , tempf.highbyte , tempf.lowbyte ]

    now the temp is showing up on first line, BUT is it showing zeros,
    incrementation on try, try2 fixed at 0

    check the web page also, for output on lcd

    also:
    On the receiver side...
    Change the word 'Waiting..' to
    'Wait 4 it'
    and see what happens ----------- Only the display changed
    Last edited by lerameur; - 24th December 2006 at 06:42.

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    O my I changed to this
    serin portB.2 , t2400 , [ temp.highbyte , temp.lowbyte , tempf.highbyte , tempf.lowbyte ]

    now the temp is showing up on first line, BUT is it showing zeros,
    incrementation on try, try2 fixed at 0

    check the web page also, for output on lcd

    also:
    On the receiver side...
    Change the word 'Waiting..' to
    'Wait 4 it'
    and see what happens ----------- Only the display changed
    receiver side change - That's what I was wondering. I had a case a couple days ago where I thought it was programming, but the PGD wire had come loose from my board, so it wasn't actually programming, even though it didn't report any errors (and I had my verify turned off!).

    Changing to t2400 is going to do exactly what you saw. But it doesn't fix anything. Leave it at n2400, or try changing both sides to t2400.

    And try putting a small resistor inline with the big yellow wire, about 100 ohms or so. Without it, it's almost like a direct short from power to ground from one PIC to another. I should've caught this earlier.
    Last edited by skimask; - 24th December 2006 at 06:47.

  8. #8
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I will leave is at n2400 then
    also, are you saying my pgd wire is messed up ??
    I am not sure what it is ? it is programming the sending side.., I am not sure what you meant

    The 100 ohm resistor did not do anything .
    Last edited by lerameur; - 24th December 2006 at 06:53.

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 20:58
  2. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  3. serout and serin problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th April 2006, 19:44
  4. Replies: 11
    Last Post: - 13th July 2005, 19:26
  5. SerIn and SerOut
    By Dwayne in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 21st July 2004, 15:54

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