MCF52259 - ADC calculations

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

MCF52259 - ADC calculations

1,113 Views
saibhargavi
Contributor II

Hi,

 

I am currently working on MCF52259 ADC module. I am using an filtering equation to conver the raw value scanned to filter value. But the filtering equation returns the value in float which should be sent to Master via a 16 bit register. I have the following doubts now

 

1) can we declare float variables in micro controller programming?

2) How do i transfer the converted float value to master using 16 bit register?

 

Looking forward for the help

 

Regards

sai bhargavi

Labels (1)
0 Kudos
Reply
1 Reply

602 Views
scifi
Senior Contributor I

Yes, floating point is supported.

As for the second question, I'm not sure what you mean. What exactly is Master and the 16-bit register? A variable of type float is 4 bytes in size. You should either split it in 2 16-bit chunks and transfer in 2 steps, or convert the float to a 16-bit type (loosing some precision in the process) and send the converted 16-bit value.

0 Kudos
Reply