Home News Features Examples Code FAQ License
AVR Webring
Prev Hub Join Rate Next
Unbalanced pumping of numbers through a queue.

Description

Here we show the simple use of a queue. One 12 byte queue is defined which is written to from one task, 8 bytes at a time, and is read from in an other task, 6 bytes at a time. If a task does not gets access to the queue because it is blocked, it tries for about one second (using the time-out facility on locks) and then complains for about one second by blinking a led. It subsequently tries again. Notice the dynamics of the process, which is: write - read - write - read - write - read - read and then it repeats itself. It is possible to reset (empty) the queue by pushing the button.

Hardware

ATtiny861 and STK500. The eight leds on the STK500 connected to port A. On port B pin 0 and pin 1 must be connected to a switch.

Contact: info@femtoos.org   CC-BY License: Ruud Vlaming.