nobody wrote on Wednesday, July 19, 2006:
Hi,
I’m new to FreeRTOS, I got up and running earlier today. I’ve just looked at the schematic for our board and realise that the 2 main peripherals on our system are on the same spi bus.
We’re using the SAM7S series.
Bearing in mind that I will have different tasks handling both peripherals, what’s the best way to attack this?
The way I see it is that I create a transmission queue, and when something wants to transmit on spi it adds the message to the queue. A task then takes the message from the queue (providing it’s not currently transmitting) and transmits it. Reads from the bus are obviously done in a similar manner as they’re dummy writes.
Once the message is fully read, it’s place into the correct read queue for the peripheral and the task that deals with that peripheral awakes and processes the data.
Both peripherals can also cause interrupts, so when the interrupt occurs I have to set up the system to do a read.
Being new to using FreeRTOS (or any off the shelf RTOS) I’m wondering if I’m thinking in the right way or have I totally got it wrong! Any ideas or information on how other people have done this would be gratefully accepted.
Thanks.
Adrian