A few novice questions

I've a decent enough knowledge of electronics but I'm not very big up on what's being used today in embedded systems.

For instance, in my college course, we use chips in the "74HCT" family and we use transistors such as BC337 and TIP121 as switches.

I've been asking around and it seems that developers nowadays are using different chips and transistors to the ones I know about. I know about MOS transistors, but I've never used one.

When working with the PIC16F684 microcontroller, I'd like to ask:

1) What kinds of chips I should use with it, e.g. 74HCT family, or 4000 family, etc. ?

2) What transistors should I use a switches when I want to pass as much as an ampere of current?

Also, very quickly without getting into too deep a discussion, I'd like to ask what microcontrollers I should be using? We've used the PIC16F684 so far in my college course, but we also learned about the

8051 last year. What's the most popular microcontroller used for simple things like lighting LED's and taking push button input?
Reply to
Tomás Ó hÉilidhe
Loading thread data ...

Based on your last thread, I still cannot work out if you are real or a troll. I'm answering this seriously.

Developers are using whatever their designs and cost budgets call for. Bipolar transistors are slightly cheaper than FETs (at least, the ones we buy in millions per month). If you just need to switch on a high- current LED from a low-current GPIO, there is no compelling reason not to use a PN2222, BC547 or similar bipolar transistor. If there was no longer a use for these parts, they would no longer be manufactured.

Selecting an external logic family depends on your circuit's Vcc, the I/O level (CMOS, TTL, etc), the switching speed, the power consumption etc. Many (I would guess most but I'm not sure about that) embedded systems use no external discrete logic at all.

Depends a great deal. Is it AC or DC you're switching? What voltage? Inductive or a resistive load? Would a relay be a better choice? How much isolation do you need? Do you need to reverse the voltage?

For learning, you should be using something simple to use, with a modern, clean architecture. I would recommend MSP430, AVR or ARM. Eval hardware for the first two can be obtained for under $20; for the second, under $40.

Neither PIC nor 8051 qualify as easy learning micros. However they can be the right part for a real project.

Reply to
larwe

I've been googling looking for a chip that converges the following:

1) A decimal counter that counts from 0 to 9 and then wraps back around 2) A binary-coded-decimal to seven segment display decoder

I found the following device:

4026:
formatting link

I'm still learning about the different kinds of chip, eg. 74HCT verus

4000, but can anyone tell me if there's any reason why I wouldn't be able to use this chip in conjunction with the PIC16F684 microcontroller?

I've been looking for a more "modern" implementation of the chip but I can't find anything -- the closest I've gotten is two separate chips, one that counts and one that outputs the segment values.

Reply to
Tomás Ó hÉilidhe

I figured they'd still be in production regardless of their use in embedded systems because they're still used for analogue electronics applications (e.g. a guitar amplifier).

One of my lecturers told me today that 74HCT hasn't been used for about the last 10 years, and that the 4000 family hasn't been used since maybe the 60's.

So now I'm wondering what family of logic chips are actually being used *today* in conjunction with today's microcontrollers, e.g. the PIC16F684?

OK here's an example:

I have 26 LED's. Instead of them all being on at the same time, I'm going to light each of them for 100 microseconds and then move onto the next one (i.e. display multiplexing).

The LED's I'm using have a maximum current rating of 25 mA, but since they'll only be on for one twenty-sixth of the time, I'm going to put about half an ampere thru them. To achieve this, I'm not even going to use a resistor, I'm just gonna go straight from Vcc to LED to ground. (I've tested this in my project this year and it works perfectly).

Now my microcontroller pin won't be able to supply half an ampere, so I'll use the microcontroller pin to turn on a transistor which will allow the half ampere to flow from Vcc to the LED to ground.

So my question is, what's the best transistor to use? The supply voltage is 5 V and it's powering an LED.

To be honest I'm finding the PIC16F684 quite handy to work with; its instruction set is really easy to learn and understand, plus the PICKIT is great for hooking up to my laptop.

Reply to
Tomás Ó hÉilidhe

Hi!

Please don't source half an ampere of current into an LED unless the spec allows that and you really need it. You may get 80% of the same brightness for a much lower current.

This saves energie and the innocent souls of LED's as well.

For bjt-transistors in switching-applications: Most often any transistor will do unless you exceed the ratings. Pick the cheapest one you can find. My personal favorite is the good old 2n3904/2n3906 pair. It can switch a good current, and it does a good linear amplification job as well.

Pick the cheapest transistor that meets your specification. If it turns out that an RF-type is cheapest give it a try. These aren't built for switching but they might do a good job at it as well.

BJT's aren't rocket science.

Nils

Reply to
Nils

This is the second post in a week that wants to drive LEDs without a current-limiting resistor. Is there something in the water that's making people think like this? :-)

Regarding the transistor, just pick a cheap one that will take the desired current and circuit voltage without stress - having a current rating e.g. 50% or more higher than the current it will be switching, same with the voltage rating. For example, the 2N2222 and plastic versions are rated to 800mA.

Now, about those LEDs. Don't do it. In the first place, LEDs have a maximum pulse rating as well as a continuous rating. For example, I just looked one up that has a 30mA continuous rating, and a 160mA peak pulse rating. That is to say, you can't just do the multiplexing thing ad infinitum at the equivalent brightness of the continuous rating. And while I've got your attention ;-) please, use resistors to limit your LED current in a controlled way. In every circuit, _something_ is limiting the current. Without resistors in your case it can be the LED, the transistor, power supply voltage sag, or any combination. You certainly won't have control over any of those factors, and you are just as certainly stressing one or more of those components, and they will start failing, probably right after your devices are installed in Siberia or the Sahara. Add a resistor, let Ohm's Law be your friend.

Mike

Reply to
Mike Silva

That seems a rather odd assertion.

If I had to use a PIC of any sort and I needed an external logic source my first choice would be an HCT device. Most of the faster types (at least as far as I've seen) appear to be limited to commercial temperature range. Besides why would you need faster to interface with a PIC?

Robert

** Posted from
formatting link
**
Reply to
Robert Adsett

Perhaps that's why he's a lecturer and not an engineer. I have a CD4040 binary counter in a current design. It divides a sensor clock by 64 so my frequency counter interrupts have a more reasonable rate. CMOS 4000 family logic is still available at distributors like DigiKey. For applications under 10Mhz, it works just fine.

I tend to pick first from the 74LCX family. It has the advantage of having inputs that are compatible with 5V logic while running from a 3.3V supply.

How do you know it will only be 0.5 Ampere? With a good supply and a very low resistance switching transistor, the peak current may go well above 0.5A for the brief time it takes for the LED to burn out. SOMETHING has to limit the current---whether it is the supply or the switch. With a low-resistance switch, you probably don't want to use the same current-limited supply that is=20 running your microcontroller.

Mark Borgerson =20

Reply to
Mark Borgerson

the cheapest and slowest that will do the job. It's that simple. If a 4xxx gate or multiplexer is fast enough for the current design, then it's a perfect match. Using faster 74HC devices would gain nothing.

Wrong solution. Get the LEDs' data sheet and look for the maximum ratings. I'll guess 1:4 or 1:8 multiplexing would be ok, but not more.

And the easiest way would be using 74HC595 shift registers. Four of them in a chain would do the job. No extra transistors, just current limiting resistors for each output, and you are done with three mcu port pins (data, shift clock, latch clock).

Mit freundlichen Grüßen

Frank-Christian Krügel

Reply to
Frank-Christian Kruegel

n
,

This is how I did it in my college project this year, i.e. I used a shift register. I used two 74HCT164's strung together so they behaved as a single 16-Bit shift register.

I only needed one sole microcontroller pin though because I had an RC circuit attached to the data input which gave me the initial 1 that I needed, and then I tied the last output back to the first input so that the 1 moved around in an eternal loop.

(I had OR-gate at the data input, one input being the RC and the other input coming from the last output pin)

It worked perfectly but I had to get the timing perfect with the RC circuit and also with my programming code, which was a bit frustrating because I couldn't find out how long it takes for the PIC16F684 to boot up and actually execute its first instruction.

Reply to
Tomás Ó hÉilidhe

You could, but its usually cheaper to use the processor to do the simple logic, such as counting and BCD decoding.

--
Thad
Reply to
Thad Smith

Currently my project does it in software and uses 7 pins to drive the seven segments. It works fine but I want to free up more pins, so I'm thinking of using one sole pin to drive a 4026 chip.

Reply to
Tomás Ó hÉilidhe

...considering the 4000 family was introduced in the 70's.

Reply to
Dombo

Picky, picky, picky..... :)

What do you figure the odds are that the instructor is no older than the

4000 series?

Robert

** Posted from
formatting link
**
Reply to
Robert Adsett

Considering I'm about the same age as the 4000 series, I guess the odds are pretty high.

Reply to
Dombo
[edit]
74HCT with the "T" was specialized for bridging 74xx outputs to CMOS inputs. One would not tend to design core logic with 74HCT, but rather 74HC.

Where 74HCT is indispensible in my field (customtest equipment, lab instruments) is for logic level inputs from the outside world. I mean from generic sources (usually via a BNC connector) rather than some standardized physical link layer.

For this purpose, the 74HCT provides a "TTL standard" input switching threshold region. This makes it work for signals that are terminated and thus swing only to about 2.5V, as well as signals that are unterminated and swing further. Using 74HC for such inputs puts the switching threshold too high, leading to trouble with terminated cables.

74HCT also makes a natural level converter for 3.3V logic typical of PLDs and some of my uCs to the 5V levels that I wish to send to the outside world. For that, 2-3 paralleled 74HCT04 gates makes a fine 50 ohm cable driver.

That said, there is nothing fundamentally wrong with 74HC or 4000 series logic for use in glue circuits around uCs. However, I think now 74C series might have replaced 4000?

The biggest problem is that these are becoming obsolete, except for the simplest gates and a bunch of bus interfacing type functional blocks.

Generally if I need actual hardware logic for other than input/output buffering, if there is even the remotest possibility of needing to change it later, I use a CPLD. Otherwise 74HC/74AHC is suitable. I don't do any esoteric ECL stuff.

--
Good day!

____________________________________
CRC
crobcREMOVETHIS@BOGUSsbcglobal.net
NOTE, delete texts: "REMOVETHIS" and
"BOGUS" from email address to reply.
Reply to
Chris Carlen

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.