Hi, I need your help, I need to read data of an SPI Master device on the BeagleBone. Since the SPI kernel driver doesn't support an SPI slave mode I have to implement it in the PRU (Because the maximum frequency one BeagleBone's GPIO can be toggle is only 15 KHz). >From what I have read, the PRU cycle time is 200 MHz, even so, I can't read data up to 10 MHz. I am doing the following:
k=0; shift = 0; while((__R31&cs) != cs){ // CS = 0 while((__R31&sclk) == sclk); while((__R31&sclk) == sclk){ //sclk = 1 if((__R31&cs) == cs) goto END; } while((__R31&sclk) != sclk); //SCLK = 0 buffer[cnt] = ((__R31&miso) == miso)? buffer[cnt] | 0x01 << shift: buffer[cnt]; // Here is where my cycle is being stranded!!! k++; shift = (shift==32)? 0 : shift + 1; cnt = ((k%32)==0)? cnt+1 : cnt; If I comment on the reading line, I can't catch clocks at 20 MHz. However, if a uncomment it I only can get all of them at 9 MHz (I need 10 MHz). My question is if it is possible to get it a bit faster. I can't understand why it is so slow (given that the PRU is a real-time processor and has a high speed between instructions). Regards, -- Fred Gomes -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/d8ea84f9-cb22-47bd-89ac-328214ded03e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.