HSEROUT Newbie question/problem


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Code:
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 20h
    DEFINE HSER_BRGH 0   <-- Don't exist
    DEFINE HSER_SPBRG 64
    DEFINE HSER_CLOERR 1  <-- HSER_CLROERR
    @12MHZ what is the expected baudrate? 2400?
    using the calc i done few month ago
    @12 MHZ you must use the following
    Code:
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 20h
    DEFINE HSER_SPBRG 77 ' 2400 Bauds
    DEFINE HSER_CLROERR 1
    about now?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Mark Scotford's Avatar
    Mark Scotford Guest


    Did you find this post helpful? Yes | No

    Default

    Steve, you beat me to it, I was just downloading your Calculator program (thank you for sharing your work with us).

    I posted in the new values Unfortunaly there is still garbage coming up in Serial Communicator (see example below) although it does seem more consistent.

    ðàpøà~øàŽðàpøà~øàŽðàpøà~øàŽðàpøà~øàŽðàpøà~øàŽ ðàpøà~øàŽðàpøà~øàŽðàpøà~øàŽðàpøà~øàŽðàpøà~øàŽ ðàpøà~øàŽðàpøà~øàŽðàpøà~øàŽðàpøà~øàŽðàpøà~øàŽ ðàpøà~øàŽðàpøà~øàŽðàpøà~øàŽðàpøà~øàŽðàpøà~øàŽ

  3. #3
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    When you see that kind of data,you will be sure that the baudrate is not propper together with the parity and the number of data and stopbits.
    Try to figger out what is the right baudrate. You can play with your settings of your read program

  4. #4
    Mark Scotford's Avatar
    Mark Scotford Guest


    Did you find this post helpful? Yes | No

    Default

    Slight correction to the wording of my original post. It should have read 12Mhz Crystal clock and not 10, although I did have it right in my coding as far as the DEFINE OSC 12 was correct. I could not work out why my calculations were wrong when compared to the results from Steve's excellent calculator (link shown below). A stupid mistake, but after correcting things, it still does not make any difference to the problem I am having. I have tried changing all the Parameters in Serial Communicator to all the different combinations of settings available and still no joy.

    http://www.picbasic.co.uk/forum/atta...tachmentid=316

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Or the config fuses are not set correctly, or the OSC speed is not the right one OR the MAX232 circuit is bad OR there's a little hardware problem, OR the serial communicator is not set properly OR all DEFINEs are not written in UPPERCASE.

    Bellow is tested and work on a 16f877.. but it shouldn't make any difference whatever PIC you're using...
    Code:
    define OSC 12
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 20h
    DEFINE HSER_SPBRG 77 ' 2400 Bauds
    DEFINE HSER_CLROERR 1
    
    START:
        hSEROUT ["HELLO, THIS IS A TEST",13,10]
        PAUSE 100
        GOTO START
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=959&stc=1&d=1152544022 ">
    Attached Images Attached Images  
    Last edited by mister_e; - 10th July 2006 at 16:07.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    mmm... what about if ...
    Code:
    define OSC 12
    RCSTA1=$90
    TXSTA1=$20
    SPBRG1= 77 ' 2400 Bauds
    DEFINE HSER_CLROERR 1
    
    START:
        hSEROUT ["HELLO, THIS IS A TEST",13,10]
        PAUSE 100
        GOTO START
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Mark Scotford's Avatar
    Mark Scotford Guest


    Did you find this post helpful? Yes | No

    Default

    Steve, I get this out, and I have my Serial Communicator set up the same as the prevous posters

    à€pÇàŽøàŽàøààŽpÇàŽüàŽàpÇàŽøàŽàøà àŽüüøàŽàøàŽàpÇàŽpÇàŽààŽüàŽàpÇàŽøàŽ àøààŽpÇàŽüàŽàpÇàŽpÇàŽøàŽàøààŽüü øàŽàøàŽàpÇàŽpÇàŽààŽüàŽàpÇàŽøàŽàøà àŽpÇàŽüàŽàpÇàŽpÇàŽøàŽàøààŽüàŽàpÇàŽøàŽ àøààŽpÇàŽààŽüàŽàpÇàŽøàŽàøààŽpÇ àŽüàŽàpÇàŽpÇàŽààŽ

  8. #8
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Is your powersupply oscillating?
    Did you mount a capacitor over the supply points of the chips?

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