Interfacciamento emissione su stampante di un dato che rappresenta una tensione acquisita da un convertitore analogico digitale decodifica e visualizzazione del segnale orario dell’Istituto Galileo Ferraris diffuso dalla RAI
Modalità di realizzazione Acquisizione d.d.p. tramite Personal Computer tramite microcontrollore Decodifica oraria tramite Personal Computer tramite microcontrollore 80552
SCHEMA A BLOCCHI Acquisizione d.d.p. tramite personal computer scheda ADC PC stampante d.d.p. programma
SCHEMA A BLOCCHI Acquisizione d.d.p. tramite microcontrollore stampante d.d.p. programma microcontrollore contiene un ADC a 10 bit
Blocchi funzionali
Temporizzazioni stampante
Segmento di acquisizione e conversione formato outportb(adc,0x1); delay(1); dato = inportb(adc); num = dato * ; sprintf(dato_stampa,"%f",num); for (i=0; i<5; i++){ outportb(port, dato_stampa[i]); }...
SCHEMA A BLOCCHI Decodifica segnale orario tramite personal computer PLL lpt1 PC video segnale B.F. RAI programma display 7 seg.
SCHEMA A BLOCCHI Decodifica segnale orario tramite microcontrollore PLL display 7 seg. segnale B.F. RAI programma
Segnale orario codificato
Blocchi funzionali
Segmento stampa_display void stampa_display(unsigned long dato_letto) { unsigned char temp,temp1; struct orario{ unsigned Parita2 : 1; unsigned gioS : 3; unsigned gioU : 4; unsigned gioD : 2; unsigned mesU : 4; unsigned mesD : 1; unsigned Parita1 : 1; unsigned Legale : 1; unsigned minU : 4; unsigned minD : 3; unsigned oraU : 4; unsigned oraD : 2; }; union { struct orario y; unsigned long letto; } x ; x.letto = dato_letto; #define rai(tv) 0x0B ^ x.y.tv
Struttura microcontrollore 80552
Dettaglio memoria
SFRegisters C:\disco_d\SCUOLA\sheet\80c552overwiev.pdf
HEADER per /* - IO525.H - Special header for the 80C552 processor. Version 4.00 [IANR] */ #pragma language=extended /*===============================*/ /* Predefined SFR Byte Addresses */ /*===============================*/ sfr P0 = 0x80; sfr P1 = 0x90; sfr P2 = 0xA0; sfr P3 = 0xB0; sfr P4 = 0xC0; sfr P5 = 0xC4; sfr PSW = 0xD0; sfr ACC = 0xE0; sfr B = 0xF0; sfr SP = 0x81;
HEADER /* ######################### 8X51 and 8xC51 ########################### */ #define P0 (*(unsigned char *)(0x80)) #define SP (*(unsigned char *)(0x81)) #define PCON (*(unsigned char *)(0x87)) #define TCON (*(unsigned char *)(0x88)) #define TMOD (*(unsigned char *)(0x89)) #define TL0 (*(unsigned char *)(0x8a)) #define TL1 (*(unsigned char *)(0x8b)) #define TH0 (*(unsigned char *)(0x8c)) #define TH1 (*(unsigned char *)(0x8d)) #define P1 (*(unsigned char *)(0x90)) #define SCON (*(unsigned char *)(0x98)) #define SBUF (*(unsigned char *)(0x99)) #define P2 (*(unsigned char *)(0xA0)) #define IE (*(unsigned char *)(0xA8)) #define P3 (*(unsigned char *)(0xB0)) #define IP (*(unsigned char *)(0xB8)) #define PSW (*(unsigned char *)(0xD0)) #define ACC (*(unsigned char *)(0xE0)) #define B (*(unsigned char *)(0xF0))
Compilatore e Linker IAR compilatore ICC8051 -ms -L -q -P nomefile.C linker XLINK - f nomefile.XCL
Il File nome.XCL -! -LNK8051.XCL- XLINK 4.2x command file to be used with the 8051 C-compiler V4.xx using the -mt, -ms, -mc, -mm or -ml memory model Usage: xlink your_file(s) -f lnk8051l First: define CPU -! -c8051 -! Select register bank [0,8,10 or 18]-! -D_R=0 -! Setup "bit" segments (always zero if there is no need to reserve bit variable space for some other purpose) -! -Z(BIT)C_ARGB,BITVARS=0 -! Setup "data" segments. Start address may not be less than _R+8 (start of register bank + 8). Space must also be left for interrupt functions with the "using" attribute. That is, if _R is 0 and there is an interrupt function with using [1], the start address should be set to 10 (hex) -! -Z(DATA)C_ARGD,D_UDATA,D_IDATA=8 ecc.
File in formato INTEL :10028D E4F608F6C37811E D7 :10029D00E A75C5087F017E D78F3 :1002AD0016A6C675C E6FFE4FEFDFC :1002BD00517B617AFD799F783C1200B57812A604C6 :1002CD0008A60508A60608A607780AE4F608F6C3E8 :1002DD00780BE E C :1002ED B06E E412034C7FE8C6 :1002FD007E D781106E A7F71 :10030D00007E00227F017E D7590FE7F014D :10031D007E D7590FF7F017E D7FED :10032D00007E FF7F017E D75C077 :10033D001B C F007E :10034D00C00A C00D F007E :10035D007808A60608A607780CE4F608F6C3780D0B :10036D00E E EE4F608F6FF :10037D00C3780FE694DC18E A780F06E66C :10038D EA780D06E CD1A :01039D00223D : F8 : D8FC900000AE83AF8217 parte di file pronto per essere inviato ad un programmatore di EPROM...