embedded rtos programming class project m moore september
play

Embedded RTOS Programming Class Project m-moore september 19, 2013 - PDF document

Embedded RTOS Programming Class Project m-moore september 19, 2013 Features GUI-based Monitor/Control of Toy CPU All CPU Registers Readable/Writable Main-Memory Port-Access Program Single-Step Program Lock-Step Run


  1. Embedded RTOS Programming Class Project m-moore – september 19, 2013

  2. Features ● GUI-based Monitor/Control of Toy CPU ● All CPU Registers Readable/Writable ● Main-Memory Port-Access ● Program Single-Step ● Program Lock-Step Run ● Load Main Memory From File ● Dump Main Memory To File ● Automatic Test RTOS-Related ● Four Threads of Varying Priority ● Mail-Queue Communication Between Threads ● Meta-Watchdog Thread (other threads report-in) ● Selectable error() vs mbed_reset() on error detection

  3. Meta-watchdog thread. All other threads check-in via queue. This thread is also its own watchdog. void watchdogThread(void const *args) // overall watchdog. { int dHeartbeat; // heartbeat counter. Watchdog_RTOS watchdog; // the one and only watchdog. dHeartbeat = 0; // initialize. watchdog.kick(WATCHDOG_S); // initialize watchdog. while (1) // thread loop. { // all other threads report-in. // blocking wait on all of them. queueWatchdogThread_0.get(osWaitForever); queueWatchdogThread_1.get(osWaitForever); queueWatchdogThread_2.get(osWaitForever); watchdog.kick(); // reset watchdog timer. dHeartbeat++; // thread heartbeat. if (!(dHeartbeat % HB_MODULO)) led3 = !led3; Thread::wait(THREAD_3_WAIT); // multitasking. } // thread loop. }

  4. DESIGN DIAGRAM Tk GUI Python code CPU Data CPU Host Data USBSerial SPI PySerial mmSPI USB SPI /dev/ttyACM* Pins Pins USB Host PC MBED FPGA

  5. SPI-out CPU Implementation Diagram Shadow Registers R0 R0 Accumulator 16-bits x 256 addresses MainMemory R1 MMdataL Port1RW R2 MMdataH Port1Adr R3 Port0Adr Port0R MMadr Program Counter instruction_override Instruction Instruction Control Lines Register Decoder SPI-in SPI-clk CPU-clk Instruction Word Fields [7:0] [15:13] [12:10] [9] [8] SRC DEST WE PCE Immediate

  6. Mbed Firmware Implementation Diagram Main thread SPI thread ProcessIncomingSerial ShiftReg altera SPIprocessingThread mmSPI mmSPI SPI Mail tFromHost commands vector queue SPI,CPU clocks ProcessOutgoingSerial Mail SPI bufferOut tToHost queue vector diagnosticThread watchdogThread Other Threads To LCD Report- In

  7. Testing 1. debug with LCD & signalTap 2. manual GUI exercise. 3. python speed testing – needed 40mS delay. 4. automated test using 'prog_add_list' Result – no errors detected over a 17-hour run. 419,468,950 SPI clocks. 6,057,750 CPU clocks. 17-hour 26-minute test run. 2050 iterations. no errors. ============================ Wed Sep 18 07:43:26 PDT 2013 test iteration 2049 compare dump_test.txt against dump_add_list.txt ============================ Wed Sep 18 07:43:56 PDT 2013 test iteration 2050 compare dump_test.txt against dump_add_list.txt

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend