This repository contains the firmware source for JPEG AVI playback (and serial JPEG streaming for TinyTV 2 and Mini) on the following TinyCircuits platforms:
- TinyTV 2
- TinyTV Mini
- TinyTV DIY
See the TinyTV-Site repo for even more information and utility pages for streaming, updating, and changing settings: https://github.com/TinyCircuits/TinyTV-site
Although we greatly appreciate feedback and contributions to our product's code, as a business it takes time to integrate, test, and deploy new versions of firmware. As is typical with software, there is an inherent risk of additional bugs and breakages upon release of new firmware, therefore, only contributions to this codebase that greatly improve the product and its functionally can be considered.
This code repository reflects current development of the TinyTV Firmware. Occasionally TinyCircuits will create release binaries and change the source/binary version number according to the versions.h file. Pull requests should not have changes to the binaries or version number changes- we'll do our best here to manage version number changes and compiling/testing binaries, since the firmware goes directly on our hardware product.
Follow the below steps to build a firmware image using the Arduino IDE.
Unzip and move each of the folders in src
(called that instead of 'lib' because of Arduino nomenclature) to your Documents/Arduino/libraries
folder
JPEGDEC
: library for decoding JPEG frames for serial streaming and JPEG AVI video playbackSdFat
: library for interacting with SD cards- Uncomment definition in SdFat/src/SdFatCongfig.h:
#define USE_UTF8_LONG_NAMES 1
- Uncomment definition in SdFat/src/SdFatCongfig.h:
IRremote
: for handling the remote IR receiver and IR codes
Leave these custom libraries in the src
folder
TinyScreen
: modified TinyScreen+ library to include support for TFT displaysGraphicsBuffer2
: modified TinyScreen+ library for text rendering in an arbitrary buffer location
Follow the steps listed here: https://github.com/earlephilhower/arduino-pico#installing-via-arduino-boards-manager. Install version 2.6.0.
Follow the steps here https://learn.tinycircuits.com/Processors/TinyScreen%2B_Setup_Tutorial/ under "Step 1: Configure Arduino Software IDE"
TinyTV 2 and Mini
-
In the Arduino IDE under
Tools
, make sure to set each of the following:- Board: Raspberry Pi Pico
- CPU Speed: 200MHz for TinyTV 2 and 50MHz for TinyTV Mini
- Optimization: -Os
- USB Stack: Adafruit TinyUSB
-
Change the following in the RP2040 board package
- In the Windows taskbar search
run
, execute to bring window up - Type
%APPDATA%
and press enter - Go up a directory to
Local
- Navigate to
Arduino15\packages\rp2040\hardware\rp2040\2.6.0\variants\rpipico\pins_arduino.h
- Change
#define PIN_LED (25u)
->#define PIN_LED (12u)
- Navigate to
- Go back to
Local
- Navigate to
Arduino15/packages/rp2040/hardware/rp2040/2.6.0/libraries/Adafruit_TinyUSB_Arduino/src/arduino/ports/rp2040/tusb_config_rp2040.h
- Change
#define CFG_TUD_CDC 1
->#define CFG_TUD_CDC 2
(reason: to use Adafruit's CDC instead of Arduino Serial) - Change
#define CFG_TUD_CDC_RX_BUFSIZE 256
->#define CFG_TUD_CDC_RX_BUFSIZE 2048
(reason: faster serial, hand tweaked to a fast working value) - Change
#define CFG_TUD_CDC_TX_BUFSIZE 256
->#define CFG_TUD_CDC_TX_BUFSIZE 2048
(reason: faster serial, hand tweaked to a fast working value) - Make sure to set
#define CFG_TUD_MSC_EP_BUFSIZE 512*8
(reason: faster USB Mass Storage transfer rates)
- Navigate to
- In the Windows taskbar search
TinyTV DIY Kit
- In the Arduino IDE under
Tools
, make sure to set the following:- Board: TinyScreen+
TinyTV 2, TinyTV Mini, or TinyTV DIY Kit
Uncomment one of these lines in the main .ino file to select the hardware target: //#include "TinyTV2.h" //#include "TinyTVMini.h" //#include "TinyTVKit.h"
Now you can press the upload button (after choosing a port and/or putting the device into bootloader mode) or use Sketch -> Export compiled Binary
.