© ArduTV 2025
Here you can find instruction to work with ArduTV board using STM Nucleo boards.
First at all you need to add the ArduTV STM library in the Arduino IDE (same process of any other library, you can simply add the files at the project).
You can download the library here: /downloads/library
Please have a look to the example projects in the "Project Examples", too.
NOTE: It is described only the simplest way to use the ArduTV SW here (using GUI of STM32CubeIDE); if you are expert, you could manage to use it in more advanced way.
NOTE2: The board used as reference is the Nucleo STM32F401RE (MB1136-F401RE); if you are using a different board please double check the interfaces (arduino shield interface pins).
ArduTV needs three steps in the code to be used:
1) Using the Device Configuration Tool setup the SPI1 as following:
MODE: Full Duplex Master
Hardware NSS Signal: Disable
SPI1_SCK: PA5 (SCK/D13 on Arduino connector)
SPI1_MISO: PA6 (MISO/D12 on Arduino Connector)
SPI1_MOSI: PA7(MOSI/D11 on Arduino Connector)
Frame Format: Motorola
Data Size: 16 Bits
First Bit: MSB First
Prescaler: 128 (or not to be faster than 1 MHz)
Clock Polarity: Low
Clock Phase: 1 Edge
CRC Calculation: Disabled
NSS Signal Type: Software
and in the GPIO Section set PB6 (CS/D10 on Arduino Connector) as Output with Maximum output speed set "HIGH".
2) Include on your code the library reference with the following:
#include "Ardutv.h"
3) Use the following commands to create your projects:
ATV_PenColor(u8 red,u8 green,u8 blu);
ATV_ PenColorDir(u16 color);
ATV_ Clear(void);
ATV_ Point(u16 CoordinateX,u16 CoordinateY);
ATV_ PointDir(u16 CoordinateX,u16 CoordinateY,u16 Color);
ATV_ Rect(u16 CoordinateX,u16 CoordinateY,u16 Larghezza,u16 Altezza,u16 fill);
ATV_ Circle(u16 CoordinateX,u16 CoordinateY,u16 Raggio);
ATV_ printchar(const char str, int x, int y,u8 scale);
ATV_ BGColor(u8 red,u8 green,u8 blu);
ATV_ printString(const char* str, int x, int y,u8 scale); ATV_changeFont(u8 ind, u8 font[8]);
ATV_ PenColor (u8 red,u8 green,u8 blu);
The function is used to set the color of the track used in all the commands except for PointDir. The color is defined by mixing RED, GREEN and BLU channel with an intensity between 0 to 31. The Black color is defined by (0,0,0) and the white color by (31,31,31).
ATV_ PenColorDir(u16 color);
The function (alternative to PenColor command) is used to set the color of the track used in all the commands except for PointDir. The color is defined by a single 16 bit unsigned number representing the color in bits with the following meaning:
Bit 15--> don't care, Bit 14-10--> RED, Bit 9-5-->GREEN, Bit 4-0-->BLU
ATV_ Clear(void);
The function clear the screen using the color defined by ATV_BGColor command.
ATV_ Point(u16 CoordinateX,u16 CoordinateY);
The function draws a single pixel dot in the coordinate X and Y of the screen using the color defined by ATV_PenColor or ATV_PenColorDir.
ATV_ PointDir(u16 CoordinateX,u16 CoordinateY,u16 Color);
The function draws a single pixel dot in the coordinate X and Y of the screen using the color defined by the parameter Color of the function based on a single 16 bit unsigned number with the following meaning: Bit 15--> don't care, Bit 14-10--> RED, Bit 9-5-->GREEN, Bit 4-0-->BLU
ATV_ Rect(u16 CoordinateX,u16 CoordinateY,u16 Larghezza,u16 Altezza,u16 fill);
The function draws a rectangle starting at the coordinate X and Y of the screen of length defined by Larghezza and width defined by Altezza using the color defined by PenColor or PenColorDir. The parameter fill defines if the rectangle is filled by color (using "1") or not (using "0")
ATV_ Circle(u16 CoordinateX,u16 CoordinateY,u16 Raggio);
The function draws a circle with the center at the coordinate X and Y of the screen and ray defined by Raggio parameter using the color defined by ATV_PenColor or ATV_PenColorDir.
ATV_ printchar(const char str, int x, int y,u8 scale);
The function prints a single character defined by str at the coordinate X and Y using the color defined by PenColor or PenColorDir. The parameter scale defines the scale of the character (i.e. 1 is 8x8 bit character, 2 is 16x16 3 is 32x32 and so on...).
Note: The color settled by ATV_BGColor command defines the background of the character.
ATV_ BGColor(u8 red,u8 green,u8 blu);
The function is used to define the background color of the screen (and of the background of characters). The color is defined by mixing RED, GREEN and BLU channel with an intensity between 0 to 31. The Black color is defined by (0,0,0) and the white color by (31,31,31).
ATV_ printString(const char* str, int x, int y,u8 scale);
The function prints a string of characters defined by str at the coordinate X and Y using the color defined by PenColor or PenColorDir. The parameter scale defines the scale of the character (i.e. 1 is 8x8 bit character, 2 is 16x16, 3 is 32x32 and so ...).
Note: The color settled by ATV_BGColor command defines the background of the character.
ATV_changeFont(u8 ind, u8 font[8]);
This function is used to insert a different font inside the memory of ArduTV. The command change one character at the time. It is not mandatory to change all the character set, you could decide just to change 1 or few characters.
The used font by ArduTV is 8 lines of 8 bits (8x8 character).
The "ind" parameter indicates the ASCII code of the character to be modified.
The font[8] is an array of 8 unsigned byte containing the 8 lines of the new character. Once the new character is inserted in the memory the old character is overwritten and any string used after this replacement will use the new character.
To restore the old character set just power off the board and then power up it again. Please visit the example projects to know more.
NOTE: The font set is stored inside ArduTV internal memory (no memory consumption on Arduino board). The font change is possible only during runtime, it is not possible to change the start-up default font set.
© ArduTV 2025