| View previous topic :: View next topic |
| Author |
Message |
jacqueskleynhans
Joined: 10 Apr 2008 Posts: 109 Location: Cape Town, South Africa
|
| ** |
Posted: Tue Sep 02, 2008 5:52 pm |
|
|
Ok we won the battle but not the war:
im getting | Code: | X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000 X:0.000 Y:0.000 Z:0.000
|
So i recon something in my conversion might be a mistake.
i will remove the *=16
changed the int16 to 8's
Does the way i return the float look correct in the
| Code: | | float Compensate_X(int16 xval); | sections _________________ "THE ONLY EASY DAY WAS YESTERDAY" |
|
 |
jacqueskleynhans
Joined: 10 Apr 2008 Posts: 109 Location: Cape Town, South Africa
|
| ** |
Posted: Wed Sep 03, 2008 4:41 am |
|
|
I think the problem lies in the convertion stage where i do the actual adc sample then do the compensation. Something does not work right there??
 _________________ "THE ONLY EASY DAY WAS YESTERDAY" |
|
 |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Wed Sep 03, 2008 7:50 am |
|
|
| jacqueskleynhans wrote: | | I think the problem lies in the convertion stage | Don't think, take actions so you 'know'.
For debugging there are several options, in order of preference:
- Hardware emulator (Microchip Real ICE)
- In-Circuit-Debugger (Microchip ICD2 or CCS ICD-U40)
- PicKit II
- MPLAB's software simulator
- Printf statements
The Real ICE is a great tool but expensive ($1000+).
The ICD is a good alternative and allows you to step through your source code, set breakpoints and examine variables, memory, etc. The original Microchip ICD-2 costs about $160 but cheaper clones exist. The CCS ICD-U40 is cheaper than the ICD-2 but can not be used in MPLAB.
The PicKit-II is new to me. It is a programmer with debug features and a lot cheaper than the ICD2, costing $35. It used to have limited debug features but with the latest software updates almost all processors are supported for in-circuit-debugging. If your processor is supported this seems just as good as an ICD-2.
If you can't spend the money or your hardware is not ready yet MPLAB's Simulator is another possible test environment. The main disadvantage from an ICD is that the Simulator only simulates the processor, it is difficult to simulate the external connected hardware (sensors, buttons, etc).
Printf is the poor man's debugger. Labour intensive but for free. |
|
 |
jacqueskleynhans
Joined: 10 Apr 2008 Posts: 109 Location: Cape Town, South Africa
|
| ** |
Posted: Wed Sep 03, 2008 8:51 am |
|
|
I have an icd2 but i have never actually need to debug my code until now.
I gonna have to check how to debug first then do it jeez.
Kind Regards _________________ "THE ONLY EASY DAY WAS YESTERDAY" |
|
 |
|