I found a solution to the problem. The Call routine uses the r30 register to store the address at. I currently use that register for manipulating inputs and outputs. At the beginning of the program I added...
.setcallreg r14.w0 That has seemed to resolved the possible register conflict issue and everything is functioning as it should. This now add all of the delays necessary. Although off topic, another issue I seem to be having is with the interrupts necessary to go between both PRU's. I tried to setup a pin to toggle on header P8 but haven't come up with anything coming off of that pin. I know that pin is already allocated to MCASP0. The only solution that seemed to work was that if you went into the boot directory you could open up the device tree and delete the two snippets of code that were apart of MCASP0. From the device tree though it appeared they had already been disabled, so I deleted them. I also had no problem loading a new device tree overlay for pin31. However, with my current code I am trying to access from one PRU to the other so that way I can have one strictly handling data while the other does overhead. Working from PRU1 and wanting to send an interrupt notice to PRU0 I used the following snippet of code to do this. I am using the PRUSSDRV libraries supplied to me by TI. LDI r31, PRU1_PRU0_INTERRUPT+16 Then on the PRU0 side I service the interrupt with the following. First I wait for interrupt to be set, then I clear the ready signal from PRU1. WBS R30, 30 SBCO &r0, C0,0x24,4 SET r31.t0 //Toggle pin 31 on header 8 CLR r31.t0 Once again I get now output from pin 31, nor do I believe that the interrupt is entering correctly. Thanks, Tyler On Wednesday, January 20, 2016 at 2:01:10 PM UTC-5, cmbaker3 wrote: > > This procedure should take about 80ns to run when ever called. The syntax > looks good. > If called from a procedure running on a PRU subsystem, it should soak up > the cycles. > If called from a script running on sysfs, all bets are off on timing. It > might take 200ns or longer. > If you give more information, it would be easier to zero in on the problem. > Chad > > On 1/20/16 10:44 AM, Tyler Turcotte wrote: > > I am currently working on a project that requires many delays in my code > to get the timing correct. I want to call a subroutine multiple times > through my main code to execute a simple delay. Right now I just use. > > CALL DELAY2 > > Which I then have the following code to create a delay before it returns > back to my original code to keep moving along. > > DELAY2: > MOV r8,20 > DEC: > SUB r8, r8, 1 > QBNE DEC, r8, 1 > RET > This doesn't seem to delay my code all the time and doesn't always seemed > to get called. It gets called approximately 25 times in my script. > > Write now I have the subroutine placed after my end statement. I have > tried it in my main code as well but seems to go out of its loop. > > Is this the proper syntax to execute a subroutine on the PRU? > > Thanks, > Tyler > > -- > 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] <javascript:>. > For more options, visit https://groups.google.com/d/optout. > > > -- 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.
