MCF51QE - HELP Define & Storage Variables
01-20-2009
05:24 AM
1,379 Views

jreyes085
Contributor I
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
1 Reply
01-20-2009
03:26 PM
515 Views

J2MEJediMaster
Specialist I
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
---Tom
