scanpa Guest
|
RS232 Problem with ICD |
Posted: Fri Mar 25, 2005 4:19 pm |
|
|
I guys,
I have a lot of problem using software RS232.
In my application a PC sends a command and receives an answer from a 18F2320@ 40Mhz Board.
Hardware is ok because I'm porting a program written in Basic Pro that works perfectly.
I'm using lastest PCH 2.222
here the RS232 declaration :
#use rs232 ( STREAM = PC_SW_UART, BAUD=38400, XMIT=PC_SERTX, RCV=PC_SERRX, BRGH1OK ,FORCE_SW, ERRORS, DISABLE_INTS )
where PC_SERTX and PC_SERRX are PORTA.2 and PORTA.3.
I have two kind of problems :
1) When Precompiler directive ICD=TRUE is set PIC is not able to receive anything from PC link and so I'm not able to debug
2) With ICD=FALSE Software RS232 works quite fine but depending on the routine called, a back message is generated and after that the RS232 stops to work for a while (let say about 5 secs).
I dind't add on the code any further initialization for PORTA except the setup_port_a( NO_ANALOGS );
I'm using fget and fput with stream ID = PC_SW_UART
have you any idea of what is wrong ?
Thank you so much
Paolo |
|