Download TWR-K53N512 Quick Start Demo Lab Guide
Transcript
The Init_Task is the only task with the MQX_AUTO_START_TASK attribute set, so it is the only task that will be running at bootup. This code for this task is in Init_Task.c. This task will start all the other tasks for the demo. Inside the initialization task, global variables are initialized and then the GPIO driver is initialized. Then the Segment LCD task is started, which initializes the TWRPI-SLCD and determines what to display on the SLCD depending on which mode it is currently in. Then the ADC_Task is started, which polls the ADC channel connected to the potentiometer, and the ADC temperature sensor. The values for these readings are stored in a global SENSOR_DATA structure, so that their information can be easily re-used by other tasks. Next the Accel_Task is started, which polls the MMA7660 sensor on the TWR-K53N512 over I2C. Next the Demo_Task is started. This determines, based on the accelerometer readings and button presses, which mode the demo is in and how the LED’s should be controlled. This is the main task for the Quick Start Demo. The SLCD_Task and Shell_Task are started after that. Then lastly, the USB_TASK is started which starts the USB stack and waits for a USB connection to enumerate as a HID class mouse. The web server is then initialized, which creates two tasks for the RTCS stack and the http server. The web pages are stored in the \web\web_pages folder. The mktfs.exe executable converts them into ASCII arrays stored in the tfs_data.c file, which is what is programmed into flash. The cgi_index.c file contains the CGI functions for getting data to and from the web server. Finally, the TSI module is initialized and started. It performs some calibration and then uses the TSI ISR to detect touches. Depending on the demo mode, it will set different variables upon detecting a touch. The initialization task then calls _task_block() to be permanently blocked, and the demo is now up and ready. See the comments in the source code for more information on how the demo works. Also explore the documentation, app notes, and examples in the <mqx_dir>\doc folder and explore online at http://freescale.com/mqx for more information on using MQX. TWR-K53N512 Quick Start Demo Lab Guide Page 16 of 22