|
FiRmware
Information about Firmware.
Description
The firmware have two main distinct tasks - making the POV and communicating with PC SoFtware, implementing the FirmwareApi. They never happen at same time. MCU stop/start running each one of this two tasks when USB cable is connected. MCU detects USB cable connection/disconnection by monitoring the +5 volts USB voltage present on cable - when USB cable is disconnected that voltage is 0 volts while connected is +5 volts. Communications with PC SoftwareWhen hardware is connected to PC by USB, a new serial port will appear on PC, because we are using Dean Camera's MyUSB library to implement a kind of "USB-RS232 Device". Inside the MCU we get the data that should be outputted to RS232 BUS, but instead of that, we use it directly. When we need to send data to PC we send it as if it did come from RS232 BUS. We used as working base the "USB-RS232 Device demo" of MyUSB library - thanks Dean!! The data received/sent from/to PC is always putted on two ring buffers called "Rx_Buffer" and "Tx_Buffer". As soon as Rx_Buffer have some data, MCU will read it and implement the FirmwareApi. Making POVMaking POV task are not yet implemented however it should be not much difficult. This task should measure the time between impulses of sensor hall effect and divide that time in 256 equal parts. On each that part time, MCU should read 64 bits from DataFlash memory and send them to LEDs drivers. Download the latest firmware versionThe latest firmware version is always available on SVN server - read here how to download it. Build the firmwareOn GNU/Linux Ubuntu
make clean make A new file with name "BicycleLEDPOV.hex" should appear on actual directory. On MS WindowsYou should install WinAVR and you may use AVRStudio. Download firmware to hardwareOn GNU/Linux UbuntuUsing dfu-programmer (recommended)The AT90USB162 MCU comes from factory with an USB bootloader which permits to download firmware to internal flash memory on MCU. To enter in the bootloader mode, there must be hold the bootloader button and then press the reset button.
sudo make usbprogram Example:
The firmware should be downloaded without errors - finally just hit reset button to leave bootloader mode and firmware will start running. Using FLIPFLIP is a GUI tool from Atmel, it needs Java Runtime Environment. On MS WindowsUsing FLIPFLIP is a GUI tool from Atmel, it needs Java Runtime Environment. |
Sign in to add a comment