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

LIS3L02AL Final code Need Help
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jacqueskleynhans



Joined: 10 Apr 2008
Posts: 109
Location: Cape Town, South Africa

View user's profile Send private message

**
PostPosted: Tue Sep 02, 2008 5:52 pm     Reply with quote

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

View user's profile Send private message

**
PostPosted: Wed Sep 03, 2008 4:41 am     Reply with quote

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??

Confused
_________________
"THE ONLY EASY DAY WAS YESTERDAY"
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Wed Sep 03, 2008 7:50 am     Reply with quote

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

View user's profile Send private message

**
PostPosted: Wed Sep 03, 2008 8:51 am     Reply with quote

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

 
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