************* Introduction **************************************************
The examples defined in this project demonstrate:
A FreeRTOS software timer is used to give visual feedback of the system status. The software timer toggles LED mainSOFTWARE_TIMER_LED every 200ms to show the system is running, and turns LED mainERROR_LED on if any errors have been latched.
This file also provides default implementations of the FreeRTOS idle, tick malloc failed, and stack overflow hook functions. See http://www.freertos.org/a00016.html.
Readers are recommended to also read the application note that accompanies the FreeRTOS ASF API.
************* USART Echo/Loopback Example ***********************************
Two tasks are created; A transmit (or Tx) task, and a receive (or Rx) task. The transmit task periodically sends one of a set of strings to the USART peripheral. The receive task expects to receive each transmitted string. The receive task latches an error is the characters it receives do not exactly match the characters it expects to receive.
The USART loopback example is created if the confINCLUDE_USART_ECHO_TASKS constant is defined. confINCLUDE_USART_ECHO_TASKS can be defined in conf_example.h.
The USART loopback example and the USART CLI example cannot be used at the same time as both examples access the same USART port.
The example needs every character that is transmitted on the USART port to be received on the same USART port. This can be achieved using an RS232 echo server (see http://www.serialporttool.com/CommEcho.htm for an example), or by simply linking pin 2 on the RS232 port to pin 3 on the same RS232 port.
By default, the RS232 communication is configured to use 115200 baud, 8 data bits, no parity, one stop bit, and no flow control.
************* USART Command Console using FreeRTOS+CLI **********************
A task is created that receives command line input on a USART, then sends the results of executing the command to the same USART peripheral.
A number of example command implementations are provided. These include:
Software Configuration -
The USART command console example is created if the confINCLUDE_USART_CLI constant is define. confINCLUDE_USART_CLI can be defined in conf_example.h.
The USART loopback example and the USART CLI example cannot be used at the same time as both examples access the same USART port.
The RS232 USART port needs to be connected to a dumb terminal, such as TeraTerm. For the cleanest output, the terminal should be set not to echo characters, transmit line feeds (LF), and receive carriage returns (CR).
By default, the RS232 communication is configured to use 115200 baud, 8 data bits, no parity, one stop bit, and no flow control.
************* UART Command Console using FreeRTOS+CLI **********************
The functionality is exactly as that described for the USART command console above. Only the communication interface is different. The UART peripheral is used as a com port.
The UART command console example is created if the confINCLUDE_UART_CLI constant is define. confINCLUDE_UART_CLI can be defined in conf_example.h.
The RS232 UART port needs to be connected to a dumb terminal, such as TeraTerm. For the cleanest output, the terminal should be set not to echo characters, transmit line feeds (LF), and receive carriage returns (CR).
By default, the RS232 communication is configured to use 115200 baud, 8 data bits, no parity, one stop bit, and no flow control.
************* USB/CDC Command Console using FreeRTOS+CLI ********************
The functionality is exactly as that described for the USART command console above. Only the communication interface is different. The standard ASF USB CDC driver is used as a virtual com port.
The USB/CDC command console example is created if the confINCLUDE_CDC_CLI constant is defined. confINCLUDE_CDC_CLI can be defined in conf_example.h.
You may be asked to install a USB driver the first time the host computer is plugged into the target. The file atmel_devices_cdc.inf is provided with this demo for this purpose. Select the provided atmel_devices_cdc.inf file if the install new hardware wizard executes on the host computer when the USB cable is inserted.
The virtual com port was tested with the following settings: 115200 baud, 8 data bits, no parity, one stop bit, and no flow control. The settings might not be critical.
************* TWI EEPROM Read and Write ***********************************
A task is created that writes a bit pattern to an I2C EEPROM, then reads back from the EEPROM to ensure the data read back matches the data previously written. An error is latched if the data read back does not match the data that was written.
The example can be configured to use either the blocking or the fully asynchronous FreeRTOS functions.
The TWI EEPROM example is created if the confINCLUDE_TWI_EEPROM_TASK constant is define. confINCLUDE_TWI_EEPROM_TASK can be defined in conf_example.h.
Set mainDEMONSTRATE_ASYNCHRONOUS_API to 1 to use the fully asynchronous FreeRTOS API, or 0 to use the blocking FreeRTOS API. Other tasks will execute while the task is blocked. mainDEMONSTRATE_ASYNCHRONOUS_API is defined in this file.
The example requires that a TWI/I2C EEPROM be present on the evaluation kit. As the example uses the EEPROM built onto the evaluation kit, no hardware configuration is required.
************* SPI flash Read and Write ***********************************
A task is created that writes a bit pattern to an SPI flash, then reads back from the flash to ensure the data read back matches the data previously written. An error is latched if the data read back does not match the data that was written.
The example can be configured to use either the blocking or the fully asynchronous FreeRTOS functions.
The SPI flash example is created if the confINCLUDE_SPI_FLASH_TASK constant is define. confINCLUDE_SPI_FLASH_TASK can be defined in conf_example.h.
Set mainDEMONSTRATE_ASYNCHRONOUS_API to 1 to use the fully asynchronous FreeRTOS API, or 0 to use the blocking FreeRTOS API. Other tasks will execute while the task is blocked. mainDEMONSTRATE_ASYNCHRONOUS_API is defined in this file.
The example requires that an SPI flash be present on the evaluation kit. As the example uses the flash built onto the evaluation kit (SAM3N-EK only), no hardware configuration is required.