FSM-55: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
== | == Intro == | ||
Having fun with LED matrices! | Having fun with LED matrices! | ||
== | == Connecting your board == | ||
To program the board, we need to use a programmer with support to the SWD protocol. The most common tool is the proprietary device from ST-Electronics, ST-Link v.2. We are not very happy with it, since it has a proprietary firmware. Tentatively, you could try to use a Bus Pirate, which is supposed to support SWD. | To program the board, we need to use a programmer with support to the SWD protocol. The most common tool is the proprietary device from ST-Electronics, ST-Link v.2. We are not very happy with it, since it has a proprietary firmware. Tentatively, you could try to use a Bus Pirate, which is supposed to support SWD. | ||
| Line 12: | Line 12: | ||
So, here is the pinout: | So, here is the pinout: | ||
== | |||
== Creating your message == | |||
The fun of this exercise is to create your own message and convert it to a C program. | The fun of this exercise is to create your own message and convert it to a C program. | ||
| Line 65: | Line 66: | ||
}; | }; | ||
== | == Uploading your code == | ||
== | == Authors == | ||
Gniibe is the author of the FSM-55. | Gniibe is the author of the FSM-55. Unixjazz and Gniibe are the authors of this tutorial. | ||
Unixjazz and Gniibe are the authors of this tutorial. | It is released under [https://creativecommons.org/licenses/by-sa/2.1/jp/deed.en_US CC-BY-SA-2.1 JP]. Feel free to redistribute it and modify it for your needs. | ||
It is released under CC-BY-SA- | |||
== | == References == | ||
Revision as of 13:49, 22 March 2015
Intro
Having fun with LED matrices!
Connecting your board
To program the board, we need to use a programmer with support to the SWD protocol. The most common tool is the proprietary device from ST-Electronics, ST-Link v.2. We are not very happy with it, since it has a proprietary firmware. Tentatively, you could try to use a Bus Pirate, which is supposed to support SWD.
Usually, you just need two wires to connect your STM32: clock and data lines, but, for the FSM-55 we need the 'reset' line as well. So, here is the pinout:
Creating your message
The fun of this exercise is to create your own message and convert it to a C program.
The program is organized in three threads:
- LED thread (dynamic LED control)
- Button thread (watchdog)
- Application thread (text screen control)
The user does not need to change the low-level threads (LED and Button), only the Application thread. The data flows from Application -> (some sort of) Video RAM -> LED control
Messages are encoded in a 5 x 5 grid of LEDs. The 'led' thread loops through each column of 5x5 grid.
-----
-----
-----
-----
-----
Each LED is addressed as such:
- 0x00 * 0x00 * 0x00 * 0x00 * 0x00 * 0x00
- - * * * *
- - - * * *
- - - - * *
- - - - - *
In other to present the message "Happy Hacking!" only the characters we use (including exclamation point and space) are described:
{ 3, 0 }, /* SPACE */
{ 4, DATA55V (0x1f, 0x04, 0x04, 0x1f, 0x00) }, /* H */
{ 3, DATA55V (0x17, 0x15, 0x0f, 0x00, 0x00) }, /* A */
{ 4, DATA55V (0x1f, 0x14, 0x14, 0x08, 0x00) }, /* P */
{ 4, DATA55V (0x19, 0x05, 0x05, 0x1e, 0x00) }, /* Y */
{ 4, DATA55V (0x0e, 0x11, 0x11, 0x0a, 0x00) }, /* C */
{ 4, DATA55V (0x1f, 0x04, 0x0c, 0x13, 0x00) }, /* K */
{ 3, DATA55V (0x11, 0x1f, 0x11, 0x00, 0x00) }, /* I */
{ 4, DATA55V (0x1f, 0x08, 0x06, 0x1f, 0x00) }, /* N */
{ 4, DATA55V (0x0e, 0x11, 0x15, 0x07, 0x00) }, /* G */
{ 2, DATA55V (0x1d, 0x1c, 0x00, 0x00, 0x00) }, /* ! */
The message is represented as a string:
static uint8_t hh[] = {
CHAR_H, CHAR_A, CHAR_P, CHAR_P, CHAR_Y,
CHAR_SPC,
CHAR_H, CHAR_A, CHAR_C, CHAR_K, CHAR_I, CHAR_N, CHAR_G,
CHAR_EXC,
CHAR_SPC, CHAR_SPC, CHAR_SPC,
};
Uploading your code
Authors
Gniibe is the author of the FSM-55. Unixjazz and Gniibe are the authors of this tutorial. It is released under CC-BY-SA-2.1 JP. Feel free to redistribute it and modify it for your needs.