PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat May 03, 2008 9:44 am |
|
|
The following program works. See the key points shown in bold below.
If you run it in MPLAB simulator and use the MPLAB "UART1" for output,
it displays this in the output window:
Quote: |
#include <16F877.H>
#device PASS_STRINGS=IN_RAM
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
unsigned char const test[] = {"HELLO"};
void demo(unsigned char *ptr)
{
printf(ptr);
}
//====================================
void main()
{
demo(test);
while(1);
} |
|
|