|
|
View previous topic :: View next topic |
Author |
Message |
davidMoore
Joined: 11 Apr 2006 Posts: 2
|
Serial port problems |
Posted: Wed May 24, 2006 2:53 pm |
|
|
Hi,
I'm trying to send some information from a PIC16F688 to my PC, and it doesn't work.
I'm using a PCW C compiler: IDE Version 3.43, PCB Version 3.202, PCM Version 3.302, PCH Version 3.202
The code I'm using sends a character each 4 secs and also flashes an LED at the same rate (just to verify that the program is running).
The problem is that if I comment the #use rs232 line and the putc line, I see the LED flashing. However when I uncomment those 2 lines, I neither see the LED flashing nor the character arriving to my PC.
The code goes as follow:
#include <16F688.h>
#device ICD=TRUE
#fuses PUT,INTRC,NOWDT,NOPROTECT
#use delay(clock=8000000)
//#use rs232(baud=9600, xmit=PIN_C4, rcv=PIN_C5, ERRORS)
void main()
{
int i;
i = 1;
while(TRUE)
{
if (i==1)
{
output_low(pin_A0);
i = 0;
}
else
{
output_high(pin_A0);
i = 1;
}
//putc('x');
delay_ms(4000);
}
}
I'm using TTL/RS232 to do the level conversion. I also tried removing that converter chip, and nothing changed, I replaced it, nothing changed. I replaced the PIC, nothing change..., I tested the serial port on my computer and it is working, I changed serial port in my computer, but nothing changed.
Any idea what I'm doing wrong ?
Regards,
David |
|
|
Ttelmah Guest
|
|
Posted: Wed May 24, 2006 3:03 pm |
|
|
Have you got the special 20pin ICD chip?. If not, having the ICD fuse set will cause no end of problems.
Does the flash occur at the expected rate (4 seconds on, 4 seconds of)?. If not, add a 'setup_oscillator' line. I thought that 3.202, was 'before' handling this automatically was reliable.
Best Wishes |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed May 24, 2006 3:30 pm |
|
|
Quote: |
I'm trying to send some information from a PIC16F688 to my PC, and it
doesn't work.
I'm using a PCW C compiler: IDE Version 3.43, PCB Version 3.202,
PCM Version 3.302, PCH Version 3.202 |
The start-up code is totally screwed up for the 16F688 in vs. 3.202.
This includes the code that configures the UART, analog ports, the
comparators, etc. Is there any chance you can upgrade the compiler ? |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|