Hardware usage how is it possible?

nobody wrote on Wednesday, January 10, 2007:


I have been reading the site and RTOS core.
Untill now i wasn´t able to find (for the PICs) any tip or comment on how to use the pheripherals like SPI, UART, PORTS, PP, ADCs.

How is it possible to interact with the peripherals when using FreeRTOS??

Thank you for the help

nobody wrote on Wednesday, January 10, 2007:

Does the PIC port not have a uart driver as an example?  I think they all do.

Look in the source code in the demo/[port]/serial directory (where [port] is the port you are interested in).

westmorelandeng wrote on Wednesday, January 10, 2007:


FreeRTOS is a kernel - peripheral drivers are part of the ports (example code).  Some of the example code is very simple - but it’s meant to demonstrate the features of FreeRTOS.  You can find UART drivers as mentioned above - but it’s unlikely you’ll find, for instance, a fully-functional full-duplex DMA driven UART for every port - that’s up to you to develop or perhaps find the source code for that someplace else and adapt it for FreeRTOS.  Most ports have a simple interrupt driven example for UART’s - but it’ll take some work if you want to use those in the real world - some ports are better than others as well.

John W.


rtel wrote on Wednesday, January 10, 2007:

Just to go a little further to what John has already stated.

[As I think I state in numerous places on the WEB site and in the code)  The sample UART drivers provide an example of interaction between the kernel and an interrupt which is useful for users to copy.  However the actual implementation of the driver is often deliberately inefficient, for example it might not use the DMA or even the buffers on the peripheral.  This is because the provision of the driver is also for the purpose of testing the port.  The more interrupts the peripheral can generate the higher the loading and statistical change of finding an error.  If you have a 16 byte buffer and generate an interrupt every 16 characters then you are generating 16 times less interrupts than if you turn the buffering off.