From: Nhan Nguyen <[email protected]> Reply-To: <[email protected]> Date: Saturday, February 22, 2014 at 5:40 PM To: <[email protected]> Subject: Re: [beagleboard] PRUSS and accessing ADC registers on Beaglebone Black
> Hi Charles, > > Thank you very much for your answer. I manage to access it after enable ADC > using 'echo BB-ADC > /sys/devices/bone.capemgr.*/slots' . Though I could only > do it in kernel 3.8, later kernel (3.12) gives an error saying symbol ocp > could not be found. I do not really know how to change the .dts to get it > working . Anyhow, I will work with 3.8 for now. There is no cape manager in V3.12 Regards, John > > Sincere, > Nhan Nguyen > > On Wednesday, February 19, 2014 2:57:31 PM UTC+1, Charles Steinkuehler wrote: >> On 2/19/2014 7:43 AM, Nhan Nguyen wrote: >>> > Hi everyone, >>> > >>> > I have been trying to use PRU to read multiple ADC inputs. Unfornately, I >>> > am stuck at accessing to the ADC registers (chapter 12 on AM335x technical >>> > reference manual). I set the OCP registers, checked the PMAO registers on >>> > PRU to ensure access to external host. For example, I read the ADC >>> REVISION >>> > as below: (tried to write to STEPCONFIG and STEPENABLE, etc.) >>> > >>> > MOV r13, 0x44E0D000 //ADC REVISION >>> > LBBO r5, r13, 0, 4 >>> > SBCO r5, C28, 4, 4 //store REVISION to shared memory to show with C >>> > program >>> > >>> > .. but everything returns 0. >>> > >>> > I install Ubuntu 13.04 on Beaglebone Black, tried kernels 3.8, 3.12. PRU >>> > worked with shared memory accessing, and GPIO1 registers (I am not sure >>> > what to try next) . I haven't tried it on the official Angstrom image, >>> > because I still couldn't get PRU to work right away on it. >> >> I suggest you remove the PRU from the setup temporarily and try directly >> reading the memory from C. This will be a lot easier to debug, and the >> PRU has no chance of reading ADC values if you can't read them from the ARM. >> >> As a guess, I suspect you don't have the ADC hardware setup properly and >> are getting bus faults when reading. This will show up as an error if >> you try to read the memory location from the ARM (making it easier to >> debug). Make sure you have loaded a device tree overlay that enables >> the TSC hardware (Touch Screen Controller = ADC) and populates an >> appropriate state-machine instruction table to digitize the values you >> are interested in. Unlike simpler microcontrollers, each major >> subsystem in the AM335x can be powered up or shut down, and by default >> most systems (ADC, PWM, etc) are powered down with their clocks disabled >> until you explicitly enable them. >> >> Once you can properly read the values from a raw memory location using >> the ARM, the PRU should be able to read them as well. >> >> -- >> Charles Steinkuehler >> [email protected] <javascript:> > > -- > 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 [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. -- 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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
