Parallel Port LED Interfaces - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

Parallel Port LED Interfaces

Description:

Title: PowerPoint Presentation Author: burrk Last modified by: cwk Created Date: 11/1/2004 4:55:15 PM Document presentation format: – PowerPoint PPT presentation

Number of Views:112
Avg rating:3.0/5.0
Slides: 23
Provided by: Bur98
Category:

less

Transcript and Presenter's Notes

Title: Parallel Port LED Interfaces


1
Parallel Port LED Interfaces
2
Output LEDs
3
Output LEDs
  • Direct Interface ? Output Pin? ??? LED ? ??
    ??.
  • Scanned Interface LED ? Matrix ??? ????.
  • Multiplexed Interface Multiplexing Hardware ??
    ?? Scanned Interface ?? ? ?? LED ? ?? ? ? ??.

4
Single LED Interface
  • Open Collector ? ??? LED ??

5
8.2.1 Single LED Interface
  • LED? ??? ?? ?? ???? ??

6
8.2.1 Single LED Interface
7
Single LED Interface
Id 10mA, Vd 2V
8
Single LED Interface
9
8.2.1 Single LED Interface
Id (Vcc Vd Vce) / R R (Vcc Vd Vce) /
Id
10
Seven-Segment LED Interface
11
Seven-Segment LED Interface
12
Seven-Segment LED Interface
13
Seven-Segment LED Interface
14
8.2.3 Scanned Seven-Segment LED Interface
  • LED? ?? ?? 10mA, 2V ??,
  • 3?? LED? ?? ?? ??
  • ? LED? Duty? 33 ? ?? ???
  • Active ?? LED ? ?? ??? 30mA ? ??? ??.

15
8.2.3 Scanned Seven-Segment LED Interface
16
C software interface of a scanned LED display.
// MC68HC812A4 // PB7-PB0 output, 7 bit pattern
// PC2-PC0 output, selects LED digit unsigned
char code3 // binary codes static unsigned
char select34,2,1 unsigned int index //
0,1,2 define C5F 0x20 pragma interrupt_handler
TOC5handler() void TOC5handler(void)
TFLG1C5F // Acknowledge
TC5TOC510000 // every 5 ms
PORTCselectindex // which LED?
PORTBcodeindex // enable if(index3)
index0
void ritual(void) asm(" sei") // make
atomic index0 DDRC0xFF // outputs 7
segment code DDRB0xFF // outputs select
LED TMSK1C5F // Arm OC5 TIOSC5F
// enable OC5 TSCR0x80 // enable
TMSK20x32 // 500 ns clock TC5TCNT10000
asm(" cli")
17
Scanned LED Interface Using the 7447
Seven-Segment Decoder
Seven-Segment Decoder
18
C software interface of a multiplexed LED display.
// MC9S12C32, CodeWarrior C unsigned short
Global // 12-bit packed BCD const struct LED
unsigned char enable // select unsigned char
shift // bits to shift const struct LED
Next // Link typedef const struct LED
LEDType typedef LEDType LEDPtr LEDType
LEDTab3 0x04, 8, LEDTab1 , // Most
sig 0x02, 4, LEDTab2 , 0x01, 0,
LEDTab0 // least sig LEDPtr Pt //
Points to current digit void interrupt 13
TC5handler(void) TFLG1 0x20 //
Acknowledge TC5 TC510000 // every 5 ms
PTT (Pt-gtenable) (Global gtgt
(pt-gtshift)) ltlt 4) // BCD Unpacking and // BCD
code -gt PT4 -gt PT7 Pt Pt-gtNext void
LED_Init(void) asm sei // make atomic
DDRT 0xFF // outputs to LED's Global
0 PtLEDTab0 TIE 0x20 // Arm OC5
TIOS 0x20 // enable OC5 TSCR1 0x80
// enable TSCR2 0x01 // 500 ns clock
TC5 TCNT10000 asm cli
19
Integrated LED Interface Using the MC14489
Display Driver
  • MC14489 Display Driver? ??? ??? ??
  • Chip Count ? ????.
  • Scanning Function ? hardware ??? ????.
  • MC14489? Cascade ?? ???? ? ??? Display ??? ?? ??
    ?? ? ? ??.

20
Integrated LED Interface Using the MC14489
Display Driver
Packed BCD? ??? 24Bit Data ?? ?
5 Digit Packed BCD
Decimal Point Control
21
Integrated LED Interface Using the MC14489
Display Driver
22
C software interface of an integrated LED display.
// MC68HC812A4 // PS5/MOSI MC14489 DATA IN //
PS6/SCLK MC14489 CLOCK IN // PS7 (simple
output) MC14489 ENABLE void ritual(void)
DDRS 0xE0 // outputs to MC14489
SP0CR10x50 // bit meaning // 7 SPIE0 no
interrupts // 6 SPE1 SPI enable // 5 SWOM0
regular outputs // 4 MSTR1 master // 3 CPOL0
match timing with MC14489 // 2 CPHA0 // 1 SSOE0
PS7 is simple output // 0 LSBF0 MSB first
SP0CR20x00 // no pull-up, regular drive
SP0BR0x02 // 1Mhz SCLK PORTS 0x80 //
ENABLE1 PORTS 0x7F // ENABLE0 SP0DR
0x01 // hex format while(SP0SR0x80)0)
PORTS0x80 // ENABLE1 void
LEDout(unsigned char data3) //packed PORTS
0x7F // ENABLE0 SP0DR data2 //
send MSbyte while(SP0SR0x80)0)
SP0DR data1 // send middle byte
while(SP0SR0x80)0) SP0DR data0 //
send LSbyte while(SP0SR0x80)0)
PORTS 0x80 // ENABLE1
Write a Comment
User Comments (0)
About PowerShow.com