View previous topic :: View next topic |
Author |
Message |
newguy
Joined: 24 Jun 2004 Posts: 1903
|
16f88 analog problems |
Posted: Wed Aug 25, 2004 6:58 pm |
|
|
Quick question: are there any known bugs with v3.178 and the 16f87 & 16f88?
I developed a system using a 16f877 to prototype everything, and it works great. I ported the code over to a 16f88, and I can't even get it to flash LEDs properly. Will I have to upgrade my compiler? |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Aug 26, 2004 1:13 am |
|
|
I wish you had looked in the archives.
Someone posted a work-around for the UART problem.
They said you can trick the compiler into using the hardware UART
by giving it pins C6 and C7 in the #use rs232() statement.
I tried that just now, and it appears to talk to the proper registers.
I installed PCM vs. 3.178 for this test. Look at the .LST file to
confirm the results.
Code: | #include <16F88.h>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 4000000)
#define PIN_C6 62
#define PIN_C7 63
#use rs232(baud = 9600, xmit=PIN_C6, rcv=PIN_C7)
//====================================
void main()
{
char c;
while(1)
{
c = getc();
putc(c);
}
}
|
|
|
![](templates/subSilver/images/spacer.gif) |
newguy
Joined: 24 Jun 2004 Posts: 1903
|
|
Posted: Thu Aug 26, 2004 9:29 am |
|
|
PCM,
I wish it was spelled out like that in the archives. I did search through it - many times - yesterday, and I did find that trick. What I did was assign the uart's tx and rx pins in the #use rs232 definition, only to have it rejected by the compiler. It didn't occur to me to (mis)define pins C6 and C7 beforehand. I will try that out. Thanks for the suggestion. |
|
![](templates/subSilver/images/spacer.gif) |
|