Quantcast
Channel: Renesas Synergy Platform
Viewing all articles
Browse latest Browse all 23645

Forum Post: RE: Example of ADC without framework

$
0
0
Hello Pete: You are probably not doing the scan config.  I had the same problem. My init code: // set up adc in configurator to scan forever, then pick up most recent data as needed err = g_my_adc.p_api- open(g_my_adc.p_ctrl, g_my_adc.p_cfg); // confirm SSP_SUCCESS err = g_my_adc.p_api- scanCfg(g_my_adc.p_ctrl,g_my_adc.p_channel_cfg); err = g_my_adc.p_api- scanStart(g_my_adc.p_ctrl); I use continuous scan mode since I have no power issues.  Then I pick up the most recent A2D counts as needed.  I do not use the framework for this.  If you are doing a simple 16 bit read of a register then it should not be possible for the A to D to write one byte while you read the other (thread safe).  I just read the value I need: Channel_0_val = R_S12ADC0- ADDRn[0]; // read result Channel_1_val  = R_S12ADC0- ADDRn[1]; // read result No interrupts are needed using this method.  Just scan continuous and grab the data as you need it. Hope this helps, Steve D

Viewing all articles
Browse latest Browse all 23645

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>