MCF52259 - ADC calculations

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MCF52259 - ADC calculations

1,109 次查看
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

标签 (1)
0 项奖励
回复
1 回复

598 次查看
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 项奖励
回复