hardware/software uart problem


+ Reply to Thread
Results 1 to 3 of 3

Thread: hardware/software uart problem4740 days old

  1. #1
    richardy
    Guest richardy's Avatar

    0 Not allowed!

    Default hardware/software uart problem

    Hi,
    Is it possible to change the baudrate of teh hardware UART while a program is running? For example teh following code sets up the hardware uart;

    Code:
    HSERIAL_RCSTA = $90 ' Enable serial port and continuous receive
    HSERIAL_TXSTA = $24 ' Enable transmit and asynchronous mode 
    HSERIAL_BAUD = 9600 ' Set baud rate to 9600
    HSERIAL_CLEAR = On
    HOwever if i try and change the baud rate durring program execution i get an error.

    Aparently another option is to use is software uart, i assume this isnt the simple serin and serout etc. Any help with this would be much apreciated.

    Cheers,

    Richard.

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    mister_e
    Guest mister_e's Avatar

    0 Not allowed!

    Default

    In this case, you write to the register(SPBRG,RCSTA,TXSTA) directly
    Code:
    RCSTA = $90 ' Enable serial port & continuous receive
    TXSTA = $24 ' Enable transmit, BRGH = 1
    SPBRG = 129 ' 9600 Baud @ 20MHz, 0.16%
    '
    '
    '''
    ''
    RCSTA = $90 ' Enable serial port & continuous receive
    TXSTA = $24 ' Enable transmit, BRGH = 1
    SPBRG = 10  ' 115200 Baud @ 20MHz, -1.36%
    '
    '
    ''''
    ''
    '
    '
    RCSTA = $90 ' Enable serial port & continuous receive
    TXSTA = $24 ' Enable transmit, BRGH = 1
    SPBRG = 64  ' 19200 Baud @ 20MHz, 0.16%
    '
    '    etc etc

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    richardy
    Guest richardy's Avatar

    0 Not allowed!

    Default

    Hi Steve,
    Thanks for that - problem sorted!

    Cheers,

    Richard.

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Hardware and Software Interrupts
    By ~ Sy ~ in forum The Lounge
    Replies: 4
    Last Post: 13th August 2009, 08:16
  2. 16F877A hardware UART
    By Richard in forum Proton Plus Compiler v3
    Replies: 20
    Last Post: 14th February 2007, 16:21
  3. SPI Software / Hardware
    By dmTulsa in forum Proton Plus Compiler v3
    Replies: 10
    Last Post: 27th October 2006, 21:50
  4. [SOLVED !] Additional Hardware UART
    By EnkiLondon in forum Proton Plus Compiler v3
    Replies: 0
    Last Post: 14th March 2005, 11:53

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts