Hserout


Closed Thread
Results 1 to 19 of 19

Thread: Hserout

  1. #1
    MICOCALI's Avatar
    MICOCALI Guest

    Default Hserout

    I SEND THE CARACTER TO PIC AT PC WITH 9600/8/E/1
    i HAVE CONFIG DEFINE HSER_EVEN 1, BUT THE COMUNICATE IS 9600/7/E/1. WHAT IS THE DEFINE?

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    1. For 7E1 add the define...

    DEFINE HSER_EVEN 1

    2. For 7O1 add the define...

    DEFINE HSER_ODD 1

    3. For 8N1...

    Do NOT add any defines


    The following additions below are only valid for PBP 2.44 or later...

    4. For 8E1...

    Define HSER_EVEN 1
    Define HSER_BITS 9

    5. for 8O1

    Define HSER_ODD 1
    Define HSER_BITS 9

    Note that options 4 & 5 are ONLY available from PBP version 2.44 onwards which added the HSER_BITS 9 define. If you have an older compiler, it's time to get in contact with MeLabs for an upgrade.

    Melanie

  3. #3
    MICOCALI's Avatar
    MICOCALI Guest


    Did you find this post helpful? Yes | No

    Default

    I have 2.44 but HSER_BITS 9 NOT COMPILE THIS DEFINE

  4. #4
    MICOCALI's Avatar
    MICOCALI Guest


    Did you find this post helpful? Yes | No

    Unhappy

    DEFINE OSC 20
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 24h
    DEFINE HSER_BAUD 9600
    DEFINE HSER_CLROERR 1
    DEFINE HSER_EVEN 1
    DEFINE HSER_BITS 9


    I HAVE THIS DEFINE BUT THE COMUNICATE IS 8N1
    WHY

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Define HSER_BITS 9

    Compiles without error with my version of 2.44

  6. #6
    MICOCALI's Avatar
    MICOCALI Guest


    Did you find this post helpful? Yes | No

    Default

    IF POSSIBLE COMPILE THIS FILE FOR ME
    THANK
    Attached Files Attached Files

  7. #7
    MICOCALI's Avatar
    MICOCALI Guest


    Did you find this post helpful? Yes | No

    Default

    THE PIC IS 16F628

  8. #8
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    I've compiled it twice for you... (two posts since I can only add one attachment at a time)...

    This is done with PBP version 2.44

    It is actually a .HEX file, but again this forum doesn't allow .HEX attachments so I renamed it as a .TXT
    Attached Files Attached Files

  9. #9
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    And this is compiled with PBP version 2.45
    Attached Files Attached Files

  10. #10
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    @ Melanie

    you are right, the example compiles ok

    but what MICOCALI is saying is also correct.

    I have just tried it with:
    -----------------------------
    DEFINE LOADER_USED 1
    DEFINE OSC 20

    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 24h
    DEFINE HSER_BAUD 9600
    DEFINE HSER_CLROERR 1
    DEFINE HSER_EVEN 1
    DEFINE HSER_BITS 9

    Loop:

    Hserout ["Test: 0 1 2 3 4 5 6 7 8 9"]
    Pause 1000
    goto loop

    END
    -----------------------------

    The PIC communitates with 9600 8N1

  11. #11
    MICOCALI's Avatar
    MICOCALI Guest


    Did you find this post helpful? Yes | No

    Default

    thank you NavMicroSystems
    but I make connection with pic at 9600/8/E/1
    i HAVE USE THE FILE PANA245 BUT COMUNICATION IS 8N1
    NOT 8E1 I HAVE TESTED WITH HYPERTERMINAL

  12. #12
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Have you checked that you get the same erroneous result with PBP244 and PBP245?

  13. #13
    MICOCALI's Avatar
    MICOCALI Guest


    Did you find this post helpful? Yes | No

    Default

    I HAVE TESTED PANA 244 AND PANA 245 BUT THE COMUNICATION IS 8N1 WHY ALL THIS?

  14. #14
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    It looks like HSER_BITS 9 was added when the HSEROUT2 and HSERIN2 commands (along with the HSER2_BITS define) were added.

    I'll pull a PIC out with 2 USARTS and test both HSEROUT and HSEROUT2 later when I've some free time.

    You can of course BYPASS the HSEROUT defines and set-up the PIC's registers manually...

  15. #15
    MICOCALI's Avatar
    MICOCALI Guest


    Did you find this post helpful? Yes | No

    Default

    You can of course BYPASS the HSEROUT defines and set-up the PIC's registers manually

    IN WICH MODE ?

  16. #16
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Just as a test... before we dive into playing with the registers... you're currently setting HSER_TXSTA to 24h. Since bit 6 of the TXSTA Register selects 8 or 9 bit mode, shouldn't you really be setting TXSTA to 64h??

    Therefore try these defines...

    DEFINE OSC 20
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 64h
    DEFINE HSER_BAUD 9600
    DEFINE HSER_CLROERR 1
    DEFINE HSER_EVEN 1
    DEFINE HSER_BITS 9

  17. #17
    MICOCALI's Avatar
    MICOCALI Guest


    Did you find this post helpful? Yes | No

    Default

    YOU ARE THE BEST THANK YOU FOR ALL

  18. #18
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Another happy customer... *smiles*

  19. #19
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Melanie,

    you are so right!

    In most cases a look at the datasheet really helps!

    As I have a Board in front of me I have tested it, and with

    DEFINE HSER_TXSTA 64h

    and the PIC communicates @ 9600 8E1

Similar Threads

  1. I2C Slave with a PIC
    By ralfmayr in forum mel PIC BASIC Pro
    Replies: 129
    Last Post: - 21st August 2016, 17:44
  2. hserin and sms controller
    By xxxxxx in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 10th February 2010, 15:49
  3. HSEROUT and Commas, What? Help Me Understand
    By altech6983 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 20th July 2009, 19:12
  4. Is HSEROUT corrupting bit 7 ?????
    By Robert Wells in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd October 2008, 16:26
  5. Controlling an 240x128 LCD Touchpanel Display
    By Vincent in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 7th June 2006, 23:36

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