MCF51QE - HELP Define & Storage Variables

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCF51QE - HELP Define & Storage Variables

1,123 Views
jreyes085
Contributor I
Im having troubles defining variables in codewarrior 6.2, can you tell me where can i find information about C programming with the MCF51QE in codewarrior? more specifically about defining variables and the  memory storage in that chip...

I want two variables, one for voltage and one for current that changes over the time. Im measuring each from the power line and using the ADC to have the digital value of them. The idea is to calculate the energy that is been used. So, we have one more variable to have the accumulate value of the product of current and voltage (not that easy when using a gain control). I would need that three variables for my project.

I need a little help with where do i have to storage these variables in memory (static, volatile, etc) if im using and interruption, when a conversion completes (ADC Module triggered with the RTC> coco=1), that changes these variables. Whats the best way to do it? i defined that variables as GLOBAL, outside of the main, but when compiling there was an error in the interruption when a conversion is complete (coco Interruption subroutine), why?

Thanks to all, and i´ll appreciate your help.
Labels (1)
0 Kudos
1 Reply

259 Views
J2MEJediMaster
Specialist I
Look in the Help directory of the CodeWarrior directory and there should be a Targeting ColdFire Manual as an Acrobat file in there. This should answer some of your questions about variables. Also take a look at some of the demo programs to get a feel for how to use the variables in your program. HTH.

---Tom
0 Kudos