150 likes | 329 Views
Western Washington university. Yared Woldekiros. Web Enable Home Automation. WEHA. System Overview. MCU: MCF52259 ColdFire V2 Microcontroller Bus Frequency: 48 MHz Internal Bus Memory Requirements: (Maximums) ROM: ~311k Flash RAM: ~440byts SRAM Available Memory:
E N D
Western Washington university YaredWoldekiros Web Enable Home Automation WEHA
System Overview MCU: MCF52259 ColdFire V2 Microcontroller Bus Frequency: 48 MHz Internal Bus Memory Requirements: (Maximums) • ROM: ~311k Flash • RAM: ~440byts SRAM Available Memory: • ROM: 512k Flash • RAM: 64k SRAM
Kernel Selection MQX RTOS • Created for the ColdFire MCU. • The Real-Time multitasking. • RTCS (The Real-Time TCP/IP Communication Suite) • TCP/IP Stack for Web Communication • Ethernet driver
Task Set-up Priority 9 10 11 12 Tasks Startup Task TCPIP Task HTTP Task IO Task
Startup Task • Initializes the System for Operation. • Initialize on chip resources. • Initialize network driver.
TCPIP Task • Communicate with the HTTP server. • Initialize IP address. • Initialize DHCP (depend on IP status)
HTTP Task • Process HTTP with HTTP protocol. • Communicate with Html files. • Handel request-response standard clint-server communications.
IO Task • Read and write to IO ports
WEHA Module • Initialize tasks.
HTML Module • It will have have HTML data file • Hex or Binary • Example: WEHA.html • static const char WEHA_html[] = { • 0x48, 0x54, 0x4d, 0x4c, 0x20, 0x53, 0x59, 0x53, 0x54, 0x45, • 0x4d, 0x3e, 0x0d, 0x0a, 0x0d, 0x0a, 0x3c, 0x68, 0x74, 0x6d, • 0x6c, 0x3e, 0x0d, 0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, • 0x0d, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x3e, 0x46, • 0x72, 0x65, 0x65, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x20, 0x4d, • 0x51, 0x58, 0x20, 0x57, 0x65, 0x62, 0x73, 0x65, 0x72, 0x76, • 0x65, 0x72, 0x3c, 0x2f, 0x74, 0x69, 0x74, 0x6c, ………...}
HTML Module continued… • HTML code will includes forms and java script. • Html Form: for user input (button, check box) with post action. Example: • <form name=“WEHA" action="http:WEHAoutput.cgi" method="POST"> • <<input type="radio" name=“Light" value="auto" checked>Auto<BR> • <input type="radio" name="fan" value="off">On<BR> • ………… • <INPUT type="submit" value="Set"> • </form>
HTML Module continued… • java script to set the value of input and to keep update the current state Example: • --------------------------------------------------------------------------------------------------------------------------- • <script type="text/javascript"> • function loop() { • if (!data_received) • makeRequest(“WEHAdata.cgi"); • setTimeout("loop()", 1000); • } • ……….. • </script> • -----------------------------------------------------------------------------------------------------------------------------------------------------------------------