Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
FreeRTOS Web/DSP Demo

Purpose

This demo demonstrates how to use the DACC, TC, GMAC, SPI, SMC in a real-time context, using the FreeRTOS kernel. The demo also features the LwIP stack on top of the GMAC driver.

Requirements

This example can be used on the following boards:

  • SAM4E-EK

Description

The demo relies on several FreeRTOS task to work:

  • DSP task : based on the selected source mode, the DSP task will process data from a wave file (loopback mode) or from a generated sinus wave (its frequency can be changed using the potentiometer). The input signal is then modulated based on the QTouch slider last known position. The DSP task then performs a Fast Fourrier Transform to compute the magnitude of the signal.
  • GFX task : draws the IP configuration menu, then the input signal source and magnitude on screen.
  • Webserver task : handles the LwIP stack and HTTPD callbacks to answer remote client request. The device IP can either be configured statically (192.168.0.100) or dynamically using DHCP.
  • QTouch task : used to compute the slider's position.

Once the IP address is configured from the touch screen interface, the board ressources can be accessed from any web browser providing the IP address. For instance, when the IP address is configured statically : http://192.168.0.100/

The web page gives the following information about the board status:

  • CPU core type.
  • Chip name.
  • SRAM size.
  • Flash size.
  • Audio out connector.
  • Boot from memory.
  • Board IP.
  • Your IP.
  • Total number of HTTP status requests.
  • FreeRTOS uptime.
  • Temperature sensor value.
  • Led status.
  • Potentiometer value.
  • Graph of the FFT input signal magnitude (range from 0 to 10 khz).

The web page is periodically refreshed to keep the board status up-to-date. With Chrome browser (V25), sometimes two http webpage requests are needed to get correct status periodical update on browser. This is a known issue. And please refer to the datasheet for the temperature sensor accuracy.

For IAR Embedded Workbench IDE project, the source supports both FPU on and FPU off cases. FPU on or FPU off can be configured in IAR project "General Options" by selecting "VFPv4" or "None" respectively. With FPU on, hardware floating-point instruction is used, which can improve the performance of floating-point arithmetic in the DSP task.