CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PORTC headscratcher

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








PORTC headscratcher
PostPosted: Mon Jan 10, 2005 12:42 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jan 10, 2005 12:45 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jan 10, 2005 1:01 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jan 10, 2005 1:19 pm     Reply with quote

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...
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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