PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Apr 02, 2007 1:47 pm |
|
|
I don't have that version. The closest I have is vs. 3.230.
Try a simple test program, as shown below. Connect the 18F4620 to
the serial port on your PC, by using a MAX232-type chip. Then open
a terminal window on your PC and type in some characters. The
program shown below should receive those characters and send them
back to the PC, where they will be displayed on the terminal window.
Code: |
#include <18F4620.h>
#fuses HS, NOWDT, BROWNOUT, PUT, NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
#int_rda
void rda_isr(void)
{
char c;
c = getc(); // Get character from PC
putc(c); // Send it back to the PC
}
//========================
void main()
{
enable_interrupts(INT_RDA);
enable_interrupts(GLOBAL);
while(1);
} |
|
|