Thanks Charles this helps, I didn't realize a single address location is used to modify two constants. I'm slowly working my way through the documentation, but there's a lot of it without many examples I've found to date and the examples supplied didn't really explain what was going on. On a separate issue, do you know of any examples that use the debug registers? Finally, 5.4.7 has a typo (SPRUHF8A– May 2012 –Revised June 2013 it states it modifies entries 24 and 25 in the PRU Constant Table where it should be entries 26 and 27 - it's a pretty obvious typo though so it shouldn't cause problems)
On Monday, February 16, 2015 at 3:22:50 PM UTC-5, Charles Steinkuehler wrote: > > On 2/16/2015 12:37 PM, Bit Pusher wrote: > > I am having difficulty understanding a short snippet of code from > > the PRU_memAcc_DDR_sharedRAM.p example. The code is: > > > > // Configure the programmable pointer register for PRU0 by setting > > c31_pointer[15:0] > > // field to 0x0010. This will make C31 point to 0x80001000 (DDR > > memory). > > MOV r0, 0x00100000 > > MOV r1, CTPPR_1 > > ST32 r0, r1 > > > > The comment states the field is being set to 0x0010 yet the immediate > value > > being programmed into > > r0 is 0x00100000 not 0x0010. I can not understand why this sets the > pointer > > to 0x80001000 rather than > > 0x8010000. Are there any pruss programmers that could shed some light on > my > > misunderstanding here? > > The example does work and does give an offset 0x1000 bytes in the DDR > > memory, so there is something I'm > > missing. Thanks in advance. > > Just follow through the PRU reference guide. > > Section 5.4.9 CTPPR1 Register > The value is being written to CTPPR1, which controls the pointers for > entries 30 and 31 in the constant table. The 0x00100000 value written > breaks down as: > > Bits 31-16 = 0x0010 = C31 Pointer value > Bits 15-00 = 0x0000 = C30 Pointer value > > > Section 5.2.1 Constant Table > The 0x0010 C31 pointer value gets combined with the constant table value > to form the actual address: > > 0x80nn_nn00, nnnn = c31_pointer[15:0] > > So since the C31 pointer from CTPPR1 is 0x0010, the resulting address is: > > 0x80nn_nn00 with nnnn=0x0010 or 0x8000_1000 > > Easy-peasy! > > -- > 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/d/optout.
