Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
Tools
Old 8th May 2007, 02:01 PM   #16
Default

I should mention that we can take advantage of the column driver bus (only 1 pin is ever low at one time) to implement a simple single-pin column driven switch matrix, if you don't mind a few 1N4148 diodes, where you sample each switch once every six or seven interrupts (depends on how many display columns you're scanning).

If you're using 1.0-msec interrupts this provides a very crude 6 or 7 msec 'debounce' and the code is incredibly simple (the SWKEYS variable is "live" switch press data);

Code:
;
;  refresh switch input from column driven switch matrix (one 
;  switch tested each interrupt cycle)
;
;  COLPOS is our column position ring counter which will contain one
;  of the following values; 00000001, 00000010, 00000100, 00001000, etc.
;
;       comf    COLPOS,W        ; example ~COL3 = 11110111        |
        andwf   SWKEYS,f        ; indicate switch 'off' (0)
        movf    COLPOS,W        ; example  COL3 = 00001000
        btfss   SWInput         ; is switch at COLPOS 'on' (0)?
        iorwf   SWKEYS,f        ; yes, indicate 'on' (1)
** Yes Gramo, please feel free to show us the Swordfish BASIC equivalent (grin)...

Last edited by Mike, K8LH; 8th May 2007 at 02:58 PM.
Mike, K8LH is offline  
Old 8th May 2007, 02:39 PM   #17
Default

Quote:
Originally Posted by picasm
You can't drive the multiple led segments directly from the 4511 chips because their absolute maximum current per output is only 25mA.
He can but since he's still multiplexing them the "average" current and brightness would be quite low. But if he's considering throwing that many chips into his 'solution' he could always use 74HC595's or some other "latch" with 25-ma outputs and he'd have a nice bright nearly 100% duty cycle display...

Last edited by Mike, K8LH; 8th May 2007 at 02:43 PM.
Mike, K8LH is offline  
Old 8th May 2007, 03:15 PM   #18
Default

Quote:
Originally Posted by Mike, K8LH
He can but since he's still multiplexing them the "average" current and brightness would be quite low. But if he's considering throwing that many chips into his 'solution' he could always use 74HC595's or some other "latch" with 25-ma outputs and he'd have a nice bright nearly 100% duty cycle display...
Mike,
I agree with you that the 25mA port limits would be ok for a small multiplexed 7-segment display.
But as the OP wants to make his own very large display, I assume he will need many leds per segment, and I don't favour his 5v supply requirement.
I would be happier if the drivers were able to handle about 500mA, at least it would help protect the chips during the software development stage if he had any multiplexing errors etc.
picasm is offline  
Old 8th May 2007, 04:39 PM   #19
Default

Thank Mike, K8LH and others.

Mike, K8LH as u suggest... Picture has been modified.. Now i am going to use "74HC138".



Now i need ur help.
First little detail.
I am going to use 12 volts for driving Large 7 Segment Display.
For boosting the current after IC 4511 i am going to use "ULN2003"..
some thing like this:
PIC I/O---> IC 4511 ----> ULN2003 -----> Big7 Segment display.

But the problem is, what i use after 74HC138 for boosting the current for driving the Big 7 Segment.
I mean:
PIC I/O---> IC 74HC138 ----> ?????? -----> Big7 Segment display.

Hope u can understand.

Thanks in advance.
Ayne is offline  
Old 9th May 2007, 03:31 PM   #20
Default

Now the complete Circuit..


I want to know from senior membors which will be the best choice for P-Channel MOSFETs for this knid of application.

C & C are welcome.

Thanks in advance..
Ayne is offline  
Old 10th May 2007, 12:10 AM   #21
Default

Quote:
Originally Posted by picasm
Mike,
I agree with you that the 25mA port limits would be ok for a small multiplexed 7-segment display.
But as the OP wants to make his own very large display, I assume he will need many leds per segment, and I don't favour his 5v supply requirement.
I would be happier if the drivers were able to handle about 500mA, at least it would help protect the chips during the software development stage if he had any multiplexing errors etc.
I think you may have misunderstood (or I wasn't clear). I was suggesting directly driving each display with some sort of latch with 25-ma/pin capability. No multiplexing at all. Of course there's no reason to throw 6 ICs at the solution (grin) and as you say it probably isn't a viable solution with "big displays".

Last edited by Mike, K8LH; 10th May 2007 at 12:16 AM.
Mike, K8LH is offline  
Old 10th May 2007, 12:15 AM   #22
Default

Quote:
Originally Posted by Ayne
Now the complete Circuit..


I want to know from senior membors which will be the best choice for P-Channel MOSFETs for this knid of application.

C & C are welcome.

Thanks in advance..
I believe you have a workable solution Sir. And it seems you've settled on Common Anode displays.

Have fun. Mike
Mike, K8LH is offline  
Old 10th May 2007, 04:20 PM   #23
Default

Where is GRAMO.
GRAMO are u going to show basic code for the above project??

Thanks
Ayne is offline  
Old 10th May 2007, 11:24 PM   #24
Default

lol, I won't write the whole thing, but surely a push in the right direction will help.

Personally, I would prefer to use 7 I/O's for the segment's, instead of adding the 4511. Now you have one less component, and the whole project is still very doable with a single 28 Pin PIC.

From there, you need 'Shadow Registers' that contain the Hour/Minute/Second data. Multiplexing each buffer quickly would ensure the displays would not appear to flicker.

The following was written with Swordfish, and the wiring diagram is just a piccy from my site, so you could use the same analogy, but with a different circuit;
Note: This code displays how to use the ISRTimer library. Two timers are set up. One to increment a variable, the other to multiplex the displays

Code:
Device = 18F452
Clock = 20

#option _Segment_Port = PORTC                      // Define the 7-Segment PORT
#option _Segment_TRIS = GetTRIS(_Segment_Port)     // Nice way to automatically get the TRIS
                                                   //  automatically from a selected port
                                                   
Include "ISRTimer.bas"  
Include "utils.bas"

Dim Segment_1_TRIS As TRISD.1,                     // User must define what pins control
    Segment_2_TRIS As TRISD.0,                     //  each segment
    Segment_1 As PORTD.1,
    Segment_2 As PORTD.0            
Dim Number As Byte,                                // Program variables that require no
    Segment_Data As _Segment_Port,                 //  user settings
    Segment_TRIS As _Segment_TRIS,
    Segment_1_Data As Byte,
    Segment_2_Data As Byte

Const
    Timer1 = 0,
    Timer2 = 1
  
// Update_Segments event, multiplex the segment data...
Sub Update_Segments()

    If Segment_1 = 1 Then
        Segment_1 = 0
        Segment_Data = Segment_2_Data
        Segment_2 = 1
    Else
        Segment_2 = 0
        Segment_Data = Segment_1_Data
        Segment_1 = 1    
    EndIf

End Sub

Function Segment_Encode(Segment_Byte As Byte) As Byte  // Convert a byte into segment information
    Select Segment_Byte
    	    Case 0 
    	   	Result = %00111111
    	    Case 1			
    	   	Result = %00000110
    	    Case 2			
    		Result = %01011011
    	    Case 3			
    	   	Result = %01001111
    	    Case 4			
    	   	Result = %01100110
    	    Case 5			
    	   	Result = %01101101 
    	    Case 6			
       		Result = %01111100
    	    Case 7			
     		Result = %00000111
    	    Case 8			
    		Result = %01111111
    	    Case 9			
     		Result = %01100111		 
    	EndSelect
End Function

Sub EncodeSegmentData()                          // Encodes segment data

    Segment_1_Data = Digit(Number,1)             // Extract the first digit & convert it
    Segment_1_Data = Segment_Encode(Segment_1_Data)
    Segment_2_Data = Digit(Number,2)             // Extract the second digit & convert it
    Segment_2_Data = Segment_Encode(Segment_2_Data)

End Sub

// Increment_Number event will increment the register Number
Sub Increment_Number()

    Inc(Number)
    If Number = 100 Then 
        Number = 0
    EndIf
    
    EncodeSegmentData

End Sub

// Start Of Program...
Timer.Initialize(2)                              // initialize the timer module...

// initialise each timer
Timer.Items(Timer1).Interval = 5                 // 5ms
Timer.Items(Timer1).OnTimer = @Update_Segments   // timer1 event handler
Timer.Items(Timer2).Interval = 500               // 500ms
Timer.Items(Timer2).OnTimer = @Increment_Number  // timer2 event handler

Number = 0                                       // Initialize variables
EncodeSegmentData

Segment_TRIS = %00000000                         // Make the segment data lines outputs
Low(Segment_1_TRIS)
Low(Segment_2_TRIS)

Timer.Items(Timer1).Enabled = True               // enable the timers... 
Timer.Items(Timer2).Enabled = True
Timer.Start                                      // start processing all timers...
 
// main program loop...
While True

Wend
__________________
digital-diy.com - Hobby microcontroller projects and tutorials. Assembly, PICBasic and C examples.

gramo is offline  
Old 11th May 2007, 01:10 AM   #25
Default

Driving segments directly from I/O pins is fine for a few displays but the I/O pins just can't meet the peak current demands when you lower the duty cycle with 4 or more displays.

I'm pretty good at analyzing code but I'm lost with that example. Why not just use a 1-msec interrupt to "scan" the display and update the Clock variables once per second (once per 1000 interrupts)?

I'm pretty proud of my High Performance PWM display design -- a single IC and six or seven transistors, and you don't need a 28 pin PIC

Last edited by Mike, K8LH; 11th May 2007 at 02:11 AM.
Mike, K8LH is offline  
Old 11th May 2007, 05:13 AM   #26
Default

Quote:
Originally Posted by Mike, K8LH
Driving segments directly from I/O pins is fine for a few displays but the I/O pins just can't meet the peak current demands when you lower the duty cycle with 4 or more displays.

I'm pretty good at analyzing code but I'm lost with that example. Why not just use a 1-msec interrupt to "scan" the display and update the Clock variables once per second (once per 1000 interrupts)?

I'm pretty proud of my High Performance PWM display design -- a single IC and six or seven transistors, and you don't need a 28 pin PIC

The multiplexing is done every 5mS, this could be lowered too 1mS if you want, just a matter of changing this line;
Code:
Timer.Items(Timer1).Interval = 1                 // 1ms
Timer.Items(Timer1).OnTimer = @Update_Segments   // timer1 event handler
Now, every 1mS, the following Procedure will execute;
Code:
// Update_Segments event, multiplex the segment data...
Sub Update_Segments()

    If Segment_1 = 1 Then
        Segment_1 = 0
        Segment_Data = Segment_2_Data
        Segment_2 = 1
    Else
        Segment_2 = 0
        Segment_Data = Segment_1_Data
        Segment_1 = 1    
    EndIf

End Sub
Of course you can add more displays if need be, but I would consider using a variable to track what segment is being displayed, and use a Select Case routine, like this;
Code:
Inc(Current_Display)                                 //
If Current_Display = 6 Then Current_Display = 0      // Roll over to first display if required
Select Current_Display                               // Find out what data to display
    Case 0
        // Display Seconds_0
    Case 1
        // Display Seconds_1
    Case 2
        // Display Minutes_0
    Case 3
        // Display Minutes_1
    Case 4
        // Display Hours_0
    Case 5
        // Display Hours_1
EndSelect
As for meeting the peak current demands, well the demands are met by the ULN2003 (upto 500mA per channel). It is driven by logic voltages (from the PIC)
__________________
digital-diy.com - Hobby microcontroller projects and tutorials. Assembly, PICBasic and C examples.


Last edited by gramo; 11th May 2007 at 05:18 AM.
gramo is offline  
Old 11th May 2007, 08:21 AM   #27
Default

Quote:
Originally Posted by gramo
As for meeting the peak current demands, well the demands are met by the ULN2003 (upto 500mA per channel). It is driven by logic voltages (from the PIC)
It seems you may not be familiar with duty cycle, average, and peak current.

If you multiplex 8 displays you'll have a 12.5% duty cycle. The 20-ma or so peak current that an I/O pin can supply to an individual LED will have an "average" current of 2.5-ma and your display will be much dimmer.

Last edited by Mike, K8LH; 11th May 2007 at 08:25 AM.
Mike, K8LH is offline  
Old 11th May 2007, 02:54 PM   #28
Default

I am making Main Board in Eagle.
But there is a problem

How to connect +5 Volts and ground to IC2(4028) and IC1(4511).

(I will make it's PCB in Eagle)
Thanks
Ayne is offline  
Old 12th May 2007, 03:51 PM   #29
Default

My project is approx 80% completed.

Power Supply And it's PCB.







Display Board And it's PCB






Main Board(Pcb under construction)




I am enjoying this Project.
I am writing it's code in MikroBasic.
Code is approx completed but not tested yet...

Soon i will post the Whole Project here.

Thanks.
Ayne is offline  
Old 13th May 2007, 01:08 AM   #30
Default

Just a pointer: You can open the pictures in Paint and use the "Stretch/Skew" feature to make them smaller

Why not use Logic FET's? That way you could drive them without the transistor/resistors in place, saving 18 components!
__________________
digital-diy.com - Hobby microcontroller projects and tutorials. Assembly, PICBasic and C examples.

gramo is offline  
Reply

Tags
clockbig, digital, pic

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
ULTRA clean 9VDC Power Supply Project Peter_wadley Electronic Projects 51 13th May 2009 07:58 AM
PIC Digital Clock muralibhat Micro Controllers 36 26th October 2008 12:46 AM
The Oscilloscope ElectroMaster Electronic Theory 12 3rd February 2008 02:45 PM
Digital Troubleshooting and testing walters General Electronics Chat 38 24th August 2005 09:21 AM
Newcomers, please read! (PIC regarded) Upd. 0xD Jay.slovak Micro Controllers 0 17th April 2005 02:05 PM



All times are GMT. The time now is 03:18 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker