Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- * Initialisation des addresses des ports d'entrée/sortie avec le controleur LCD
- cmdLCD EQU #
- dataLCD EQU #
- lib_init:
- * Initialisation de l'écran LCD
- * Attendre pour 40 ms: 16M*0.04s = 640000
- MOVE.L #640000,D7
- BSR lib_wait
- * Envoi du signal d'initialisation n°1
- MOVE.B #$30,cmdLCD
- * Attendre pendant 4.1 ms : 16M*0.0041s = 65600
- MOVE.L #65600,D7
- BSR lib_wait
- * Envoi du signal d'initialisation n°2
- MOVE.B #$30,D7
- * Attendre pendant 100 us : 16M*0.0001s = 1600
- MOVE.L #1600,D7
- BSR lib_wait
- * Envoi du signal d'initialisation n°3
- MOVE.B #$30,cmdLCD
- BSR lib_bf ; Attendre que le BF soit ok
- * Effacement de l'écran
- MOVE.B #$01,cmdLCD
- BSR lib_bf
- * Curseur non visible, pas de clignottement, etc
- MOVE #$0C,cmdLCD
- BSR lib_bf
- RTS
- lib_bf:
- * Attendre jusqu'a avoir BF = 0 (LCD prêt)
- BTST #7,cmdLCD
- BNE lib_bf ; Si BF = 1, on recommence
- RTS ; Sinon on retourne de la sous-routine
- lib_wait:
- * Attendre pendant D7 cycles
- * Rappel: la fréquence de la clock est de 16 Mhz
- lib_wait_loop:
- ADDI.L #-20,D7 ; On retire 20 cycles au compteur
- BGE wait_end ; Lorsque le nb de cycles devient egal zero ou negatif on arrete
- BRA wait_loop ; Sinon on recommence
- lib_wait_end:
- RTS ; Retour de la sous-routine
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement