This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Use PRU to control general GPIO

Hi,

I'm new to the PRUss of AM335X processor.

In order to learn PRU to control general GPIO like GPIO0_7 on the EVM, I wrote following code. But the GPIO0_7 has no action when following code was executed. Can you familiar with PRU help on this problem.

BTW: Since the EVM uses GPIO_7 to control the LCD backlight, I think the GPIO0 module should have been configured and enabled.Should I redo these in the PRU firmaware?

Thanks,

//*************************************************************//

  #define PRU0_CNTL_REG 0x00026000
    LDI r12.w0, PRU0_CNTL_REG & 0xFFFF
    LDI r12.w2, PRU0_CNTL_REG >> 16
    MOV32 r13, 0x5
    SBBO r13, r12,4,4  //disable standby


    MOV32 r13,3
    SBBO r13, r12,0x28,4 //enable offset of -0x0008_0000


   #define GPIO_ADDRESS           0x44E07100
   LDI r12.w0, GPIO_ADDRESS & 0xFFFF
   LDI r12.w2, GPIO_ADDRESS >> 16
   LBBO r13, r12,0x34,4
   MOV32 r14, 0xFFFFFF7F
   AND r13,r13,r14    

  SBBO r13,r12,0x34,4  //set GPIO0_7 to output


   MOV32 r13,0x80
   SBBO r13,r12,0x90,4 //Clear GPIO0_7


   MOV r14,1
Delay2:   
   ADD r14,r14,1
   QBGT    Delay2, r14, 0xFF
   MOV32 r13,0x80
   SBBO r13,r12,0x94,4//Set GPIO0_7


   MOV r14,1
Delay3:   
   ADD r14,r14,1
   QBGT    Delay3, r14, 0xFF
   MOV32 r13,0x80
   SBBO r13,r12,0x90,4   //Clear GPIO0_7 again.