SERIN2 = ok, HSERIN = no!


Closed Thread
Results 1 to 29 of 29

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: SERIN2 = ok, HSERIN = no!

    EDIT: Your baud looks good.

    At first I didn't see your BRG16 =1, but Steves Picmulticalc is still good. I'll see if I can find anything real

    Steves PicMultiCalc tool works great for this, and give you text results you can just paste in to your code. Just enter OSC speed, baudrate, and press the go button.

    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
    DEFINE HSER_SPBRG 12 ' 9600 Baud @ 8MHz, 0.16%
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically


    http://www.picbasic.co.uk/forum/cont....-PICMultiCalc
    Last edited by ScaleRobotics; - 20th March 2012 at 13:21.
    http://www.scalerobotics.com

  2. #2
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Re: SERIN2 = ok, HSERIN = no!

    ... I used PICMulticalc and pasted its results in my first post's HSERIN code; unfortunately it doesn't work.
    Roger

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: SERIN2 = ok, HSERIN = no!

    Could it be hardware related? Pull-up or current-limitting resistors?

    What about the Mode setting (True VS Inverted)?

    Robert


    EDIT: You use Open,True,N,9600bps for SERIN, that's inverted.

    You use BAUDCON = %01001000 for HSERIN, bit 5, 0 = non-inverted Data/Receive Polarity.


    There could be other stuff, but that's all I got.
    Last edited by Demon; - 20th March 2012 at 14:26.

  4. #4
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Re: SERIN2 = ok, HSERIN = no!

    Hi Demon,

    I tried all that already. Neither a new chip nor data polarity will change anything; HSERIN won't work...while SERIN2 does :-/
    Roger

  5. #5
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: SERIN2 = ok, HSERIN = no!

    BAUDCON bit 3

    BRG16: 16-Bit Baud Rate Register Enable bit
    1 = 16-bit Baud Rate Generator – SPBRGH and SPBRG
    0 = 8-bit Baud Rate Generator – SPBRG only (Compatible mode), SPBRGH value ignored

    Don't you want 8-bit?

    Robert
    Last edited by Demon; - 20th March 2012 at 15:27. Reason: Removed unnecessary stuff
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  6. #6
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Re: SERIN2 = ok, HSERIN = no!

    I tried BAUDCON = %10000000 if this is what you mean. No luck either.
    Roger

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