View previous topic :: View next topic |
Author |
Message |
delesan
Joined: 23 Jun 2010 Posts: 19
|
DISABLE 12LF1822 EUSART |
Posted: Fri Feb 04, 2011 3:18 am |
|
|
Hi everyone,
Still having challenges with the 12LF1822. Am trying to completely disable the EUSART - both transmit and receive.
Used setup_uart(0) and setup_uart_speed(0) but CCS C compiler (version 4.110) gave an error of unidentified for both.
Appreciate your suggestions.
Regards |
|
|
delesan
Joined: 23 Jun 2010 Posts: 19
|
DISABLE 12LF1822 EUSART |
Posted: Fri Feb 04, 2011 4:03 am |
|
|
Included the following code before main() to disable the EUSART:
#byte TXSTA=0x02
#byte RCSTA=0x08
The registers TXSTA and RCSTA are the registers for configuring the EUSART for the 12LF1822.
Regards. |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Fri Feb 04, 2011 6:57 am |
|
|
FWIW, If you take a look at the device header file:
Quote: |
////////////////////////////////////////////////////////////////// UART
// Constants used in setup_uart() are:
// FALSE - Turn UART off
// TRUE - Turn UART on
|
_________________ Google and Forum Search are some of your best tools!!!! |
|
|
delesan
Joined: 23 Jun 2010 Posts: 19
|
|
Posted: Fri Feb 04, 2011 7:00 am |
|
|
dyeatman wrote: | FWIW, If you take a look at the device header file:
Quote: |
////////////////////////////////////////////////////////////////// UART
// Constants used in setup_uart() are:
// FALSE - Turn UART off
// TRUE - Turn UART on
|
|
Thanks dyeatman.
I actually tried that but got a compiler error of "undefined identifier".
delesan |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19549
|
|
Posted: Fri Feb 04, 2011 7:57 am |
|
|
You will get that error, if you have not got a #USE RS232 using the hardware UART (the UART is _off_ in this case anyway).
The setup_uart command, only becomes supported if UART code is present.
Best Wishes |
|
|
|