Shop OBEX P1 Docs P2 Docs Learn Events
Ok I would like to draw as little current as possible from the propeller i/o pin and — Parallax Forums

Ok I would like to draw as little current as possible from the propeller i/o pin and

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2012-09-09 18:08 in Propeller 1
Ok I would like to draw as little current as possible from the propeller i/o pin and then amplify that to 25mA. Would a BJT 3904 or 3906 do this? I know the prop pins can source up to 40mA but the whole chip can only do 300mA correct? So that means source 4 25mA seven segment leds will take 1/3 of that 300mA which doesnt seem very efficient. I know I could use resistors to cut down on the current draw but I want to feed the full 25mA to the leds so they will be as bright as possible.

Also this is probably stupid and im gonna feel really sumdb but how would you write

dira[_cathodeA]:=%1
dira[_cathodeC]:=%1

one one line, obviously dira[_cathodeA.._cathodeC]=%111 is not what I want, i just want A and C excluding _cathodeB, Ive tried logic operators in the brackets, commas, semicolons whatever you name it, typing in and/or lol. I looked through the PEKit stuff and I only see how to do ranges in the brackets. The problem is im trying to solve pulling cathodes to ground when I cant always count on the pins being connected in sequential order.
«13

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-08-29 20:15
    What about " dira[_cathodeA.._cathodeC]=%101" if you only want A and C as outputs?

    I'm not sure what kind of current transistors will take but another option for driving mulitple pins while using only a little current is using a 595 shift register.
  • Clock LoopClock Loop Posts: 2,069
    edited 2012-08-29 20:19
    A 595 would get mighty hot, @ 25ma/pin.


    Use a uln2003, and get it a DIP heat sink for longer life.
    You can get one of these at some radio shacks.
    http://www.engineersgarage.com/electronic-components/uln2003-datasheet
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-08-29 21:39
    well shoot i had planned on using a 595 to cut the pins but and sync current but idk how to use it yet and figured id have to have it as a seperate option in the display driver becuase id like to have a version that connects directly to the prop for when io pins arent a concern.. so i cant just use transistors for this?? the prop has no problem feeding 20ma on all 4 annodes..

    as far as the code im trying to turn on pins 1,10 and 21 lets say. how could i change the dira and outa properties of those pins without a dira statement for each. if i were doing pins 1,2,3 ud just write 1..3 after dira or outa but 1,10 and 21 obviously wont work with the range operator.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-08-29 21:50
    You could set pin 21, 10 and 1 to outputs with:
    dira[21..1] := p100000000001000000001
    

    I used "p" instead of "%" because the forum software ate the percent sign.

    I think you'd still be better off setting one pin at a time since the above code would set a bunch of other pins to inputs that you may want to remain outputs.

    In PASM you can "OR" pin states to turn on multilple pins at once. I don't know of a way of doing the same in Spin (though it's likely possible).
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-08-29 22:42
    Ok I would like to draw as little current as possible from the propeller i/o pin and then amplify that to 25mA. Would a BJT 3904 or 3906 do this? I know the prop pins can source up to 40mA but the whole chip can only do 300mA correct? So that means source 4 25mA seven segment leds will take 1/3 of that 300mA which doesnt seem very efficient. I know I could use resistors to cut down on the current draw but I want to feed the full 25mA to the leds so they will be as bright as possible.

    Also this is probably stupid and im gonna feel really sumdb but how would you write

    dira[_cathodeA]:=%1
    dira[_cathodeC]:=%1

    one one line, obviously dira[_cathodeA.._cathodeC]=%111 is not what I want, i just want A and C excluding _cathodeB, Ive tried logic operators in the brackets, commas, semicolons whatever you name it, typing in and/or lol. I looked through the PEKit stuff and I only see how to do ranges in the brackets. The problem is im trying to solve pulling cathodes to ground when I cant always count on the pins being connected in sequential order.

    Wouldn't something like dira |= %101 with the correct mask work?

    I got confused by your subject line because you said you would like to draw as little current as possible which isn't your objective surely (how little? why?). You just want to drive led 7-segment displays. Personally I wouldn't be at all worried about sinking 75ma through the I/O port if that simplifies things. I'm guessing that these are common anode so that you could tie the anodes to +5V through a diode and take the load off the 3.3V supply. Otherwise if you really really really want to drive them with external circuitry you might just use shift registers. There's no problem in running less current through the LEDs as you probably won't notice it anyway and you can keep the chips within their maximum limits. Anyway you go you will need current limit resistors for each of the segments. There are plenty of other ways too but you might have to tell us a bit more about your setup.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-08-29 22:43
    Yer oring the pins is exactly what id hoped to do... but i dont want to introduce PASM to this project is anyway. The hole point of this is so whoever uses the driver can change the pin out of there common anode display via the constant listing. I then wanted to make more constants to draw the acuall numbers, making everything precompiled and very interchangable here is the code ive written the jist of what im trying to do is the constant name _theNumber1
    CON
    
    
    {{   These constants define the i/o pins on the propeller 
         that you want to use to drive the 7 segment display      }}
    
    
    'These constants define the prop pins to connect to the displays
    'anode pins, when the anode pin is hi the digit is on
    _anodeDigit1=0
    _anodeDigit2=1
    _anodeDigit3=3
    _anodeDigit4=4
    
    
    'These constants define the prop pins to connect to the displays
    'cathode pins, pulling the pins low will light the segment attached
    'to the cathode, as long as the coresponding anode is pulled hi
    _cathodeA=20
    _cathodeB=21
    _cathodeC=22
    _cathodeD=23
    _cathodeE=24
    _cathodeF=25
    _cathodeG=26 
    
    
    'This constant should combine the defined pins to draw a number 1 on the which ever annodes are driven hi
    _theNumber1=_cathodeB | _cathodeC 
    
    PUB Main
    repeat
      dira[_anodeDigit1]:=1
      outa[_anodeDigit1]:=1
    
    
      dira[_theNumber1]:=$FF
      dira[_theNumber1]:=$FF 
    

    The problem is im acually oring the numbers 21 and 22 toagther which isnt helping me at all just making cathode D light up becuase of the bits being chaned. I dont necisarly have to do it this exact way but is there an elgant way to combine needed pins togather in a table or constants somehow to create the correct numerals i.e 1,2,3,4,5,6,7,8,9 on the 7 segment?
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-08-29 23:11
    well theres some stuff wrong in the code above such as its should be dira then oua for the cathodes and the it should be [pinswhatever]:=_theNumber1 but those are dumb typos im tired im hopsing someone gets the jist of the overall concept im trying to convey here basically if you know a bit of C this is what i would like to set up in spin and I have no idea why i cant get my brain to work in spin correctly
    #define dig_0 (d_e    |d_d    |d_c    |d_b    |d_a    |d_f    |0)#define dig_1 (0        |0        |d_c    |d_b    |0        |0        |0)
    #define dig_2 (d_e    |d_d    |0        |d_b    |d_a    |0        |d_g)
    #define dig_3 (0        |d_d    |d_c     |d_b    |d_a    |0        |d_g)
    #define dig_4 (0        |0        |d_c    |d_b    |0        |d_f    |d_g)
    #define dig_5 (0        |d_d    |d_c    |0        |d_a    |d_f    |d_g)
    #define dig_6 (d_e    |d_d    |d_c    |0        |d_a    |d_f    |d_g)
    #define dig_7 (0        |0        |d_c    |d_b    |d_a    |0        |0)
    #define dig_8 (d_e    |d_d    |d_c    |d_b    |d_a    |d_f    |d_g)
    #define dig_9 (0        |d_d    |d_c    |d_b    |d_a    |d_f    |d_g)
    

    It was a table I set up to or the coresponding pins to draw the digits on a common anode
  • kwinnkwinn Posts: 8,697
    edited 2012-08-29 23:19
    The minimum Hfe (current gain) of the 3904 is about 60 so a current of 25/60 = 0.42mA is all that is required from the prop pins.

    The bit pattern required to generate the 0-9 digits is usually stored as an array of 10 bytes so that "digit" (where "i" is the value of the digit to display) can be used to select the byte for that digit. For example 'digit[7]' would display 7. The decimal point (if required) is usually set by using an or to add the decimal bit to the 7 segments from the array.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-08-29 23:32
    Ok im sorry last listing here this in no way works but the bottom comment should give you and idea along with my other posts and the C code above! the comment at the end of this post should give a good idea of what im looking to do even though it not how spin does things apparently
    CON
    
    
    {{   These constants define the i/o pins on the propeller 
         that you want to use to drive the 7 segment display      }}
    
    
    'These constants define the prop pins to connect to the displays
    'anode pins, when the anode pin is hi the digit is on
    _anodeDigit1=0
    _anodeDigit2=1
    _anodeDigit3=3
    _anodeDigit4=4
    
    
    'These constants define the prop pins to connect to the displays
    'cathode pins, pulling the pins low will light the segment attached
    'to the cathode, as long as the coresponding anode is pulled hi
    _cathodeA=20
    _cathodeB=21
    _cathodeC=22
    _cathodeD=23
    _cathodeE=24
    _cathodeF=25
    _cathodeG=26 
    
    
    _theNumber1=_cathodeB | _cathodeC 
    PUB Main
    
    
    repeat
    
    
      dira[_anodeDigit1.._anodeDigit4]:=$FFFF
      outa[_anodeDigit1.._anodeDigit4]:=$FFFF
    
    
      dira[_cathodeA.._cathodeG]:=$FFFF
      outa[_cathodeA.._cathodeG]:=!_theNumber1
    
    
    {{ I WOULD LIKE SOMETHING LIKE THIS!!
    
    
    repeat
    
    
      dira[_anodeDigit1| _anodeDigit2 | _anodeDigit3 | _anodeDigit4]:=$FFFF
      outa[_anodeDigit1| _anodeDigit2 | _anodeDigit3 | _anodeDigit4]:=$FFFF
    
    
      dira[_cathodeA | all othe cathodes ored here | _cathodeG]:=$FFFF
      outa[_cathodeA | all othe cathodes ored here | _cathodeG]:=!_theNumber1 'the not pulls cathodes low correct?
    
    
    }}
    

    Ok @kwinn see im confused one of my meter is telling me its a .20mA draw and another sett to the 200mA setting is saying is a 25mA draw... so idk whatever current the prop is nfeeding is damn bright for real the data sheet says total of 25mA continous current per segment.. which to me acually each of the seven segments is 25mA, thats no way so ive been assuming each annode draws 25mA continous 60mA max. But the fact my better meter is saying its only drawing .25amps is more in line with the bjt being able to power the anodes. Could you give me a schematic real quick to test out how bright it is with the bjt?? Or just tell me where b/e/c hooks too I have an extra that ive burnt throwing 500ma at one segment so i can play with that one and not worry!!

    Also are you suggecting I sort this out using arrays instead of constants? If i have to I will but i was looking for the most optimal code I could possibly write, im working under the assumption constants are better since they can be staticaly compiled and memmory can be calculated! I basically just want the user to be able to change any pin value and connection to the display and the driver work no problems becuase the acuall code drawing things doesnt assume anything is in sequential order or hard code any pin numbers in only constant or yuck var/array names.
  • cavelambcavelamb Posts: 720
    edited 2012-08-30 09:49
    Turn to page 106 in our hymnal...


    Normally DIRA is only written to but it can also be read from to retrieve the current I/O pin directions.
    The following assumes Temp is a variable created elsewhere:

    Temp := DIRA[7..4] 'Get direction of P7 through P4

    The above sets Temp equal to DIRA bits 7, 6, 5, and 4; i.e., the lower 4 bits of Temp are now equal
    to DIRA7:4 and the other bits of Temp are cleared to zero.
  • groggorygroggory Posts: 205
    edited 2012-08-30 11:09
    This shift register would do the trick

    TPIC6B595

    ...

    But a bunch of NPN transistors, some base resistors, a bunch of LED current limiting resistors would also work.

    ....

    Awhile back I made a circuit to control a bunch of high power 7 segment LED displays. I based it around the Allegro A6279. However, that product has been discontinued.
  • RS_JimRS_Jim Posts: 1,764
    edited 2012-08-30 12:32
    have you thought of scanning the leds so that only one is powered at a time? If you make your scan rate over 60 Hz, Then persistance of vision will intigrate the image and it will appear as though they are all on at once. Then you never draw any more current than one seven seg display at a time.
    Jim
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-08-30 19:41
    It sounds like you are connecting these LEDs directly to the I/O without using current limit resistors. LEDs are diodes, so unlike incandescent bulbs which present a resistive load, the LEDs however appear as a short-circuit albeit with a voltage drop. Without current limit resistors the current is only limited by the voltage and the source "resistance" but this can vary greatly. You must use resistors to control the current. But once again as I mentioned that there are also other ways of doing this it just depends on what you are trying to do, so we need an overall view of the project, not of the LEDs. If you had plenty of I/O to spare for instance and just wanted to drive three 7-segment LEDs then maybe direct drive is the best way for instance. If they need to be daylight viewable or the displays are large then something more would be needed.
  • SarielSariel Posts: 182
    edited 2012-08-31 04:53
    groggory says..
    TPIC6B595

    And I would have to agree. I have used the TPIC6595 extensively, and not only do they work with any 74HC595 code you find in the obex, but they just flat out work. From the TI Data sheet...
    Outputs are low-side, open-drain DMOS transistors with output ratings of 45 V and 250-mA continuous sink current capability.

    So that is a bit beefier than you are requesting so you should have no problems, even without any heat sinks as was suggested with the standard 74HC595's, and the difference between a TPIC6B595 and a TPIC6595 is about 100mA of current.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-08-31 05:21
    Well guys, I've used TPICs and they are good but I sense that this is all overkill and as always we have very little real information or pertinent feedback. Direct drive may be all that the OP needs but I dug around in my junk box and I came across an industrial grade bargraph meter prototype I did a few years ago. It's dual channel and uses 32 LEDs per channel and is designed to be easily viewed in daylight, I mean outback Australian daylight. Guess what I use to drive the LEDs? No, not 74HC595s but their cheaper cousin, the 74HC164s. I've got a 5V supply with 270R resistor per LED with 8 LEDs per 74HC164. These have been in production for years and just perform. Tell me it's no good and you know what? It doesn't matter because the proof is here:

    It was easier to take a side view of the LEDs against my laptop for reference as they are rather bright face on.
    bargraph.jpg
    .
    639 x 492 - 55K
  • RDL2004RDL2004 Posts: 2,554
    edited 2012-08-31 11:14
    one of my meter is telling me its a .20mA draw and another sett to the 200mA setting is saying is a 25mA draw...

    This may be due to the difference between the "Burden Voltage" of the two meters. To measure current the meter inserts an internal series resistor and measures the voltage drop across it. This voltage drop can be significant at lower voltages. I'd be surprised if any normal LED would put out a visible amount of light at only 0.2 mA of current.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-08-31 14:09
    Hmmm sorry if I havent been specific enough about what I am trying to do let me see if I can get it all sorted out...

    #1 this is basically a learning project, I figured a quad seven segement would be a good piece of hardware to write a driver for and learn spin its fairly simple. I would like to write the driver with the prop directly controlling the display and when I have that nailed down I plan to add an option to use a 7Nhc595 or two. Basically I want a genric driver that can drive the display with direct connection to the prop. Its not a complicated driver its only purpose is to display a number or hex letter in one of the 4 diffrent display segments.

    #2 I want this driver to have a PWM to control brightness, I dont know much about PWMs this is a learning project. The PWM is why I want a current boost though.. I would like to the display to be as bright as possible, that way the PWM dimming stuff can go from nothing to lit as much as possible. Directly connecting to the prop drives the display pretty bright (ive red yellow and red leds are fine to dirrect connect without a current resistor) As soon as I add resistors used 50 and 100ohm the display isnt even close to as bright anymore!

    When im using resistors though the current drawn from the prop is obviously alot lower than 20mA more like 8 or less per digit on display. I figured it may be simple and effiecent to connect some of these bjts i have laying around between the anodes of the display and the prop, this way i could drive the bjt with a very low current and then the display can be as bright as a direct connection or brighter. The problem is IDK alot about transistors (especially when used for current gain) I was hoping someone could give me a quick idea how to do this. The reason I want to use transistors is i feel like 4 transistors is alot easier to obtain and simpler to understand than other methods, i mean i could use a voltage regulator and resistors if i wanted but thats rediclous, transistors seem simple and elegant for a beginner... am i wrong?

    As far as the shift registers go I will implement them in tim to cut down on pins and source current if need be, but it will be an option in the driver to use a shift register since using one will take away from the simplicity of the code used to directly drive the lcd and learn how it functions.
  • kwinnkwinn Posts: 8,697
    edited 2012-08-31 18:05
    When I built 7 segment display boards using transistors (which I no longer do) they used the attached circuits. Typically they were multiplexed so there were 8 segment drivers and one digit driver for each digit in the display. Putting the current limiting resistor on the emitter of the segment drive transistor had the advantage of providing a constant current source for the segment led. This allowed the display to use an unregulated voltage without having the intensity vary, and reduced the power dissipation of the regulators.

    For your 4 digit display you would need 12 I/O pins to use this circuit.

    If you do not want to multiplex the digits then you would be better off using a TPIC6595 as others suggested.
    1016 x 537 - 47K
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-08-31 18:58
    Ok so im already using 12 i/o pins thats not an issue at the moment. Your telling me i would need 2 transistors between the prop and each of the 4 anodes, then two transistors between A-G Cathode to the ground? for a total of 22 transistors not including the DP, Anode and its 3 or 4 cathodes!!!

    I was thinking it would go like this somehow. Prop pin out puts the current needed by the transistor the transistor is then connected to a current limiting resistor connected to the anode, for a total of 4 transistors and 4 resistors! As of now with direct attachment to the prop i only need a resistor between the prop pins and the anodes to adjust the current, i was thinking the same could be done to amplify the current with transistors is this totally not how things work??
  • kwinnkwinn Posts: 8,697
    edited 2012-09-01 00:51
    No, you need 8 NPN transistors (or 1 ULN2803) to drive the 7 segments and the decimal point. The alternative is to drive the segments directly from the prop pins. With high efficiency/brightness leds 30mA should be enough to multiplex 4 digits and provide a bright display. For the digit drivers you need 4 NPN and 4 PNP transistors as shown in the diagram. The digit driver has to be able to provide the current for all 7 segments and the decimal point ( 8 x 30 = 240mA ). A 2n3904 or 2n2222 would be fine for the NPN transistor. Something like the MPSA92 would work for the PNP.

    I would suggest using 2 TPIC6595's ( or a '595 and a TPIC ) instead of individual transistors. A TPIC is similar to a '595 and ULN2803 in a single chip.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-01 01:20
    unfourtantely i dont have time for a proper post right now idk if some of u guys are just not getting it i dont want to multiplex anything just increase brightness...

    anyways i read the bjt3904 datasheet and was very confused about some stuff that ill need help with but my basic idea works apparently... i will get a schematic up tommorow.. along with a few details and questions but i managed to connect a bjt to a 5v wal wart and and amplify an led greatilt. the transistors base is drawing 1.7mA and the led is connected to the e/c and depending on led used its drawing 90 to 130mA of current... of course the led cant sustain that for to long but the transistors not heating up what so ever. all i need to do is figure out how well this will work at 3.3v with the 7 segment and connect the base to the prop and the c/e to the 5 common anodes thats only 5 transistors one for each 7 segment partion plus colons..

    idk maybe im doing something frowned on becuase no one has said this was possible and ur all alot smarter than me this is the first time ive used a transistor ever.. just need a current limiter on anodes and i should be fine
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-01 01:29
    like i said through my exparmentation the anodes are where the currennt needs to be fed.. the data sheet says 25mA forward per segment and 60mA peak which confuses me but the anodes draw 18 mA from the prop directly; with a suggested 100ohm resistor on annodes they only draw 7 mA and way dimmer.. Sooo im assuming 100mA is on annodes only is gonna burn it out but i can calculate the current resistor to 25mA
  • kwinnkwinn Posts: 8,697
    edited 2012-09-01 02:05
    If you don't want to multiplex anything you will need to drive each segment and decimal point individually. That will require 4 x 8 = 32 pins from the prop if you drive them directly or use an NPN transistor. The practical alternatives are to use either 4 TPIC6595's, 4 '595's and 4 ULN2803's, 4 "595's and 32 NPN transistors, or 4 '47 bcd to decimal decoder chips. I use the TPICs and would recommend them.
  • frank freedmanfrank freedman Posts: 1,983
    edited 2012-09-01 02:49
    Unless your dead set against multiplexing, you could use a 74xx47/48 (4 pins) and appropriate transistor for each digit (4 transistors) for the display, and use the scan speed or on time / off time ratio to determine the brightness. Even better, instead of transistors, use 74xx139 dual quad decoder (2 pins) now net 6 pins, no drive problems. Be sure to use the right combination of 7seg decoder and display.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-01 03:22
    lol i am dead set againt multiplexing in a way... i want the driver to work with a direct prop connection.

    as i said i wil add support for shift registers when i learn to use them. this is all so i can learn to write a 7 segment and write a driver with simple cheap parts.

    i have two 74hc595s after the driver and pwm works correctly i will implement them also. i just dont understand them nor care too atm im learning in steps and writing tutorials for other who are intrested in learning this stuff. if u always follow gadget gangsters tutorials telling u to u this or that obex object you will never learn to write code for new chips.. this is just baby steps twords being able to write stuff like sram code. after i have learned spin im also going to do the drivers in C which will be easy for me and pasm which wont. the biggest reason to use transistors here is to get the current draw off the prop down eating 1/3 of it is not good and niether is direct connection of leds its just ugly and infeccient. i dont mind using 12 io lines if im say building an alarm clock it is no problem. but i understand the need for multiplexing and thats why i will implemnt it when the driver is done in the simplest form powered by hardware that does things in an efficent way.

    i figure most starters wont mind a 3 dollar display and 4 npns with some resistors its lowest common denominator and if for some reason they need almost all the props current for other things the display isnt eating a whopin 3rd of the total source sync current. i was gonna use an opamp originally but that seemed over board. although i do have some concerns about the bjts i will lay out tommotow along with a schematic.
  • kwinnkwinn Posts: 8,697
    edited 2012-09-01 13:29
    lol i am dead set againt multiplexing in a way... i want the driver to work with a direct prop connection.

    as i said i wil add support for shift registers when i learn to use them. this is all so i can learn to write a 7 segment and write a driver with simple cheap parts.

    i have two 74hc595s after the driver and pwm works correctly i will implement them also. i just dont understand them nor care too atm im learning in steps and writing tutorials for other who are intrested in learning this stuff....... .

    OK, now I understand what you are trying to do a little better. For this you do not need the 74hc595's. To drive the 7 segments directly you will need to use 8 prop pins for each digit. The number of pins required will be the same whether you use transistors between the prop pins and the segments or drive them directly through a current limiting resistor.

    If you drive 4 digits directly from the propeller you will need to use all 32 I/O pins, including those normally used for booting the propeller. While it is possible to use these pins to boot up initially and then switch them to driving the led segments it is not simple to do so. Using pins for multiple functions is a more advanced topic.

    Since this is for learning may I suggest using only 3 digits. That way you can use P0 - P23 to drive the digits and leave P28 - P31 free for booting from the PC or eeprom. The 3 digits are adequate for a tutorial on how to drive 7 segment displays and writing programs for converting and displaying binary, ascii, octal, and hex numbers.

    After this you can point out the advantages and disadvantages of directly driving the display and go on to using shift registers and multiplexing.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-01 15:48
    lol u almost hit it on the head. im using a 4 digit 7 segment common anode so theres only 14 pins including dots and colons. i would not even attempt to direct connect 4 different 7 segments.

    i realized today ive been playing with the thing but idk how to make the 4 displays display different things.. the way ive been thinking about coding this can turn on and off digits 1 through 4 but only display the same digit on each display since im not sure i tell the thing pull only these cathodes to ground on digit 1 and these other different cathodes on digit 2.

    if it helps ne im using a display like this one in this avr project

    http://www.ikalogic.com/build-your-40-mhz-frequency-meter/
  • kwinnkwinn Posts: 8,697
    edited 2012-09-01 17:25
    Posting that link makes it very clear. In future you should try to post as much information as you can about your project. Knowing what parts you plan to use helps a great deal.

    Those displays are designed to be multiplexed and will need 12 prop pins. They can be driven directly by the prop but if you want to get maximum brightness from them you may need 4 PNP transistors for the anodes. If you have the part number and manufacturer info I can look up the data sheet and tell you if adding the transistors is necessary.

    To display individual digits you will have to make all the anode pins (E1-E4) low, output lows on the pins for all the segments you want lit and for the dp if it is to be lit.
    Now you make the anode pin of the digit you want to display high (this is typically called the "digit select" signal. This will light all the segments you set low on the selected digit .
    Repeat the above for each digit.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-01 18:50
    kwinn, im doing some experementing right now i will get back with all the details u asked for along with a few questions but id like to narrow them down and see what i can learn for myself first that way my questions are a little more specific, i guess due to not being specific enough this thread has turned into two pages of almost irreavent info.

    im assuming everyone kept going on about shift registers and multiplexing becuase they thought i was using 4 seperate 7 segment displays. is this not a quad 7 segment? i would just like to know why everyone was so confused about what i was using so i can avoid it in the future when talking about these displays.

    secondly as i said this is the first time ive used a transistor that im trying to design into something.. usually i just use chips so im having to learn about a big hole in my knowlege. im currently using NPN3904s cuz they were handy and the info i read was about NPN2222s in my book. so basically i just took the 3904 data sheet and combined that with my book learnin. So far it seems to be getting the job done with a blue led and a 5v src i stepped down to 3.3v with a divider. Why would you reccomend PNPs? i also have 3906 pnps on hand just dont know how they fit this application better.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-09-01 20:05
    kwinn, im doing some experementing right now i will get back with all the details u asked for along with a few questions but id like to narrow them down and see what i can learn for myself first that way my questions are a little more specific, i guess due to not being specific enough this thread has turned into two pages of almost irreavent info.

    im assuming everyone kept going on about shift registers and multiplexing becuase they thought i was using 4 seperate 7 segment displays. is this not a quad 7 segment? i would just like to know why everyone was so confused about what i was using so i can avoid it in the future when talking about these displays.

    secondly as i said this is the first time ive used a transistor that im trying to design into something.. usually i just use chips so im having to learn about a big hole in my knowlege. im currently using NPN3904s cuz they were handy and the info i read was about NPN2222s in my book. so basically i just took the 3904 data sheet and combined that with my book learnin. So far it seems to be getting the job done with a blue led and a 5v src i stepped down to 3.3v with a divider. Why would you reccomend PNPs? i also have 3906 pnps on hand just dont know how they fit this application better.
    Confusion is best cleared up with some hard information such as part numbers or links or photos or drawings. If we rely on your own terminology we are bound to be in a state of confusion. So come on.

    Anyway I would recommend that you just play with these using direct drive for the moment with 8 I/O driving 8 common segments through resistors (yes) and then use four PNP transistors with base resistors to power the anodes of each digit. The idea is to only power up one digit at a time and output the segments for it from a buffer (byte of a long), wait a few milliseconds, then blank the segments before switching over to the next digit then present it's segment information etc. You could use a ULN2803 to drive the segments (through resistors) if you want it really bright.

    EDIT: Here's a possible schematic without using shift registers and the ULN2803 is optional.
    7segment display.jpg
    1024 x 530 - 104K
Sign In or Register to comment.