rs232 with hardware USART


Results 1 to 17 of 17

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    "ie i send 12 and nothing is echoed back
    then i send 16 and 12 is echoed back
    then i send 58 and 16 is echoed back

    etc...

    what would be the cause of this?"


    o.k i don't know if it's working for you now without the delay but in case not it seems to be an baud rate problem. So now you have to try those one and remove DEFINE HSER_BAUD 9600 command line.

    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 20h
    DEFINE HSER_SPBRG 31


    or if it's not working good


    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 24h
    DEFINE HSER_SPBRG 129


    Q."what is this hash supposed to do?"
    A. typing problem from myself ... i'm not proud of me. but in this
    case it suppose to return you the ASCII decimal value of your
    entry. EX if you send 1 to pic he will return 49


    Q."also what is your reasons for leaving out the
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 20h
    lines?"

    A. it seems that you don't need them if you use DEFINE
    HSER_BAUD 9600 line... but i'm really not sure since i've never
    use them before this post

    "the echo back seems to be delayed by 1 transmission."
    As you must know, if you use MicroCode Studio or hyperterm or other if you send 11, the result of datain is not 11. It will be separate in two byte that contain ASCII value (49 decimal,31 Hex). if you want to send value you must send them in one byte.
    that mean if you want to get 11 as value you have to send 11 in hexadecimal. or baddest way if value<99

    Hserin [FByte, SByte]
    value = ((FByte-48)*10)+(Sbyte-48)
    Hserout[#value]
    it works but this is really stupid to do it like this.

    regards
    Last edited by mister_e; - 14th October 2004 at 02:49.
    Steve

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

Similar Threads

  1. RS232 comm
    By longdw in forum Serial
    Replies: 9
    Last Post: - 15th September 2009, 04:13
  2. Benefits of hardware usart over software?
    By sccoupe in forum Serial
    Replies: 2
    Last Post: - 19th March 2009, 02:16
  3. Replies: 6
    Last Post: - 31st August 2007, 10:31
  4. problem with USART
    By leemin in forum Serial
    Replies: 4
    Last Post: - 11th December 2006, 18:56
  5. 16F628 Hardware USART problem
    By atomski in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 26th May 2004, 08: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