Im using PCA10040 nrf52832 to measure light intensity with photodiode,
im using SAADC and SPI example to measure values but im not able to see any changes on UART as light intensity changes.
please suggest.
Im using PCA10040 nrf52832 to measure light intensity with photodiode,
im using SAADC and SPI example to measure values but im not able to see any changes on UART as light intensity changes.
please suggest.
im using SAADC and SPI example to measure values
What has SPI got to do with it?
Always start simple - so get rid of the added, unnecessary complication of SPI!
Start with the SAADC example:
im not able to see any changes on UART as light intensity changes
Are there any changes in the voltage at the analogue input pin?
AN0 pin is used
Are you sure you have the correct pin?
See: https://devzone.nordicsemi.com/f/nordic-q-a/47914/saadc-example-problems/189911#189911
Which links to: https://devzone.nordicsemi.com/f/nordic-q-a/46819/problems-with-saadc/184714#184714
this what im getting values.
im using SPI because as whatever using amplifier supports SPI protocol, which is mainly used for ADC operation and then data sent to nrf52832 of AIN0 pin.
You never mentioned any amplifier - we are not mind readers!
But, again, start simple!
Start with the SAADC example, to learn to use the SAADC on its own.
Then use an SPI example, to learn to use the SPI on its own.
Then - once you have understood both parts and have them working well - bring the two together.
Note that a photo-transistor should give you a usable voltage without the need of an amplifier.
Digital light level sensor are also available
Still im getting same values i didnt make any changes in code just using AIN0 pin channel 0. Connected AIN0 (P0.02) to VDD.
Tried SAADC example only but still no changes.
Connected AIN0 (P0.02) to VDD.
You need to swap it between VDD and GND to see a change
thank you Awneil its working fine im getting output.
thank you Awneil its working fine im getting output.
Jolly good!
For the benefit of others who may have similar problems, and find this, please explain what the actual problem was - and how, exactly, you solved it.
And verify the answer:
Hello Awneil,
Im trying to configure or set gain in SAADC example, for various gains it should operate but im not getting how to set gain register so that i get SAADC output depending on various gain and even i tried to change gain values in nrfx.saadc.h file but getting error. gains defined in nrfx.saadc.h files are default one but i want it to work as per my amplifier. So how can i define gains and make it work properly. Im using only 1channel AIN0
Presently its working properly with default gain values.
Please Suggest.
Please Suggest
I suggest that you keep to 1 question per Thread.
So start a new thread for this new question, and give it a good, descriptive title.
You will also need to give more detail of what you've actually tried, and what results you got.