Page 1 of 1

USART programming

Posted: Thu Aug 21, 2008 4:56 pm
by jcooper
I'm working on a PIC18f452, plugged into the HP-488-00-3 demo board, and I'm having issues with the USART. Does anyone have C source code for a simple USART RS232 protocol demonstration? It would be nice to get some for-sure-working code so that I can test the physical setup separately from my code.

Re: USART programming

Posted: Fri Aug 22, 2008 5:39 pm
by Benj
Hello

Which device are you using? Which clock speed? Which Baud rate required?

I will generate you the code to drive the particular device at the particular clock speed and baud.

Re: USART programming

Posted: Mon Aug 25, 2008 5:03 pm
by jcooper
Benj wrote:Hello

Which device are you using? Which clock speed? Which Baud rate required?

I will generate you the code to drive the particular device at the particular clock speed and baud.
I'm programming with an MPLAB ICD2 debugger, the board is running off the RC circuit at 3.46MHz. Any baud rate is fine for now, probably something in the mid-range available with these settings.

Re: USART programming

Posted: Tue Aug 26, 2008 9:06 am
by Benj
Hello

Here is the complete C program for the RS232 UART running at a baud of 4800.