??? 05/18/06 23:47 Read: times |
#116584 - Some advice Responding to: ???'s previous message |
Firstly, don't use 'u' for 'you' - it causes confusion as 'u' could also mean 'micro'. The same goes for the use of '2' for 'to'. As an aside, can you explain to me why so many people from Pakistan and India do this? Do they teach this in schools? Or is it a side effect from using mobile (cell) phones? Anyhow, your circuit concept is ok except that you need to be aware of the current capabilities of the cpu you are using. Also be aware that display brightness may be a problem - because you are multiplexing at 1:4 only 1/4 of the energy is available to each display so that directly affects brighness. This means you have to run more current to the display, so instead of running 15mA per segment, you might run 60mA (15mA * 4) and if you have 7 segments on, this can be 60mA * 7 = 420mA. Do your transistors have enough current gain and current ability for this? Also, the port pins may not be able to provide 60mA per pin. This may cause the cpu to get hot or more likely the port pin will not be able to pull to 0V strong enough - so you will not get good brightness. I would suggest using a ULN2003 or ULN2803 to drive the segments. For the transistors, something like a BD681 might be a good choice as it is darlington. By all means experiment, but be aware of what I have mentioned. As for your software, try seting up a timer (0 or 1) to interrupt every 1mS (not critical). Each timer interrupt, output and select a digit. Therefore it takes 4 timer interrupts to output the four digits. This keeps on repeating so all you see is a constant display. For the 7segment conversion, use a lookup table to convert a bcd number to the 7 segment. For example: ; ; A has the bcd number to convert to 7 segment ; conv_sevenseg: anl a,#0fh ;0nly 0..15 allowed mov dptr,#seven_seg_table movc a,@a+dptr ;a has the 7 segment value ret seven_seg_table: db xxh ;for digit '0' db .. db .. db .. db .. do for all digits... Have fun. |