Академический Документы
Профессиональный Документы
Культура Документы
Release 1
1 Information on Hardware-Parts 3
1.1 Bill of Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Details from Datasheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 About Speed 7
2.1 Loading Data into LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4 User Interface 13
4.1 Processing Sketch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5 Prototypes 15
5.1 Version 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.2 Version 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.3 Version 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
6 Energy/Power Considerations 17
6.1 Batteries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
8 TODO 21
i
ii
Bike From Hell Documentation, Release 1
This document describes various aspects of the project, such as information on required hardware, implementation
details, design guidelines etc...
Contents 1
Bike From Hell Documentation, Release 1
2 Contents
CHAPTER 1
Information on Hardware-Parts
1.1.1 Prototype v1
1.1.2 Prototype v2
3
Bike From Hell Documentation, Release 1
1.1.3 Costs
1.2.1 TLC5940
download datasheet
TCL5940 at farnell
16 channels
12 bit PWM control
serial data interface (30 MHz data transfer rate)
drives up to 60 mA (with VCC<3.5 V) up to 120 mA (3.5<VCC<5 V)
error detection : open LED, thermal
reference current : IREF fixed to 1.24 V; multiplied with 31.5
voltage drop 0.5 V for 40 mA output current
linear dot correction (6bit for each channel)
serial interface
reads data on raising SCLK
MSB first, OUT15 first 192 bits for output registers (GS mode for grayscale)
XLAT high pulse latches data to output registers
VPRG=1 to set dot correction values (DC mode) 96 bits
after XLAT pulse, internal SR is set with status information (LOD data, TEF data, DC values) can be
read out via sout
GSCLK must be clocked externally; BLANK must be pulled high every 4096 cycles to reset internal PWM
counter else all outputs turn off
1.2.2 CAT4016
download datasheet
a 16 channel constant current LED driver. The current sunk into each of the 16 pins can be set by an external resistor.
The individual channels are then read in via a SPI compatible interface and can then be latched from the internal shift
register to the output.
some characteristics
serial interface up to 25 MHz
current 2-100 mA
AT32UC3B064
16k SRAM
10 sfr
ATXMEGA192A3U
16k SRAM
13 sfr
1.2.4 ATMEGA328P
download datasheet
you might also want to have a look at the arduino duemilanove schematics
CPU :
16Mhz (up to 20Mhz); most instructions single cycle
8bit data bus
32 general purpose working registers
accessing memory :
program memory (10k+ cycles)
boot-loader (highest addresses), application memory
32k
e.g. constants accessed via LPM instruction
data memory
2k
0000-001F : GP registers
0020-005F : i/o registers (IN, OUT instructions)
0060-00FF : extended i/o registers (ST/STS/STD, LD/LDS/LDT instructions)
0100-08FF : internal SRAM
direct addressing : entire space
indirect addressing : Y/Z-reg + 63 bytes
accessed in two cycles
EEPROM (100k+ cycles) - 1k
interrupts :
every interrupt must be enabled in status register
interrupt vector : 0000-0067 (26x 4 bytes)
the lower the addresse the higher the priority (RESET, INT0, INT1, ...)
26 vectors, each 2 words (4 bytes)
global flag cleared when interrupt executed; set on RETI
on hardware interrupt corresponding interrupt disabled
interrupts remembered (flags set) when global/specific disabled; executed upon re-enabling of interrupts (in
order of priority)
2nd type of interrupts upon condition; will not be executed if condition disappeared before flags re-enabled
always >=1 instruction between two interrupts
SR must be (re-) stored in ISR
timing : 4+3 instructions before ISR execution, 4 instructions on return
SPI
maximum speed : f_osc/4 in slave mode and f_osc/2 in master mode (when SPI2X double speed bit is
set logic one)
1.2.5 LEDs
TLE49X5 (Siemens)
with schmitt triggers
open collector output
TLE4905 switches between 0 // 10 mT
TLE4935 switches between -10 // +10 mT
About Speed
It is crucial that data is loaded into the CAT4016 shift register fast enough to realize the desired pictures. Especially, if
PWM is to work properly, the shift registers must be loaded fast enough that every pixel actually achieves the desired
PWM resolution.
The following examples were calculated by a python script
16 RGB LEDs with 4bit PWM need a shift-register update-rate of 0.78 MHz at 30km/h
2.1.1 arduino-bit-banging
bit-banging the values manually to the digital I/O port using the library function digitalWrite
for (int i=0; i<16; i++) {
digitalWrite(CLK1,LOW);
digitalWrite(CLK2,LOW);
tinynap();
// Faint LEDs
if ( reg[0][i] ) {
digitalWrite(SIN2,HIGH);
}
else {
digitalWrite(SIN2,LOW);
}
// Bright LEDs
if ( reg[1][i] ) {
digitalWrite(SIN1,HIGH);
}
else {
digitalWrite(SIN1,LOW);
}
digitalWrite(CLK1,HIGH); digitalWrite(CLK2,HIGH);
tinynap();
}
even before considering the generated assembler code, it becomes obvious pretty fast that this is not a particu-
larly efficient implementation; lets first have a look at the implementation of digitalWrite which can be found in
7
Bike From Hell Documentation, Release 1
$CORE/wiring_digital.c
void digitalWrite(uint8_t pin, uint8_t val)
{
uint8_t timer = digitalPinToTimer(pin);
uint8_t bit = digitalPinToBitMask(pin);
uint8_t port = digitalPinToPort(pin);
volatile uint8_t* out;
out = portOutputRegister(port);
if (val == LOW) {
* out &= ~bit;
} else {
* out | = bit;
}
SREG = oldSREG;
}
all these tests are obviously not necessary if you know what youre doing; the above code translates to 55 assembler
instructions that are executed every time the output pin is set/cleared...
only the implementation of the loop translates to 83 instructions; moreover, the i/3 and i%3 cannot be calculated
directly by the AVR, but are implemented by the compiler that performs a quite tedious nested algorithm each time...
9
Bike From Hell Documentation, Release 1
PIN function
1 TX
2 RX
12 3.3V
13 GND
21 GND
22 GND
24 LED
34 programming
some blogs about it
endasmedia - German - different firmwares with different AT command sets - two different hardware
versions - CSR BlueSuite on CD (with BlueFlash for new firmware)
Byrons Blog - PIN-out
PIN1 (upper left) : tx
PIN2 : rx
PIN12 : 3.3V
PIN13 : gnd
PIN24 : LED working mode indicator (flashing before pairing then continuously high)
links
Android + Processing + Bluetooth (oscar)
Amarino
BlueCove
User Interface
13
Bike From Hell Documentation, Release 1
Prototypes
5.1 Version 1
a single CAT4016
5 RGB LEDs
5.2 Version 2
5.3 Version 3
two TLC5940
10 RGB LEDs
15
Bike From Hell Documentation, Release 1
16 Chapter 5. Prototypes
CHAPTER 6
Energy/Power Considerations
6.1 Batteries
triple A batteries
up to 1200 mAh (Alkaline LR03, Lithium FR03)
relatively small discharge current
17
Bike From Hell Documentation, Release 1
(discontinued) m133s
the professional m464q system : very expensive, displays video and has wireless channel; available Mai 2012
The current for the different CAT4016 should be dimensioned in a way that guarantees that every chip sinks a current
that is significantly bigger than the current sunk by the next smaller chip. Unfortunately it does not make sense to
add the individual currents because our eye perceives luminosity logarithmically (and the intensity is linearly depend
on the current).
The following plot shows some possible values where each CAT4016 can be fine-tuned with a potentiometer to man-
ually set a precise current that fulfills the above-mentioned criteria.
19
Bike From Hell Documentation, Release 1
imagine Lilys would spell L-I-L-Y-S when the bike messenger drives through Langstrasse by night
TODO
Todo
update values/footprints for prototype v1 board
21