You only can get delta m/s, since the value gotten by the accelerometer is nothing but a voltage singnal interpretated as acceleration-induced motion with a full-scale range of /-2g (19.6 m/s/s). Datasheet of the accelerometer that the kit used:
The datasheet of the actual chip used, could be found here, http://www.kionix.com/Product-Specs/KXSC7-2050%20Specifications%20Rev%204.pdf. The accelerometer gives out voltage proportional to the acceleration. Since it is a 3 axis accelerometer there are 3 voltages corresponding to each of these axes. The zero-g offset voltage is 1.65 volts when the chips is powered with 3.3 volts supply, which implies that the X and Y axes will measure 1.65 volts when the accelerometer is held howrizontal in the XY plane. The sensitivity of this accelerometer 660 mV/g, which effectively implies that when the accelerometer sees one g of acceleration the output voltage would be (1.65V 0.66V) or (1.65V - 0.66V). This voltage needs to be digitisded using the Delsig ADC on PSoC3. For a 12 bit configuration, single ended mode with VSSA-VDDA being the range, the smallest voltage that can be measure is 0.8 mV(1 count). If you measure a count of 2163 from ADC, then the measured voltage is (2163*8 mV =1.73 V). Effectively the accelaration seen corresponds to the 0.08 Volt (1.73V -1.65V). The actual acceleration in g is now given by (80/660)g = 0.1212 g, which is equivalent to 1.187 m/s2. I hope this helps.
Ok, i`m reading the ADC value in a uint16 variable. But the problem is that the function UART_PutChar have a uint8 parameter. This is my code:
accel = ADC_GetResult16();
pointer = &accel;
But i think this isn`t working. Is that correct?
How can i send this value by uart component? Could you give me an example please?
It would be helpful to debug the issue if you could throw some light on the following:
- Is your UART working with PutChar function?
- How are you seeing the UART output? Which kit are you using ?
- Have you made sure that Global interrupt is enabled in your code
- Have you used the API UART_Start() in the code before sending the data.