WR Home Topic Home | Chapter: 1 2 3 |
<Previous | Next> |
Chapter 03
Circuitry for the Propeller PCB
Page 4
Some concepts about switching
Disadvantage of this method:
Question: We want to do two things:
- Switch ON rightmost Red and Green LED
- Switch ON leftmost Red but to switch OFF leftmost Green.
(NOTE: Question-marks "???????" are on the left side)
For now (just for the time-being) the answer is NO.
Explanation: There are four pairs of Red and Green LEDs. Each pair shares a common anode. So each pair must behave in a same way, either both ON or both OFF.
Solution:
- If the pair does not share the anode, they can be controlled separately. This will take two nibbles. Hence, while storing the onSequence two nibbles will be required: One for Red and one for Green. But this is NOT the desired solution ( WHY ? ). The two diagrams illustrates the method of using separate nibbles:
- Another solution is to cycle the sequence (See animation below) :
CC_Red = GND, CC_Green = N/C, Nibble = 1001
CC_Red = N/C, CC_Green = GND, Nibble = 0001
Explanation:- In the first step, onSequence is applicable to Red LEDs only,
because the master control for Green LEDs is OFF (CC_Green = N/C) - In the second step, the onSequence is applicable to Green LEDs only,
because the master control for Red LEDs is OFF (CC_Red = N/C) - Goto Step 1 and repeat, while the desired pattern is required.
This is known as Time Division Multiplexing (TDM). For some time, Red is visible and for time, Green is visble. If the process is repeated, let us say 100 times in a second then we will not see them flickering, but it will produce the desired effect.
The animation shown below illustrates this concept:
- In the first step, onSequence is applicable to Red LEDs only,
Finally, with the help of TDM, we can achieve the desired effect, without having separate anodes.
Why method-1 is not used ? What is the problem using separate anodes ?
The anodes of LEDs will be connected by a microcontrollers port. For 4-common-anodes only 4-pins will be occupied. Four separate anodes for Red and four separate anodes for Green, will require 8-port pins. The micro-controller has limited port pins, they should be used optimally, else purchasing a micro controller with more GPIO (General Purpose Input Output) pins will increase the overall project cost.
Conclusion:
By here you must understand when to use TDM and when NOT to.
- When Red and Green LEDs have the same onSequence (Nibble) its simple (no TDM required).
- When Red and Green LEDs have different onSequence (Nibble), namely onSequence_Red and onSequence_Green we display them alternately in the following manner:
- Apply CC_R = GND, CC_G = N/C (so that only Red LEDs will "listen")
- Now apply onSequence for Red LEDs
- Apply CC_R = N/C, CC_G = GND (so that only Green LEDs will "listen")
- Now apply onSequence for Green LEDs
Question:
If it is desired to switch ON all the Red LEDs and no Green LED, what will be the value of
CC_Red, CC_Green and onSequence (nibble) ? Will you need TDM or not ?
WR Home Topic Home | Chapter: 1 2 3 |
<Previous | Next> |