0

Activate oversample in Arduino IDE for nrf52832

CSChris gravatar image

asked 2017-08-14 16:35:03 +0200

Hi,

do I have a chance to activate oversample for an ADC by using Arduine IDE?

Best regards, Christian

edit retag flag offensive close delete report spam

Comments

1

See my answer in your previous question. You will have to modify the RBL Arduino library.

Jørgen Holmefjord ( 2017-08-14 17:10:46 +0200 )editconvert to answer

Hi Jørgen, thanks for your answer. Do you have any hint on examplary code? Maybe with sandeepmistry's libraries? https://github.com/sandeepmistry/ardu...

BR, Christian

Christian ( 2017-08-14 22:26:42 +0200 )editconvert to answer

1 answer

Sort by » oldest newest most voted
0
joh2 gravatar image

answered 2017-08-15 08:23:05 +0200

Hi,

Something like this should work (based on the RedBear library):

wiring_analog.cpp

wiring_analog.h

You can then set oversampling using analogReadOversample(uint16_t oversample).

(I have not tested the code, so please let me know if there are any errors)

Best regards,

Jørgen

edit flag offensive delete publish link more

Comments

Hi,

I have taken your code and put it into mine. It seems to work. With a resolution of 14 bit and 4x Oversampling the noise is cut to half. But it is still a very high noise. For higher oversampling rates the reading hardly gets better. Is any further trick for less noise available?

Best regards, Christian

Christian ( 2017-08-15 11:33:35 +0200 )editconvert to answer

Please have a look at this answer from the SAADC designer.

Jørgen Holmefjord ( 2017-08-15 11:38:11 +0200 )editconvert to answer

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

User menu

    or sign up

Question Tools

1 follower

Stats

Asked: 2017-08-14 16:35:03 +0200

Seen: 49 times

Last updated: aug. 15