Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////////////////////////////////////////////////////////////////
- // Fonction : void vInitPortSerie(void) Par : Pierre Chouinard
- // Compilateur : Keil uVision3 V3.60 Date: 17 Decembre 2008
- //
- // Description: Met les valeurs necessaires dans les SFRs pour configurer
- // le port serie a 57600 bauds avec interruption.
- //
- // Appel de la fonction : vInitPortSerie();
- //////////////////////////////////////////////////////////////////////////////
- void vInitPortSerie(void)
- {
- SCON0 = 0x50; // Selectione mode 1, 8-bit avec reception
- TMOD = TMOD | 0x20; // timer 1, mode 2, 8-bit auto reload
- TH1 = 0xFF; // a 11.0592MHz: FA=4800,FD=9600,FE=14400 et FF=28800
- PCON = PCON | 0x80; // Le bit SMOD = 1 pour vitesse * 2 du port serie
- ET1 = 0; // Pas interrupt on Timer 1 (IE.3)
- TR1 = 1; // Active le timer 1
- TI_0 = 0; // Transmit Flag. A 0 pour ne pas generer Int. (SCON0.1)
- RI_0 = 1; // Receive Flag. Mis a 1 pour generer Int. (SCON0.0)
- ES0 = 1; // Active l'interruption du port serie (IE.4)
- }// Fin vInitPortSerie()
Advertisement
Add Comment
Please, Sign In to add comment