On 2/26/14, 9:07 AM, "Charles Steinkuehler" <char...@steinkuehler.net>
wrote:

>You can enable the ADC without device tree, or without Linux if you
>want.  The TRM and data sheet have the details on how to power up/down
>various parts of the system, and how to manage the clock generation for
>the different sub-modules.  However, it's fairly complicated, and I
>suggest you let the Linux kernel drivers manage the clock and reset
>trees for you, and continue to enable the ADC using device tree.
Charles, I think Nhan is getting confused between the Cape Manager and
Device Tree. He was attempting to use Cape Manager to load the Device Tree
Overlay in V3.12 and I explained that there is no Cape Manager in V3.12.
His next question was how to enable ADC without DT.

Nhan, you can use DT in V3.12. Cape Manager is used to discover attached
Capes and to adapt pinmux and DT, which then loads the required device
drivers. The Cape Manager can also load and unload DT overlays while the
system is live. With V3.12, you cannot do this so you have to setup the DT
at boot time. 

Regards,
John
>
>On 2/26/2014 8:05 AM, Nhan Nguyen wrote:
>> Hi John,
>> 
>> Is there a way to enable ADC without using device tree? I couldn't find
>>a 
>> way to do it in the reference manual. Thank you.
>> 
>> Regards,
>> Nhan
>> 
>> On Sunday, February 23, 2014 3:05:39 AM UTC+1, john3909 wrote:
>>>
>>>
>>>
>>> From: Nhan Nguyen <chinh...@gmail.com <javascript:>>
>>> Reply-To: <beagl...@googlegroups.com <javascript:>>
>>> Date: Saturday, February 22, 2014 at 5:40 PM
>>> To: <beagl...@googlegroups.com <javascript:>>
>>> 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
>>>> cha...@steinkuehler.net
>>>>
>>> -- 
>>> 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...@googlegroups.com <javascript:>.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>> 
>
>
>-- 
>Charles Steinkuehler
>char...@steinkuehler.net
>
>-- 
>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.
>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 beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to