Hi Kees,

 SPI management is part of a bigger project: we are working on a Machinekit 
based drilling machine, where one PRU is used for the generation of 
step/dir signals for the axes, while the other already manages (in 
real-time way, tightened to the main servo-thread @ 1 ms) an I2C bus (for 
I/O expanders, ADCs, DACs, RTC...), 2 CAN buses (for a custom board with 5 
servo brushless and future remote I/Os) and now... SPI bus (to interface 2 
additional step drivers).

We tryed at first with the linux driver (as we really don't need strict 
real-time management for that) but we had some troubles integrating it into 
the Machinekit enviroment. Speed was only one of the problems...
Anyway, now it's all into the PRU and it's working very well.

Gianfranco

On Friday, November 20, 2015 at 11:52:13 AM UTC+1, Kees k wrote:
>
> Hello Gianfranco,
>
> Happy to help you out. I think instead of using the 'force' bit, there 
> must be a better alternative, but this solution works.
> Did you start working on SPI in the PRU because the linux mcspi driver is 
> very slow?
>
> Kees
>
> On Friday, November 20, 2015 at 12:29:17 AM UTC+1, Gianfranco Rosso wrote:
>>
>> Hello Kees,
>>
>>  something is always better than... nothing ;-)
>> That's was exactly what I was looking for: a "working" driver for compare 
>> initialization sequence and register settings.
>>
>> My init was very similar... but I noticed you deal also with interrupt 
>> registers and that you used the "FORCE" option in CH0CONF.
>> This last one is the turnkey: simply adding the FORCE flag setting to my 
>> sequence, the SPI start workings properly, transmitting and receiving data 
>> as expected.
>>
>> Many thanks!
>> Gianfranco
>>
>> On Thursday, November 19, 2015 at 4:50:58 PM UTC+1, Kees k wrote:
>>>
>>> I did some work on this in January. I am not sure it worked well, at 
>>> least it did something. 
>>> The code (so far) may help: 
>>> https://github.com/kkwekkeboom/am335x_pru_package/blob/csk_spidriver2/pru_sw/example_apps/PRU_spidriver/PRU_spidriver.p
>>>
>>> On Wednesday, November 18, 2015 at 2:15:31 PM UTC+1, Gianfranco Rosso 
>>> wrote:
>>>>
>>>> Hello Jason, thanks for advices.
>>>>
>>>> I've done the first and I've found a bug: just after soft resetting the 
>>>> module I have to rewrite register MCSPI_SYSCONFIG (to 0x0308) 'cause the 
>>>> module also resets this register...
>>>> The others settings seems ok.
>>>> SPI trasmission still doesn't occours, so there must be something else.
>>>>
>>>> I'll try the other 2 suggestions.
>>>>
>>>> On Tuesday, November 17, 2015 at 7:34:53 PM UTC+1, Jason Kridner wrote:
>>>>>
>>>>> Are you reading back all the registers to make sure all your writes 
>>>>> work OK? 
>>>>>
>>>>>

-- 
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.

Reply via email to