Download presentation
Presentation is loading. Please wait.
1
Wireless Networks Lab – UART 2007/10/24
2
yctseng: 2 Environment BoardAPI vLedControl(0, true); HardwareAPI vAHI_xxx( ); FontalBSP FontalButton -- btn_init(); FontalLED -- led_init(); Stack – 802.15.4 MAC Application Queue API Service Access Point – AppApi.h Access functions and structures used by the application to interact with the Jennic 802.15.4 stack u32AppApiInit (); E_AHI_DEVICE_SYSCTRL, E_AHI_DEVICE_UART0, …, and etc.
3
yctseng: 3 Sample The PC’s UART connects to the on-chip UART of the FT6250 Kit. This sample code can let us figure out how to communicate between them with UART. HardwareAPI u8UartPort: E_AHI_UART_0 or E_AHI_UART_1 u8BaudRate: 38400 vAHI_UartEnable(E_AHI_UART_0); vAHI_UartReset(E_AHI_UART_0, TRUE, TRUE); vAHI_UartReset(E_AHI_UART_0, FALSE, FALSE); vAHI_UartSetClockDivisor(E_AHI_UART_0, u8BaudRate); vAHI_UartSetControl(E_AHI_UART_0, FALSE, FALSE, E_AHI_UART_WORD_LEN_8, TRUE, FALSE);
4
yctseng: 4 Overview Connecting the sensor board to a PC using the programming cable. UART settings are in Appendix. Terminal Serial Port FT 6250 UART Typing in HyperTerminal: ex: aaaaabbbcc which UARTASCII code
5
yctseng: 5 Flowchart
6
yctseng: 6 Pseudo code 1. u32AHI_Init(); 2. u32AppApiInit(NULL, NULL, NULL, NULL, NULL, NULL); 3. Set up UART; 4. Init LED; 5. Register UART Callback; 6. Utility function: vUartPrint(); vByteToString();
7
yctseng: 7 Requirement Review After comprehending the usage of UART, you are asked to When typing in the terminal, you should control each of the LEDs on/off through UART. When pressing each button of FT device, you should get different feedback in your terminal through UART.
8
yctseng: 8 Bonus Implement a small game. UART_1 FT 6251 UART_1 Terminal Serial Port UART_0 FT6250
9
yctseng: 9 Appendix When using HyperTerminal, you should choose the serial port you used and configure the serial connection as follows: 38400 bps, 8 data bits, no parity, 1 stop bit, and no handshaking. Ensure that your HyperTerminal is started after powering up the FT device.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.