How comes a monostable 555 being more expensive than a 8-pin microcontroller? - Page 1
Forum section: electronics / general

author: technix
author_rank: Super Contributor
timestamp: August 01, 2018, 03:14:54 pm
content: I am researching the options for a monostable latch, with a delay of a few seconds to a minute. The circuit in question is restricted to through hole components only. I do understand that the usual, cheaper option would be a 555 timer, but the odd thing I found out is that the lone timing capacitor for the 555 can be more expensive than some 8-pin microcontrollers like PIC12F683-I/P or IAP15W105-35I-DIP8, and those microcontrollers are still on the higher end. Now when did capacitors got so expensive, and when did microcontrollers got so cheap?

author: schmitt trigger
author_rank: Super Contributor
timestamp: August 01, 2018, 03:31:07 pm
content: For the timing capacitor, I assume that you are talking about a film capacitor. I know that several factories which produced capacitor-grade specialty films have been shutting down, leaving the remaining facilities with the ability to increase the price of the raw material. There was an excellent discussion in another blog which I cannot longer find.For the second one, you have to thanks (or blame) Moore's law. Silicon chips have literally become dirt cheap.

author: technix
author_rank: Super Contributor
timestamp: August 01, 2018, 03:41:51 pm
content: Quote from: schmitt trigger on August 01, 2018, 03:31:07 pmAnd along with it brought down the prices of the processor IPs?The use case required a chain of audio envelope detector - analog comparator - monostable latch (similar to an audio noise gate.) It has occurred to me that if I don't mind a few additional milliamps I can build the entire chain inside that PIC12F683, using the ADC to convert the audio into samples and convert the whole chain into a DSP program. Or if I mind the power draw everything after the analog envelope detector can be absorbed into the PIC (and it stays in sleep mode until the built in analog comparator flipped and triggers an interrupt.)

author: Syntax_Error
author_rank: Regular Contributor
timestamp: August 01, 2018, 03:46:42 pm
content: I've actually been intrigued by this idea for awhile now: replacing common digital building block chips with low cost micros. I read or watched somewhere (can't remember) detailing the practice of using memory chips like EEPROM as surrogates for various combinational logic such as gates etc including custom functions. It seemed obvious once I saw it, but I hadn't thought of it before.I know that this is essentially no different than any other form of integration or programmable logic, I had just never considered the specific application of replacing a variety of common logic chips with one or two common-to-all-designs chips (a micro and/or a memory) properly coded. I really like this idea in relation to stocking things to have on hand.

author: Bud
author_rank: Super Contributor
timestamp: August 01, 2018, 03:52:12 pm
content: you need to develop code for them, program them and you need to clock them.

author: Syntax_Error
author_rank: Regular Contributor
timestamp: August 01, 2018, 03:53:49 pm
content: Yes, true. Pros and cons to everything. And also for many simple applications the internal oscillator will work well enough.

author: tszaboo
author_rank: Super Contributor
timestamp: August 01, 2018, 03:57:42 pm
content: Quote from: Bud on August 01, 2018, 03:52:12 pmYes.

author: technix
author_rank: Super Contributor
timestamp: August 01, 2018, 04:04:40 pm
content: Quote from: Syntax_Error on August 01, 2018, 03:53:49 pmMy purpose here is simple enough for internal oscillators.Quote from: Bud on August 01, 2018, 03:52:12 pmDevelop the code: should be simple enough if I used a hardware envelope detector. The comparator and the monostable are both built-in peripheral, only some initialization and glue code needed.Program them: through hole only = DIP chips = socketed chips. Easy enough, not even the ICSP header is needed.Clock them: internal clock works fine for this.

author: calexanian
author_rank: Super Contributor
timestamp: August 01, 2018, 08:41:23 pm
content: 555 wan not really made for stable longer timing applications. Variations in the RC circuit will catch up with you particularly with large electrolytic capacitors and high value resistors feeding them. The EX2242 was the preferred solution. It allowed you to use lower value higher stability caps and resistors and included a counter to allow much longer timing at greater stability. I would imagine the 2242 is now considered obsolete. Most modern applications of the 555 do not require a high degree of accuracy and probably have small value components for fast timing so high spec caps and resistors cost very little. a .1uf 16 volt XR7 cap costs a fraction the amount of a 470 uf low leakage timing capacitor. They used to have a special category for timing capacitors back in the day. We used them in our sprinkler timer products. In a tiny micro nowadays you have everything internal and require no external components. for timing and the internal RC oscillator is just as, if not more stable then whatever you could use in the 555 circuit. For cheap things like signal sources for stepping motors where you may have say a .1 us or 1 uf cap and a cheap pot for time control, a sub 10 cent 555 (Just looked at current mouser pricing. 2500+ are sup 10 cents) you would be fine. If you need something accurate, go with a micro.

author: thm_w
author_rank: Super Contributor
timestamp: August 01, 2018, 09:32:50 pm
content: The cheap relay timer I bought from china is using a CD4541B. 20c on digikey compared to $1.70 for the PIC in large quantities.Plus the cost of the timing capacitor of course, but you didn't state which part/tolerance you require for your circuit.http://www.ti.com/lit/ds/symlink/cd4541b.pdf

author: JPortici
author_rank: Super Contributor
timestamp: August 01, 2018, 10:11:43 pm
content: i have transitioned from "let's do it with chips because i don't know better" to "let's do it with MCUs because it's more straightforward and i have more flexibility" to "let's do it with chips again so i don't have to program them and i won't be bothered for the firmware in X years"again, pros and cons with everything

author: EEVblog
author_rank: Unknown
timestamp: August 01, 2018, 10:33:29 pm
content: Quote from: Syntax_Error on August 01, 2018, 03:53:49 pmThen the problem is that the internal oscillator usually isn't quick (4MHz for example) and that limits the speed of the substitute "logic". Even the fastest micros wouldn't be able to match the most simple 74HC logic.

author: Howardlong
author_rank: Super Contributor
timestamp: August 01, 2018, 10:54:48 pm
content: Now I’d do it with a PIC because I have the current knowledge, skills and tools set up to do it that way. On solderless breadboard, I can do a blinky in under 10 minutes including programming from scratch.From about 15 to 40 years ago I would’ve used a 555. In the mid 70s I knew the pinouts, schematics, rule of thumb values and equations off the top of my head. I could’ve breadboarded a 555 in a similar time. Unfortunately, I don't have quite the photographic memory I once had for the 555!(I replenished my 555 stock about fifteen years ago, but I really don’t think I’ve ever using any of them).

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 01, 2018, 11:13:20 pm
content: I don't use low end PICs very much, but the mid to high end ones are capable of clocking up to pretty much their rated operating frequency using the internal oscillator.

author: Ian.M
author_rank: Super Contributor
timestamp: August 02, 2018, 12:33:03 am
content: Then there's Microchip's CLC (configurable logic cell), which can handle just about any four input, single output logic function in under 25ns. There are 8 and 14 pin PICs with four CLCs, and other goodies like a NCO, a 16 bit gated timer, an 8 bit timer that supports various monostable modes and the CWG which can generate complementary outputs with deadtime to prevent H-bridge shoot-through, all in a $0.70 chip. Once your code sets up the required logic functions it can just spin in an idle loop, leaving the hardware to handle the logic, or it could be reading the ADC and updating timer limits to let you control its timing with a pot or two.e.g PIC16F15313 (8 pin) or PIC16F15323 (14 pin)The only disadvantages compared to dedicated logic, are the price, the limited number of inputs and the limited number of logic cells, which mean you cant implement functions with more than a 4 bit data path or more than 4 data inputs, and the setup time from power-up or reset to when your code has finished configuring the logic.

author: Howardlong
author_rank: Super Contributor
timestamp: August 02, 2018, 08:28:20 am
content: Quote from: Ian.M on August 02, 2018, 12:33:03 amPeripherals like these are precisely what keeps me using the 8 bit devices.Some other peripherals I've used recently include the PID peripheral (aka "math accelerator") in some PIC16F161x devices for use in a roll-your-own SMPS, and the zero crossing detector in, of all things, an RFID reader. I have a handy handheld device that uses a filtered harmonic of the NCO as a weak VHF signal source.A couple of weeks ago I needed a 12.288MHz source, and a way to multiplex two tri-statable SPI streams without contention. As jitter and accuracy weren't paramount, I used an 8 pin PIC16F18313 with its NCO for the 12.288MHz source, and the CWG with CLC to do the non-overlapping tri-state controller. Once the peripherals were initialised, the core itself just sat in a loop doing nothing. So, in some scenarios, you can reduce parts count too.

author: KL27x
author_rank: Super Contributor
timestamp: August 02, 2018, 08:50:41 am
content: QuoteI never got far with logic chips and the like by the time I decided it would be better to learn to use a microcontroller, even at least learning basic code and making it do simple logic stuff (albeit higher latency).I figured it would save me from having to stock tons of different logic chips and counters and the like. And from having to relearn the datasheet for each chip every time I used it. But it just ends up being traded for different problems. Now I have dozens of obsolete micros from past projects, which I can't be bothered to use, anymore. And instead of having professional datasheets in 5 seconds of googling, I have to dig through my own archives to find poorly documented spaghetti code.

author: David Hess
author_rank: Super Contributor
timestamp: August 02, 2018, 05:57:29 pm
content: Quote from: Syntax_Error on August 01, 2018, 03:46:42 pmBefore programmable logic became available, ROMs, PROMs, and EPROMs were sometimes used to do exactly this. A 4k x 8 asynchronous memory produces any 8 outputs from any 12 inputs.As far as the original question, packaged IC costs depend on silicon area, pin count, and testing time. Analog ICs are limited to larger process geometries so they do not benefit from increasing integration. Microcontrollers do benefit from increasing integration so their performance for a given cost increases followed Moore's Law although for them that ended more than 10 years ago because increasing integration is limited by the need to support floating gate memory like EEPROM and NOR Flash. Unlike microprocessors and logic, microcontrollers cannot be produced on the most advanced dense processes. Still, that was enough for the smallest PICs and AVRs to get down to "jelly bean" prices.

author: boB
author_rank: Frequent Contributor
timestamp: August 02, 2018, 06:24:30 pm
content: Could also use something like a Silego (owned by Dialog Semi now) Greenpak device. They're about 40 cents each but have a pretty fast internal oscillator of around 20 MHz maximum and also plenty of FPGA like logic and some other programmable goodies. They come from the factory programmed for that price too, I believe.We are using those for a new project that needed some glue logic. We're not using the internal oscillator though. We do actually use a 555 in one of our product PCBs.I don't know what 555s cost these days. Thought they were like 10 cents in quantities ?boB

author: AndyC_772
author_rank: Super Contributor
timestamp: August 02, 2018, 06:53:58 pm
content: I did a job last year which required a couple of comparators, on a tiny PCB which would withstand 125 deg C.A PIC was the best option commercially. It runs code which programs the I/O registers at power-up, then sits in an endless loop.It's amazing how tenaciously some people like to hang on to their ideas about how things used to be done. Using a programmed device isn't "cheating", it's simply how this kind of thing is done nowadays. Other than analogue functions (eg. 4052) and specialist I/O, I can't remember the last time I used a 74 series logic chip. The cost is all in the packaging, board space and assembly; what's actually inside that SO14 package really doesn't matter at all. (Add 10p for programming if you really want).I'm not sure I've *ever* actually used a 555 timer in a commercial product. There's always some little corner of a microcontroller or FPGA available instead.

author: technix
author_rank: Super Contributor
timestamp: August 02, 2018, 06:56:21 pm
content: Quote from: boB on August 02, 2018, 06:24:30 pm555's themselves are a cent a dozen here, but the single capacitor required for a 1-minute delay with reasonable reliability draw is the kicker.

author: In Vacuo Veritas
author_rank: Frequent Contributor
timestamp: August 02, 2018, 06:56:55 pm
content: Quote from: AndyC_772 on August 02, 2018, 06:53:58 pmDamn was that one of Treez LED drivers?

author: AndyC_772
author_rank: Super Contributor
timestamp: August 02, 2018, 07:00:31 pm
content: Poor guy, but at least he'll be heading for pastures new soon.IIRC it was monitoring something on an engine or gearbox. The primary design criterion for many of my boards is the highest ambient temperature they'll withstand before dying.

author: CopperCone
author_rank: Super Contributor
timestamp: August 02, 2018, 07:03:00 pm
content: Quote from: AndyC_772 on August 02, 2018, 06:53:58 pmI think that leads to people bitching that the code is difficult to change, so you get trapped. In a company that means more people, mandatory debugging, firmware complications/strains forming due to product line modifications,, it can turn into a real night mare as I saw when you have too many firmware strains and you wanna do a migration. I saw little changes causing the main control function of the device going crazy before (on cramped code where in my opinion a single MCU was doing too much).And the failure modes of a MCU are greater (soft fails) then any hard logic like a 555.

author: AndyC_772
author_rank: Super Contributor
timestamp: August 02, 2018, 07:08:36 pm
content: It's just a different way of thinking. That particular PIC *is* a dual comparator.Don't think of it as a programmed device at all; just think of it as a compact, high temperature device, a bit like an LM293 but with a longer part number.

author: technix
author_rank: Super Contributor
timestamp: August 02, 2018, 07:11:31 pm
content: Quote from: AndyC_772 on August 02, 2018, 06:53:58 pmMy original idea was two Schottky diodes into a cap into LM393 into 555, with a side car of a TL431. If I go the PIC route the LM393 and the 555 are gone, but the TL431 + pot reference circuit and the Schottky diode peak detector is still there.

author: CopperCone
author_rank: Super Contributor
timestamp: August 02, 2018, 08:35:04 pm
content: Quote from: AndyC_772 on August 02, 2018, 07:08:36 pmbut it is a programmed device and there are all sorts of quirks of using a programmed device that you just can't ignore. The silicon is inherently more complicated and the process is more prone to quality problems because there are more complex inspection and verification steps.

author: AndyC_772
author_rank: Super Contributor
timestamp: August 02, 2018, 09:06:47 pm
content: Do you have a concern that's specific and quantifiable enough to address?

author: schmitt trigger
author_rank: Super Contributor
timestamp: August 03, 2018, 04:17:41 pm
content: Quote from: AndyC_772 on August 02, 2018, 06:53:58 pm*Gasping for air*You mean...I can no longer use my dual triode, Eccless-Jordan multivibrator anymore? There are a pair of triodes inside an ECC83/12AX7, so that is LSI in my book.