Interfacciamento emissione su stampante di un dato che rappresenta una tensione acquisita da un...
-
Upload
elario-rosi -
Category
Documents
-
view
217 -
download
1
Transcript of Interfacciamento emissione su stampante di un dato che rappresenta una tensione acquisita da un...
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 80552
• Decodifica oraria• tramite Personal Computer
• tramite microcontrollore 80552
SCHEMA A BLOCCHIAcquisizione d.d.p.
tramite personal computer
scheda ADC PC stampanted.d.p.
programma
SCHEMA A BLOCCHIAcquisizione d.d.p.
tramite microcontrollore 80552
stampanted.d.p.
programma
microcontrollore 80552contiene un ADC a 10 bit
Blocchi funzionali
S ta rt L e ttu ra
A cq u is iz ioned a ti
C o nv ers io nefo rm a to
R e se t In v io s inc ro no V u ota b u ffe r
S tam pate ns ion i
v o ltm e tro
Temporizzazioni stampante
Segmento di acquisizione e conversione formato
outportb(adc,0x1);
delay(1);
dato = inportb(adc);
num = dato * 0.01953;
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 BLOCCHIDecodifica segnale orario tramite microcontrollore
80552
PLL 80552 display 7 seg.
segnale B.F. RAI
programma
Segnale orario codificato
Blocchi funzionali
a tten d is inc ron ism o
le gg i i b itd e l seg na le
d e co d if ica se g na le
a ttivad ig it
a ttiva se gm en to
e m e tti d isp lay s ta m pa v id eoso lo P C
o rar io
Segmento stampa_displayvoid 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 80552/* - 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 80552
/* ######################### 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 LinkerIAR
• compilatore• ICC8051 -ms -L -q -P <path> nomefile.C
• linker• XLINK - f <path> 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=8ecc.
File in formato INTEL:10028D001203317810E4F608F6C37811E6940618D7:10029D00E69400506A75C5087F017E0012035D78F3:1002AD0016A6C675C5007816E6FFE4FEFDFC120223:1002BD00517B617AFD799F783C1200B57812A604C6:1002CD0008A60508A60608A607780AE4F608F6C3E8:1002DD00780BE6940518E69400501075C041120392:1002ED0011780B06E61870010680E412034C7FE8C6:1002FD007E0312035D781106E618700106808A7F71:10030D00007E00227F017E0012035D7590FE7F014D:10031D007E0012035D7590FF7F017E0012035D7FED:10032D00007E00227590FF7F017E0012035D75C077:10033D001B12031175C0401203117F007E00227540:10034D00C00A12031175C00D1203117F007E002229:10035D007808A60608A607780CE4F608F6C3780D0B:10036D00E679099718E619975026780EE4F608F6FF:10037D00C3780FE694DC18E69405500A780F06E66C:10038D001870010680EA780D06E61870010680CD1A:01039D00223D:03000000020003F8:1000030075811678167600D8FC900000AE83AF8217
parte di file pronto per essere inviato ad un programmatore di EPROM
...