As far as I understood from the example, it should be enough to enable "OCP port" and point to TSC ADC registers (i.e. on-board/internal ADC registers) in order to configure and read values, am I right?
Hence, I wrote down a header file (i.e. sys_tscadcss.h) which contains the structure that represents the TSC ADC registers (e.g. sysTscadcss struct with register fields REVISION, SYSCONFIG, etc.). Then, I created also the TSCADCSS variable of type sysTscadcss in this header file. In order to point to the right TSC ADC's memory location (i.e. 0x44E0D000), I used two ways that I took from some examples of PRU software support package: 1. "#define TSCADCSS (*((volatile sysTscadcss*)0x44E0D000))" ; 2. "volatile __far sysTscadcss TSCADCSS __attribute__((cregister("TSCADCSS", far), peripheral));" with its constant define "TSCADCSS (R) : org = 0x44E0D000 len = 0x00000300 CREGISTER=27" in AM335x_PRU.cmd file. In both cases, the pru firmware compiles, and runs. However, in the same both cases, when I try to read any register with a default value not equals to 0 (e.g. REVISION, ADCSTAT, etc. ), I read 0. Any idea what I am missing, please? Il giorno giovedì 19 gennaio 2017 08:15:01 UTC+1, in...@orionitalia.com ha scritto: > > On Mon, Jan 16, 2017 at 9:55 AM, Greg <soapy...@comcast.net> wrote: > >> I'm pretty sure that others have successfully accessed the internal ADCs >> from the PRU. If you do some searching I think you can find a specific >> instance. >> I think it should be possible via the PRU's OCP master port. >> > > So far, I found examples that access the internal ADC from PRU, but none > using C language. For example, this > <https://raw.githubusercontent.com/pgmmpk/beaglebone_pru_adc/master/src/firmware.p> > is taken > from the previously linked python library. We are going to deep our > understanding of this example, hopefully it is possible to write a working > counterpart in C :) > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/e0e42e3f-e03d-47bf-a741-045a2663437a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.