|
|
View previous topic :: View next topic |
Author |
Message |
Guest
|
PORTC headscratcher |
Posted: Mon Jan 10, 2005 12:42 pm |
|
|
Hi
I'm a new owner of PCW. To learn better how to use it, I took an old project that I wrote in assembler and rewrote it in CCSC, version 3.148. I simulated it using Labcenter's Proteus 6.6. Everything works great! It is a datalogging pressure sensor with an LCD screen, I2C memories and an RS232 port that transfers data to the PC as soon as any PC key is pressed.
I then did a slightly different version of the design with no LCD screen but with more sensors. Again, it worked fine in simulation.
However, I upgraded the compiler to the latest version 3.215, and the RS232 data transfer stopped working after being recompiled. After some investigation in Proteus, I found the reason it stopped working was because it appears that bit 7 of PORTC is driving a one out onto the pin. When a received character shows up, the RC7 pin toggles between 1 and Z, not 1 and zero as usual, and the RCIF flag never gets set. The odd thing is is that when I simulate the compiled code in either Proteus or MPLAB, the TRISC bit for bit 7 is sent as an input and the PORTC.7 bit is not driving a one.
When I use PCW 3.191, I still have the same problem. When I simulate in Proteus using my old hex file generated from assembler in MPLAB, everything works fine, so I do not suspect Proteus as a problem at this time.
I know that PORTC is used by the other peripherals, and I'll be checking that, though the registers appear to hold expected values.
I'm about to bore down into the assembler for a line by line check, but this could be tedious to say the least. I thought I'd throw out the scenario to see if anyone has encountered this.
I'm not able to send any code right now, but I just thought I would check as it might save me some time while I start the process of assembler debugging.
Thanks in advance! |
|
|
rberek
Joined: 10 Jan 2005 Posts: 207 Location: Ottawa, Canada
|
|
Posted: Mon Jan 10, 2005 12:45 pm |
|
|
I just checked my post above and it showed up as Guest. I'm actually user rberek! _________________ The difference between genius and stupidity is that genius has its limits... |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jan 10, 2005 1:01 pm |
|
|
Quote: | I took an old project that I wrote in assembler and rewrote it in CCSC, |
It's likely that something went wrong in the translation. Ideally, we
would like to see a small test program that demonstrates the problem.
There was a problem with RS232 using output redirection, and it's
probably fixed in 3.215, but we would need to see a test program
to be sure.
A test program should be a short, but complete program which
shows all pre-processor statements, #include statements, #fuses
statements, etc. |
|
|
rberek
Joined: 10 Jan 2005 Posts: 207 Location: Ottawa, Canada
|
|
Posted: Mon Jan 10, 2005 1:19 pm |
|
|
Hi
I should be able to put something together tonight. Thank you for the reply!
r.b. _________________ The difference between genius and stupidity is that genius has its limits... |
|
|
|
|
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
|