Le POV V3.0
Persistence Of Vision : La Persistance rétinienne.
Il existe déjà plusieurs versions de POV, mais j'ai décidé d'en faire un nouveau projet.
- Objectif :Ce dispositif permet de tracer des mots lumineux (qui semblent s'afficher dans le vide) au moyen de quelques LEDs en rotation rapide.
- Moyen:
- Utilisation d'un processeur ATTiny85-20PU
- 74HC595 8-Bit registre à décalage DIP-16
Basse consommation énergétique, 80μA Max
- 1 US1881 : CAPTEUR EFFET Hall, 5mA
Masse: 0,11 g; Dimensions : 5 x 4.1 x 1,5 mm (L * l * h);
- 1 aimant permanent : Aimant Disque Rond Néodyme Puissant Terres Rares Ø10xØ5x3mm
- 1 Lipo 852540 3.7V 550mAh 25C
Masse: 40gr; Taille : 45x25x8mm mm
- 8 LED verte Ø3mm - 20mA
- 8 résistance 220Ω
- 1 Moteur DC 1.5-6.5V - Vitesse: 1700-7300RPM
Masse: 21g; Dimensions:Ø24x12mm Arbre Ø2x4mm
Le principe
Pour que les lettres demeurent visibles de façon stable pendant une longue période de temps, la barette de LEDs doit repasser par les mêmes positions de façon périodique afin de retracer les lettres avant qu'elles ne disparaissent...
On y arrive en plaçant les LEDs à l'extrémité d'une tige rotative: le mouvement devient périodique et le texte est réécrit à chaque tour de la tige.
Pour que l'éclairage des leds commence toujours au même moment, il est necessaire de démarrer toujours à la même position.
C'est à ce moment qu'intervient le capteur à effet hall et l'aimant
Un capteur à effet Hall permet de mesurer une variation de champ magnétique.
Le temps d'alumage d'une rangée à l'autre dépend avant tout de la vitesse de rotation.
Cette vitesse de rotation doit permettre d'afficher l'intégralité du message en 1/25ème de seconde soit 25tr/s x 60s =1500 tr/min minimum.
Il est nécessaire de faire attention à l'équilibrage de l'ensemble en rotation, la vitesse étant élevée, des vibrations pourrai survenir et détériorer le moteur.
Lors de la rotation j'ai choisi un angle entre deux rangées de 4°, ce qui représente donc 360/4=90 caractères maximum.
Ceci sera peut-être à rectifié lors des essais.
Le mécanisme
Celui-ci est en cours de conception sur solidworks et imprimante 3D.
L'éléctronique
Soit une consommation maximale totale d'environs : 100mA
Source d'énergie pour le circuit: F Power 7.4V 550mah
C'est un peut lourd, mais je vais la mettre proche du centre, pour équilibrer la masse.
Le programme (A tester également)
.CSEG
.include "includes/tn85def.inc"
#define F_CPU 16000000
#ifndef DIVISEUR
#define DIVISEUR 64
#endif
.def ANSL = R0
.def ANSH = R1
.def REML = R2
.def REMH = R3
.def ONERL = R4
.def ONERH = R5
.def A = r16
.def DATA = r20
.def count = r21
.def DCounter = r10
.def delayTimeL = r22
.def delayTimeH = r23
.def last_IN_state= r17
.def BL = R18
.def BH = R19
.def C = R24
.equ HALL =PB3
.equ SERDT =PB0
.equ SRCLK =PB2
.equ RCLK =PB1
#define DDR74HC595 DDRB
#define PORT74HC595 PORTB
.org 0000
rjmp ON_RESET
reti
rjmp Restart_Disp
reti
reti
rjmp TimerOVF
reti
reti
reti
reti
reti
reti
reti
reti
reti
ON_RESET:
ldi A, LOW(RAMEND)
out SPL, A
ldi A, HIGH(RAMEND)
out SPH, A
ldi A,0b10000000
out CLKPR,A
ldi A,0b0000000
out CLKPR,A
cbi ADCSRA, ADEN
rjmp Init_count
Write74HC595:
push A
ldi A,8
mov DCounter,A
pop A
HCSendBits:
add DATA,DATA
brcc HCSendBits0
sbi PORT74HC595,SERDT
rjmp HC595Send1
HCSendBits0:
cbi PORT74HC595,SERDT
HC595Send1:
sbi PORT74HC595,SRCLK
cbi PORT74HC595,SRCLK
dec DCounter
brne HCSendBits
sbi PORT74HC595,RCLK
cbi PORT74HC595,RCLK
rcall Wait4deg
ret
write_char_font6x8:
push ZL
push ZH
subi DATA,32
ldi ZL, LOW(POVled_font5x8<<1)
ldi ZH, HIGH(POVled_font5x8<<1)
clr A
ldi count,5
mul_5:
add ZL,DATA
adc ZH,A
dec count
brne mul_5
ldi count,5
overdata:
lpm DATA,Z+
rcall Write74HC595
dec count
brne overdata
pop ZH
pop ZL
ret
write_string:
lpm DATA, Z+
_write:
ser A
cp DATA,A
breq end_write_str
rcall write_char_font6x8
rcall Wait4deg
rjmp write_string
end_write_str:
ret
Wait4deg:
#if (DIVISEUR==64 || DIVISEUR==8)
movw XH:XL,ANSH:ANSL
lsr XH
ror XL
lsr XH
ror XL
#endif
#if DIVISEUR==256
clr XH
mov XL,ANSH
lsr XL
lsr XL
#endif
#if DIVISEUR==1024
clr XH
mov XL,ANSH
lsr XL
lsr XL
lsr XL
lsr XL
#endif
clr A
cp XL,A
cpc XH,A
breq endwait4deg
Wait4xCycles:
sbiw XH:XL, 1
brne Wait4xCycles
endwait4deg:
ret
Init_count:
cli
in A,TCCR0B
#if DIVISEUR==8
ori A,(1<<CS01)
#endif
#if DIVISEUR==64
ori A,(1<<CS01)|(1<<CS00)
#endif
#if DIVISEUR==256
ori A,(1<<CS02)
#endif
#if DIVISEUR==1024
ori A,(1<<CS02)|(1<<CS00)
#endif
out TCCR0B,A
in A,TIMSK
ori A,(1<<TOIE0)|(1<<PCIE)
out TIMSK,A
clr YH
clr YL
Init74HC595:
ldi A,(1<<SERDT) | (1<<SRCLK) | (1<<RCLK) | (0<<HALL)
out DDR74HC595,A
in A,GIFR
ori A, (1<<PCIF)
out GIFR,A
in A,GIMSK
ori A,(1<<PCIE)
out GIMSK,A
in A,PCMSK
ori A, (1 << HALL)
out PCMSK,A
in A,MCUCR
ori A,(1<<ISC01) | (0<<ISC00)
out MCUCR,A
sei
clr last_IN_state
MAIN_LOOP:
movw delayTimeH:delayTimeL,ANSH:ANSL
ldi A,1
mov r7,A
clr A
cp YL,r7
cpc YH,A
brlo MAIN_LOOP
sbrs last_IN_state,1
rjmp MAIN_LOOP
Disp_text:
ldi ZL, LOW(TEXT<<1)
ldi ZH, HIGH(TEXT<<1)
rcall write_string
cbr last_IN_state,2
rjmp MAIN_LOOP
DIV1616:
movw ANSH:ANSL,ONERH:ONERL
ldi C,17
sub REML,REML
clr REMH
LOOP16:
rol ANSL
rol ANSH
dec C
breq DONE
rol REML
rol REMH
sub REML,BL
sbc REMH,BH
brcc SKIP
add REML,BL
adc REMH,BH
clc
rjmp LOOP16
SKIP:
sec
rjmp LOOP16
DONE:
ret
TimerOVF:
cli
adiw YL,1
sei
reti
Restart_Disp:
cli
push A
in A,PINB
sbic PINB,HALL
rjmp NOHall
sbrc last_IN_state,0
rjmp fin_Restart_Disp
sbr last_IN_state,1
rjmp fin_Restart_Disp
NOHall:
sbrs last_IN_state,0
rjmp fin_Restart_Disp
cbr last_IN_state,1
mov ONERL,YL
mov ONERH,YH
ldi BL,LOW(90)
ldi BH,HIGH(90)
rcall DIV1616
clr YL
clr YH
sbr last_IN_state,2
fin_Restart_Disp:
pop A
sei
reti
TEXT: .db "BTS CPI 2019 "cmd,0xFF,0xFF
.include "pov6x8.inc"
.ESEG
.org 0xc0
buildtime:
.db "sammy76.free.fr "
.db "V1.00:%DAY%.%MONTH%.%YEAR% %HOUR%:%MINUTE%"
.db 13,10,"POV V1.0 "
Et enfin la police de caractère pov6x8.inc
POVled_font5x8:
.db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf4,0x00,0x00
.db 0x00,0xe0,0x00,0xe0,0x00,0x28,0xfe,0x28,0xfe,0x28
.db 0x24,0x54,0xfe,0x54,0x48,0x46,0x26,0x10,0xc8,0xc4
.db 0x6c,0x92,0xaa,0x44,0x0a,0x00,0xa0,0xc0,0x00,0x00
.db 0x00,0x38,0x44,0x82,0x00,0x00,0x82,0x44,0x38,0x00
.db 0x28,0x10,0x7c,0x10,0x28,0x10,0x10,0x7c,0x10,0x10
.db 0x00,0x00,0x05,0x06,0x00,0x10,0x10,0x10,0x10,0x10
.db 0x00,0x06,0x06,0x00,0x00,0x04,0x08,0x10,0x20,0x40
.db 0x7c,0x8a,0x92,0xa2,0x7c,0x00,0x42,0xfe,0x02,0x00
.db 0x42,0x86,0x8a,0x92,0x62,0x84,0x82,0xa2,0xd2,0x8c
.db 0x18,0x28,0x48,0xfe,0x08,0xe4,0xa2,0xa2,0xa2,0x9c
.db 0x3c,0x52,0x92,0x92,0x0c,0x80,0x8e,0x90,0xa0,0xc0
.db 0x6c,0x92,0x92,0x92,0x6c,0x60,0x92,0x92,0x94,0x78
.db 0x00,0x6c,0x6c,0x00,0x00,0x00,0x6a,0x6c,0x00,0x00
.db 0x10,0x28,0x44,0x82,0x00,0x28,0x28,0x28,0x28,0x28
.db 0x00,0x82,0x44,0x28,0x10,0x40,0x80,0x8a,0x90,0x60
.db 0x4c,0x92,0x9a,0x8a,0x7c,0x3e,0x48,0x88,0x48,0x3e
.db 0xfe,0x92,0x92,0x92,0x6c,0x7c,0x82,0x82,0x82,0x44
.db 0xfe,0x82,0x82,0x44,0x38,0xfe,0x92,0x92,0x92,0x82
.db 0xfe,0x90,0x90,0x90,0x80,0x7c,0x82,0x92,0x92,0x5e
.db 0xfe,0x10,0x10,0x10,0xfe,0x00,0x82,0xfe,0x82,0x00
.db 0x04,0x02,0x82,0xfc,0x80,0xfe,0x10,0x28,0x44,0x82
.db 0xfe,0x02,0x02,0x02,0x02,0xfe,0x40,0x30,0x40,0xfe
.db 0xfe,0x20,0x10,0x08,0xfe,0x7c,0x82,0x82,0x82,0x7c
.db 0xfe,0x90,0x90,0x90,0x60,0x7c,0x82,0x8a,0x84,0x7a
.db 0xfe,0x90,0x98,0x94,0x62,0x62,0x92,0x92,0x92,0x8c
.db 0x80,0x80,0xfe,0x80,0x80,0xfc,0x02,0x02,0x02,0xfc
.db 0xf8,0x04,0x02,0x04,0xf8,0xfc,0x02,0x1c,0x02,0xfc
.db 0xc6,0x28,0x10,0x28,0xc6,0xe0,0x10,0x0e,0x10,0xe0
.db 0x86,0x8a,0x92,0xa2,0xc2,0x00,0xfe,0x82,0x82,0x00
.db 0xaa,0x54,0xaa,0x54,0xaa,0x00,0x82,0x82,0xfe,0x00
.db 0x20,0x40,0x80,0x40,0x20,0x02,0x02,0x02,0x02,0x02
.db 0x00,0x80,0x40,0x20,0x00,0x04,0x2a,0x2a,0x2a,0x1e
.db 0xfe,0x12,0x22,0x22,0x1c,0x1c,0x22,0x22,0x22,0x04
.db 0x1c,0x22,0x22,0x12,0xfe,0x1c,0x2a,0x2a,0x2a,0x18
.db 0x10,0x7e,0x90,0x80,0x40,0x18,0x25,0x25,0x25,0x3e
.db 0xfe,0x10,0x20,0x20,0x1e,0x00,0x22,0xbe,0x02,0x00
.db 0x02,0x01,0x21,0xbe,0x00,0xfe,0x08,0x14,0x22,0x00
.db 0x00,0x82,0xfe,0x02,0x00,0x3e,0x20,0x18,0x20,0x1e
.db 0x3e,0x10,0x20,0x20,0x1e,0x1c,0x22,0x22,0x22,0x1c
.db 0x3f,0x24,0x24,0x24,0x18,0x18,0x24,0x24,0x18,0x3f
.db 0x3e,0x10,0x20,0x20,0x10,0x12,0x2a,0x2a,0x2a,0x04
.db 0x20,0xfc,0x22,0x02,0x04,0x3c,0x02,0x02,0x04,0x3e
.db 0x38,0x04,0x02,0x04,0x38,0x3c,0x02,0x0c,0x02,0x3c
.db 0x22,0x14,0x08,0x14,0x22,0x38,0x05,0x05,0x05,0x3e
.db 0x22,0x26,0x2a,0x32,0x22,0x08,0x36,0x41,0x00,0x00
.db 0x00,0x7f,0x00,0x00,0x00,0x41,0x36,0x08,0x00,0x00
.db 0x10,0x20,0x10,0x08,0x10,0x28,0x28,0x28,0x28,0x28
.db 0x7C,0xAA,0xAA,0x82,0x44,0x5c,0x02,0x02,0x04,0x5e
.db 0x1c,0x2a,0x2a,0xaa,0x9a,0x84,0xaa,0xaa,0x9e,0x82
.db 0x84,0x2a,0x2a,0x1e,0x82,0x84,0xaa,0x2a,0x1e,0x02
.db 0x04,0x2a,0xaa,0x9e,0x02,0x30,0x78,0x4a,0x4e,0x48
.db 0x9c,0xaa,0xaa,0xaa,0x9a,0x9c,0x2a,0x2a,0x2a,0x9a
.db 0x9c,0xaa,0x2a,0x2a,0x1a,0x00,0x00,0xa2,0x3e,0x82
.db 0x00,0x40,0xa2,0xbe,0x42,0x00,0x80,0xa2,0x3e,0x02
.db 0x0f,0x94,0x24,0x94,0x0f,0x0f,0x14,0xa4,0x14,0x0f
.db 0x3e,0x2a,0xaa,0xa2,0x00,0x04,0x2a,0x2a,0x3e,0x2a
.db 0x3e,0x50,0x90,0xfe,0x92,0x4c,0x92,0x92,0x92,0x4c
.db 0x4c,0x12,0x12,0x12,0x4c,0x4c,0x52,0x12,0x12,0x0c
.db 0x5c,0x82,0x82,0x84,0x5e,0x5c,0x42,0x02,0x04,0x1e
.db 0x00,0xb9,0x05,0x05,0xbe,0x9c,0x22,0x22,0x22,0x9c
.db 0xbc,0x02,0x02,0x02,0xbc,0x3c,0x24,0xff,0x24,0x24
.db 0x12,0x7e,0x92,0xc2,0x66,0xd4,0xf4,0x3f,0xf4,0xd4
.db 0xff,0x90,0x94,0x6f,0x04,0x03,0x11,0x7e,0x90,0xc0
.db 0x04,0x2a,0x2a,0x9e,0x82,0x00,0x00,0x22,0xbe,0x82
.db 0x0c,0x12,0x12,0x52,0x4c,0x1c,0x02,0x02,0x44,0x5e
.db 0x00,0x5e,0x50,0x50,0x4e,0xbe,0xb0,0x98,0x8c,0xbe
.db 0x64,0x94,0x94,0xf4,0x14,0x64,0x94,0x94,0x94,0x64
.db 0x0c,0x12,0xb2,0x02,0x04,0x1c,0x10,0x10,0x10,0x10
.db 0x10,0x10,0x10,0x10,0x1c,0xf4,0x08,0x13,0x35,0x5d
.db 0xf4,0x08,0x14,0x2c,0x5f,0x00,0x00,0xde,0x00,0x00
.db 0x10,0x28,0x54,0x28,0x44,0x44,0x28,0x54,0x28,0x10
.db 0x55,0x00,0xaa,0x00,0x55,0x55,0xaa,0x55,0xaa,0x55
.db 0x00,0x00,0x00,0xff,0x00,0x08,0x08,0x08,0xff,0x00
.db 0x28,0x28,0x28,0xff,0x00,0x08,0x08,0xff,0x00,0xff
.db 0x08,0x08,0x0f,0x08,0x0f,0x28,0x28,0x28,0x3f,0x00
.db 0x28,0x28,0xef,0x00,0xff,0x00,0x00,0xff,0x00,0xff
.db 0x28,0x28,0x2f,0x20,0x3f,0x28,0x28,0xe8,0x08,0xf8
.db 0x08,0x08,0xf8,0x08,0xf8,0x28,0x28,0x28,0xf8,0x00
.db 0x08,0x08,0x08,0x0f,0x00,0x00,0x00,0x00,0xf8,0x08
.db 0x08,0x08,0x08,0xf8,0x08,0x08,0x08,0x08,0x0f,0x08
.db 0x00,0x00,0x00,0xff,0x08,0x08,0x08,0x08,0x08,0x08
.db 0x08,0x08,0x08,0xff,0x08,0x00,0x00,0x00,0xff,0x28
.db 0x00,0x00,0xff,0x00,0xff,0x00,0x00,0xf8,0x08,0xe8
.db 0x00,0x00,0x3f,0x20,0x2f,0x28,0x28,0xe8,0x08,0xe8
.db 0x28,0x28,0x2f,0x20,0x2f,0x00,0x00,0xff,0x00,0xef
.db 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0xef,0x00,0xef
.db 0x28,0x28,0x28,0xe8,0x28,0x08,0x08,0xf8,0x08,0xf8
.db 0x28,0x28,0x28,0x2f,0x28,0x08,0x08,0x0f,0x08,0x0f
.db 0x00,0x00,0xf8,0x08,0xf8,0x00,0x00,0x00,0xf8,0x28
.db 0x00,0x00,0x00,0x3f,0x28,0x00,0x00,0x0f,0x08,0x0f
.db 0x08,0x08,0xff,0x08,0xff,0x28,0x28,0x28,0xff,0x28
.db 0x08,0x08,0x08,0xf8,0x00,0x00,0x00,0x00,0x0f,0x08
.db 0xff,0xff,0xff,0xff,0xff,0x0f,0x0f,0x0f,0x0f,0x0f
.db 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0xff,0xff
.db 0xf0,0xf0,0xf0,0xf0,0xf0,0x1c,0x22,0x22,0x1c,0x22
.db 0x3e,0x54,0x54,0x7c,0x28,0x7e,0x40,0x40,0x60,0x60
.db 0x40,0x7e,0x40,0x7e,0x40,0xc6,0xaa,0x92,0x82,0xc6
.db 0x1c,0x22,0x22,0x3c,0x20,0x02,0x7e,0x04,0x78,0x04
.db 0x60,0x40,0x7e,0x40,0x40,0x99,0xa5,0xe7,0xa5,0x99
.db 0x38,0x54,0x92,0x54,0x38,0x32,0x4e,0x80,0x4e,0x32
.db 0x0c,0x52,0xb2,0xb2,0x0c,0x0c,0x12,0x1e,0x12,0x0c
.db 0x3d,0x46,0x5a,0x62,0xbc,0x7c,0x92,0x92,0x92,0x00
.db 0x7e,0x80,0x80,0x80,0x7e,0x54,0x54,0x54,0x54,0x54
.db 0x22,0x22,0xfa,0x22,0x22,0x02,0x8a,0x52,0x22,0x02
.db 0x02,0x22,0x52,0x8a,0x02,0x00,0x00,0xff,0x80,0xc0
.db 0x07,0x01,0xff,0x00,0x00,0x10,0x10,0xd6,0xd6,0x10
.db 0x6c,0x48,0x6c,0x24,0x6c,0x60,0xf0,0x90,0xf0,0x60
.db 0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x08,0x08,0x00
.db 0x0c,0x02,0xff,0x80,0x80,0x00,0xf8,0x80,0x80,0x78
.db 0x00,0x98,0xb8,0xe8,0x48,0x00,0x3c,0x3c,0x3c,0x3c