April 04, 2020, 10:53:25 pm


Have you visited the Allwinner Chipset wiki? - http://linux-sunxi.org/

How to read ADC - LRADC0/1?

Started by whoisbhauji, November 19, 2014, 03:33:21 am

Previous topic - Next topic


Hi All

I have a sister board giving data of 8 analog devices - i connect this to CN8, pin 28/30 of cubietruck. But how do i read the values?

Should i use it as a GPIO (i read somewhere that it is PB10?)
I also found key.c - should i  use sunxi_key_read from key.c? In the latter, i see only ADC0 so i fear it is for an older A20.. is there a newer library?

I might be wrong both ways - hence any pointers are welcome.



I wanted to read LRADC0 or LRADC1 too.

I just changed the gpio mmap example by setting the register, decribed in the A20 Manual.

I could read LRADC1, connected by a little solar cell form 0..700mV.

LRADC0 seems to be connected in another way, but LRADC1 works.

For me it's OK.

I hope you and others could use it too.



I'm stucked :-/
I find no way to use the LRADC1, could someone help me out?



Hello Meex,

i am back from vacation and now i can try to help you.

I had been found no program to read from LRADC0/1, too a year ago

I studied the manual and i changed the little program A20_mmap_lradc.c which worked for me. It prints out the volage from LRADC.

I wanted to read the brightness with a little solar cell which was connected directly to LRADC1 and ground.
May be a more professional circit should be used with a reference voltage.

What do want to read with LRADC1 ?