Serin vs Serin2


Closed Thread
Results 1 to 13 of 13

Thread: Serin vs Serin2

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,

    These are software UARTS using the bit-banging technique.
    The speed is the same because the speed is tied to the baud rate
    you receive the data.

    Best regards,

    Luciano

  2. #2
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    ahh. that makes sense. im using 9600N at the moment. how do i know how high i can go? are there chip specific restrictions?

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    19200 according to the manual is the top end for SERIN/OUT2. You will need an OSC faster than 4MHz though.

    Look at appendix A
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    oh. do you know the fastest for a chip using 4MHz?

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    At 4MHz the recommended is less than 9600. 9600 will work at 4MHz if all is stable.

    There is some debate, but I do not like the internal OSC for serial, I use a crystal resonator (the ones with three pins, built in caps) seem to be very stable.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    ahh, i cant go any higher then. i use an external oscillator anyway because thats the way i was shown how to do it. everything seems to be working fine now. i had a bug that looked like the serin command wasnt running fast enough but i turned out to be the wait() part.

    the way ive solved it has created another question. the chips must wait for 250 and their own unique ID before doing something. that bit works fine but i want to be able to send a command that resets their ID no matter what it is.

    the code im using now is
    serin2 porta.2,16468,2000,nocmd,[wait(250,address),cmd,val]

    can i tell it to do something if it gets 251 and anything *aswell*? if not then i have a backup plan but i would rather do it that way

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    ahh,

    the code im using now is
    serin2 porta.2,16468,2000,nocmd,[wait(250,address),cmd,val]

    can i tell it to do something if it gets 251 and anything *aswell*? if not then i have a backup plan but i would rather do it that way
    If I understand what you want the answer is yes. After the TIMEOUT for the 250 ends you could have it WAIT for 251.
    Code:
    serin2 porta.2,16468,2000,nocmd,[wait(250,address),cmd,val]
    
    serin2 porta.2,16468,2000,nocmd,[wait(251,?????),cmd,val]
    
    serin2 porta.2,16468,2000,nocmd,[wait(252,?X?X?X),cmd,val]
    Something like that
    But this will eat up speed. Maybe decrease the TIMEOUT?
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. Serin to Serin2 ??
    By Gixxer in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th January 2008, 03:56
  2. serin and serin2??? need to understand
    By tkly36 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th April 2006, 05:13
  3. Serin / Serin2 / Debugin Differences
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 19th January 2006, 06:32
  4. SERIN SERIN2 Timeout
    By markedwards in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd June 2005, 18:59
  5. serin and serin2
    By rastan in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd January 2005, 13:10

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