Page 201 - Making PIC Microcontroller Instruments and Controllers
P. 201
:
| l l t n I
L I
Ll t l I U
ffi | t | l
U U I tl
- o r - E
::Adtf9:le!]: Schematic lavout: wking lor a set of lour seven-segment displays'
any djfference to lhe widng oI the electronics Once the segments have been wired' the
scheme needed lo display the vanous numbers on the segments can be figured out.
In Figure 15.8, the lighring scheme for the displays is as defined in the iollowing mela
code:
Execute the COUNT instruclion. The COUNTinstruction tells us how many pulses
were detected. We cannot access the displays while this count is being read. This calrses
a blinking ol the displays on a machine running at 4 MHz. Even wher we use ar
interrupldriven routine to light the displays, this does not solve this problem because
interrupts arc not se iced wilhin an instruction in code generated by the PBPcompiler'
Convert this to an rpm
Get the first number separated out
Impress the first numbet on the data lines
Activate the lirst common line as you cycle throuSh the segments
Activate the seven segments one at a lime
Get the second number separated oul
Impress the second number on the data lines
Activate the second common line as you cycle through the segments
Activate the seven segments one at a tlme
Get the third number separated out
Impress the lhird number on the data lines
Activate the thid common line as you cycle through the segments
Activate the seven segments one at a time
Get the fourth number separated out
lmpre., lhe lounh number nn lhe ddla lines