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 support@ccsinfo.com

Bad array values

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



Joined: 11 May 2007
Posts: 57
Location: Montreal,Canada

View user's profile Send private message

Bad array values
PostPosted: Wed Oct 31, 2012 6:40 am     Reply with quote

Hi,

I am making a hydronic controller that controls fifteen temperature zones. Usually I don't need the forum but every time I used it I was very happy.

My problem is that my float array containing temperature values got corrupted. The array has 20 values in it but I only use 15, I keep the rest for expansion. So as I said it got corrupted, the first 8 values were ok and the last 7 were stuck at 16.0, where it was suppose to be 22.0 about.

So what I did instinctively is move the function to another place in the IDE and the problem was solved, but it left me with a void in my mind. I have built a prototype PCB around this controller the PIC24FJ128GA010. I programmed a LOT of times the MCU, so maybe the controller is getting tired.

Could this be that my array corruption was because of this. By chance my proto PCB is made the same way as the explorer16 board with a socket mount for the microcontroller. Any feedback is well appreciated. thx

AC
---------------------
_________________
think a bit at the time
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Wed Oct 31, 2012 7:13 am     Reply with quote

I have had array corruption values in my past.

Every time this happened - it was because my code had a failure to control the array INDEX value or a pointer.

I have never had a PIC with bad user RAM ( EEPROM YES - user RAM - never been bad).
Chibouraska



Joined: 11 May 2007
Posts: 57
Location: Montreal,Canada

View user's profile Send private message

PostPosted: Wed Oct 31, 2012 7:30 am     Reply with quote

Yes i know about the array index but in my case its not this. I am sure because i took the block of code and moved it and it solved the problem. I think its ROM corruption not RAM even if it looks like RAM because the values are bad.
It happened to me with RAM. I had these bugs that got fixed just by re- locating the global variable declaration from one place to another, why is this not sure??
I am always careful to declare enough cells in an array to contain all datum including zero terminator in strings. Thanks for your input.


AC
-----------------
_________________
think a bit at the time
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