Hserin Syntax


Closed Thread
Results 1 to 7 of 7

Thread: Hserin Syntax

Hybrid View

  1. #1
    Join Date
    Apr 2012
    Location
    Ptolemaida
    Posts
    50


    Did you find this post helpful? Yes | No

    Default Re: Hserin Syntax

    Thank you a lot Henrik for the advises ill work on it when i get back from college.
    Last edited by xapmanis; - 9th April 2013 at 07:46.

  2. #2
    Join Date
    Apr 2012
    Location
    Ptolemaida
    Posts
    50


    Did you find this post helpful? Yes | No

    Default Re: Hserin Syntax

    Hello Henrik, I got back home and did run some tests. I found what i did wrong !! I did put wrong defines.
    The only defines a simple HSEROUT/HSERIN needs are:

    DEFINE HSER_RCSTA 90h 'Hser receive status init
    DEFINE HSER_TXSTA 20h 'Hser transmit status init
    DEFINE HSER_BAUD 9600 'Hser baud rate
    DEFINE HSER_CLROERR 1 'Hser clear overflow automatically

    The thing that put me through trouble was that
    DEFINE HSER_BAUD 9600 and DEFINE HSER_SPBRG 25 does the same thing, they set the BaudRate and u can't use them both (what i did !!) :P

    Mistakes on pics can sometimes drive me crazy !! Thank you for your reply

    Regards, Kostas

  3. #3
    Join Date
    Apr 2012
    Location
    Ptolemaida
    Posts
    50


    Did you find this post helpful? Yes | No

    Default Re: Hserin Syntax

    Hello Henrik, I got back home and did run some tests. I found what i did wrong !! I did put wrong defines.
    The only defines a simple HSEROUT/HSERIN needs are:

    DEFINE HSER_RCSTA 90h 'Hser receive status init
    DEFINE HSER_TXSTA 20h 'Hser transmit status init
    DEFINE HSER_BAUD 9600 'Hser baud rate
    DEFINE HSER_CLROERR 1 'Hser clear overflow automatically

    The thing that put me through trouble was that
    DEFINE HSER_BAUD 9600 and DEFINE HSER_SPBRG 25 does the same thing, they set the BaudRate and u can't use them both (what i did !!) :P

    Mistakes on pics can sometimes drive me crazy !! Thank you for your reply

    Regards, Kostas

  4. #4
    Join Date
    Oct 2011
    Posts
    54


    Did you find this post helpful? Yes | No

    Default Re: Hserin Syntax

    Hi
    When using the PIC USART the Tx pin should be set to INPUT, not output as you would expect.
    See PIC 18F2x/4xK22 datasheet page 270 section 16.1.1.7
    Phil

  5. #5
    Join Date
    Apr 2012
    Location
    Ptolemaida
    Posts
    50


    Did you find this post helpful? Yes | No

    Default Re: Hserin Syntax

    Hey phil, i just read page 270. It's true what you said but it seems to work both ways. I think Hserout/Hserin sets TRIS register automatically.
    Regards Kostas.

Similar Threads

  1. Syntax error
    By Dick Ivers in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 25th February 2013, 23:37
  2. syntax error
    By malc-c in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 21st February 2010, 21:06
  3. Need help with I2C syntax problem?
    By Michael Wakileh in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 19th July 2007, 19:11
  4. Serial LCD syntax help
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 27th February 2007, 04:37
  5. IF..THEN syntax
    By scaenix in forum mel PIC BASIC Pro
    Replies: 52
    Last Post: - 20th February 2007, 12: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