The goal of this project is to program a persistence of vision display. A 16 leds strip is assembled on a board itself assembled on a rotating motor. By changing the leds configuration while it's moving, it is then possible to display things:
Here are provided components:
The board is assembled with a brand new microcontroller, there is no bootloader on it. You have to program it using your USBASP programming module (which is a low-cost version of ISP).
In avrdude
, use: -c usbasp
The USBASP comes with an adapter to connect it to 6 pins ISP. This one is not equiped with a keyed connector, that is why it is marked with a white dash. If any doubt about the orientation of the connector please ask your teacher.
First, adapt your Makefile
to be able to program this board. You can first try getting the
PD6
blue led blinking.
CPU's frequency is 13Mhz (13000000
), and the microcontroller's fuses are already setup to use
an external clock.
If you use Windows, it possible that the programming module is not detected. You can use Zadig software to install drivers, with the following settings:
POV's batteries are automatically charging when you plug it to the computer (using the USB 5V), even if the POV's switch is off. The red LED "charge" is kept on until the charge is over.
Please check that your POV is turned off when you are stopping working, you can check it by watching if green power LED is off.
The board features a bluetooth HC-05 chip. To communicate with it, you will need to get the UART bus working, and to configure it the proper way.
Setting up the communication with the board is essential to be able to debug or control it (like setting the time of the clock).
A number is labeled on your PCB (for example POV 34
). The Bluetooth chip is already
configured with following parameters:
Name: POVN
Pin: 00N
Baud rate: 38400
Where N
is your group number (for example POV 34
will have 0034
for PIN).
To communicate with the Bluetooth board, you can use your PC, but also your mobile phone.
At some point you will have to draw some messages on the POV. For this, we recommend you write some code to generate some C code to embed the characters images in the board memory.
An example is using Python and OpenCV to open PNG files and access them at pixel level to generate C code.
As you can notice on schematics, the board features 16 LEDs and a driver allowing to control their current.
You have to implement code to turn them on and off.
The hall effect magnetic sensor allows to detect magnet presence. You can test it by simply turning a LED on or off when a magnet is detected.
You can then setup an external interrupt that will be automatically triggered when the magnet is present.
With the help of timers, you should be available to compute current time.
Write some code to setup the initial time through Bluetooth communication from your computer or your phone.
Note: keep an easy way to do a demo of all the asked modes during the project's defense
You now can assemble all those elements to program your clock. The first goal will be to display time using LEDs "needles".
The next goal is to show the current time using digits, without compensating rotation's distortion, like this:
If any doubt about your board, you can flash the following test firmware:
With this firmware:
PD6
) LED blinks at startup