young
Joined: 24 Jun 2004 Posts: 285
|
RS232 error |
Posted: Tue Sep 07, 2004 3:15 pm |
|
|
When I am using RS232 to transfer message, error button on CCW serial port monitor light up, and ON the screen 'X' signal appeared, which according to my program should be 'a', awhat might caused this problem.
I used a RS232 convertor between a 12f675 and the computer, I sued the same system for a long time without anything happened. I just moved the set up to another breadboard. and I checked carefully everything is kept as original. here is my testing program
Code: | #if defined(__PCM__)
#include <12f675.h>
#fuses INTRC_IO,NOWDT,NOPROTECT,PUT,NOMCLR
#use delay(clock=4000000)
#use rs232(baud=9600, parity=N, xmit=PIN_A4, RCV=PIN_A3)
void main()
{
int8 mode; //lighting condition grabbing set
int16 i;
setup_comparator(NC_NC_NC_NC);
while(1) {
char ch=' ';
while(ch!='a')
{
ch=getc();
output_high(PIN_A0);
delay_ms(100);
putc(ch);
}
output_high(PIN_A1);
delay_ms(100);
// mode=1;
// while(mode)
// {
// mode=input_A() & 0x08;
// }
// for(i=0;i<255;i++)
// produce_pwm(i);
// putc(getc()+1);
}
} |
|
|