PIC16F1783 - great chip for PSU makers - Page 1
Forum section: electronics / general

author: ptricks
author_rank: Frequent Contributor
timestamp: December 02, 2012, 04:18:03 pm
content: I noticed a new pic on the microchip site and sample are available now, this chip has lots of features for power supply control . Cost is only $2 per chip QTY 1 and it comes in SPDIP format too. I am halfway through building another supply but may stop and re-consider a re-design with this chip, it looks like it could cut my parts count in half.http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en552741Quote

author: MikeK
author_rank: Super Contributor
timestamp: December 02, 2012, 05:23:48 pm
content: Sounds cool. Unfortunately, Microchip stopped sending samples to the U.S. years ago. It's now on my Mouser "to-order" list.

author: bxs
author_rank: Regular Contributor
timestamp: December 02, 2012, 05:34:18 pm
content: Great, have you read the errata?You if try to make a PSU with the current revisions I'm almost sure it will blow up

author: ivan747
author_rank: Super Contributor
timestamp: December 02, 2012, 08:25:16 pm
content: One thing I don't like about having a MCU in a control loop is that it becomes tedious to make the circuit work. You now have something you have to program in order to get your basic power supply working.Here's an example: If the MCU only told the supply what voltage to output using a DAC it would be easier to test the power supply. That's because you don't have to figure out how to use the DAC before confirming the rest of circuit works fine.

author: jeroen74
author_rank: Frequent Contributor
timestamp: December 02, 2012, 10:49:17 pm
content: I believe these kinds of ICs, just like the AVR PWM series, are really meant for fairly steady loads like electronic drivers for HID lamps, or fluorescent tubes. Or motor control which is fairly slow too.I don't see the added value of a MCU inside the control loop of a PS. Not every single little analogue thing needs MCUfication.

author: ptricks
author_rank: Frequent Contributor
timestamp: December 02, 2012, 10:58:47 pm
content: Quote from: MikeK on December 02, 2012, 05:23:48 pmWhen ? I just got a sample order from Microchip two days ago. They do fedex them from Thailand, really weird since they also have a warehouse in Austin, TX. I guess they got a deal with fedex on the low cost shipping.

author: ptricks
author_rank: Frequent Contributor
timestamp: December 02, 2012, 11:05:03 pm
content: Quote from: jeroen74 on December 02, 2012, 10:49:17 pmVariable output switch mode supplies can use this to easily put together everything but the output stage with the FET. A lot of the supplies currently use one of the URxxxxx chips along with a couple extra chips. There is an app note for using it to charge lithium batteries, LED controls, as well as 3 phase motor control. For the price it is a lot of features in a small package.

author: ptricks
author_rank: Frequent Contributor
timestamp: December 02, 2012, 11:13:12 pm
content: Quote from: ivan747 on December 02, 2012, 08:25:16 pmIf all you want is preset voltages then there are easier ways to do it. If you want variable voltages controlled by a processor I can't think of an easier way than this chip.

author: jeroen74
author_rank: Frequent Contributor
timestamp: December 02, 2012, 11:28:31 pm
content: Those are applications where transient response can be fairly slow. PWM resolution is also a problem. Of course, I have not studied these devices in any detail, so maybe they have some features to help improve transient response greatly (the analogue feedback part maybe?)I know for fact that in eHID drivers, that a PWM output running at 96MHz does not provide enough time resolution to keep the output stable enough (lamp flicker), so a dithering circuit is needed that basically modulates the duty cycle in a certain pattern so the apparent time-averaged resolution is increased by 8.I think you can control the output voltage of a conventional switcher without this kind of MCUs.

author: ivan747
author_rank: Super Contributor
timestamp: December 03, 2012, 01:35:10 am
content: I think both of the integrated comparators can be linked with the special PWM peripheral for a fast response.I was using a completely different PIC the other day to design a cool circuit. This is an example of what can be done with some peripherals. This was an LED backlight driver. It worked from 3V.I used a capacitive voltage doubler, the low resolution DAC and one of the built in comparators to make a simple LED backlight driver.Since the DAC can be wired internally to the comparator, I did that. I could also disable the PWM output using the comparator output internally. I only used a couple of caps and diodes and a few resistors to get it working.The most time consuming task was setting up all the fuses and configuration bits and software. In the end the PIC is pretty much a black box.

author: nctnico
author_rank: Super Contributor
timestamp: December 03, 2012, 06:46:53 pm
content: Microchip is wasting their time. I have made a 300kHz power supply controller using an ARM microcontroller 6 years ago.

author: metalphreak
author_rank: Frequent Contributor
timestamp: January 12, 2013, 12:44:38 pm
content: Quote from: nctnico on December 03, 2012, 06:46:53 pmThe Wright brothers made an aircraft fly in 1903, but that didn't stop Boeing and hundreds of others building planes...

author: BravoV
author_rank: Super Contributor
timestamp: January 12, 2013, 12:59:43 pm
content: Quote from: jeroen74 on December 02, 2012, 10:49:17 pmSorry for ot, just love this one, feel the strong urge that its deserved as my new fav quote.

author: nctnico
author_rank: Super Contributor
timestamp: January 12, 2013, 02:51:53 pm
content: Quote from: metalphreak on January 12, 2013, 12:44:38 pmYes, but the Wright brothers made their aircraft BEFORE Boeing made the 747. Not the other way around.

author: jerry507
author_rank: Regular Contributor
timestamp: January 12, 2013, 04:24:08 pm
content: I'm at a complete loss to see why Microchip shouldn't do what every other microcontroller vendor does, offer their own version of things other companies do. It's just another addition to their CPU independent stuff.http://ww1.microchip.com/downloads/en/DeviceDoc/41565d.pdf

author: JoannaK
author_rank: Frequent Contributor
timestamp: January 12, 2013, 09:00:45 pm
content: Quote from: nctnico on January 12, 2013, 02:51:53 pmI know this may backfire, but at what pricepoint did your power supply to be? Was it produced in masses, like part of some highly competetive package or was it One-off build?Even though Microchip chips can be used for 1-off protos, their real value is on mass production.

author: nctnico
author_rank: Super Contributor
timestamp: January 12, 2013, 09:29:01 pm
content: It is a mass produced product.The volume must be really high (>100 000 units) for the total cost of a PIC to drop below that of a modern microcontroller. Most of the cost of a microcontroller based product goes into developing the software. For most products I've worked on about 95% of the price is the cost of developing software. Because the other components, PCB, casing, testing also cost money it really doesn't matter if I use a $2 or $5 controller. It will change the price only by like 0.5%. But if I choose a controller which takes me twice as long to write software for then the price of a product suddenly almost doubles.For example ARM simply is much more convenient to program and existing software (like algoritms you can find on internet) is easier to get running on ARM. PICs (especially the 8 bit ones) can't deal with pointers very well so you have to (re)write software in a clunky way which is more difficult to understand and maintain. This may seem a minor problem but when summed up over a large period you'll see the losses in time and money grow to staggering amounts if a product has to do more than read a few buttons and print some text on a display.

author: JoannaK
author_rank: Frequent Contributor
timestamp: January 13, 2013, 09:10:17 pm
content: I agree, that if the product needs something like Tcp/Ip (aka ethernet) or bluetooth etc then those pics are definitley suboptimal.But, if it will be stand.alone power supply, the those pics can do a quite well job.I admit, I have not checked what kind Soc-ARM.s there are available. back in days (not so many years ago) the 32-bit cores would definitely have been too much overkill to any power supply.For the reference (and related to my own Fujtsu thread), is there any particular family of Arm chips you'd recommend to get a closer look? I know there are n+1 variants from all new companies, but if we try to limit the list to those avaible at hobbyist friendly parts and devtools, open documentation (no NDA or registration) and honest Erratas.

author: nctnico
author_rank: Super Contributor
timestamp: January 13, 2013, 10:39:53 pm
content: The question is whether you'd have to put a microcontroller in a standalone power supply...Anyway, the ARM devices from NXP have been serving me very well. The errata sheets aren't very long and all you need to program them is a tool called 'flash magic' and a serial port. No hassle with JTAG dongles and so on. But.. like with all microcontrollers it does take time and reading to get up to speed. Fortunately you can download a lot of software from NXP's website to see how the peripherals need to be setup.

author: JoannaK
author_rank: Frequent Contributor
timestamp: January 14, 2013, 12:09:27 am
content: As saying goes: Have a hammer and everything looks like a nail ..

author: JoannaK
author_rank: Frequent Contributor
timestamp: January 15, 2013, 03:00:50 am
content: I decided to check those Nxp:s and they indeed look nice for what they are. That is if you are looking for a mpu with PIO-pins and some Uart+Spi+I2c. But the on the controller IO and functionality side those are quite lacking. Ok, the Arm core is neat and the basic IO:s modules are well available, but even when compared to this pic16 (in subject) they lack oomph on HW-driving. Not to mention those real beasties Motorola (later Freescale) has been making for over a decade.I also realized how relative the world 'difficult' is when we talk about micro controller setup. For something I'd agree on difficult (some might say 'extra hard') would be something like MPC555 TPU-s (Data sheet not for the faint hearted)..http://cache.freescale.com/files/microcontrollers/doc/user_guide/MPC555UM.pdfYep.. that's over decade old chip and pricey as hell (was not cheap even back then). But having 32bit PPC(Float) core plus complex IO support, and with 10+year availability it's not too bad.Addendum: I had to check, Freescale uses ARM only at those Infotainment chips. Reason or other, all their system critical control (motor, transmission, breaks) chips are PPC based.

author: nctnico
author_rank: Super Contributor
timestamp: January 15, 2013, 10:29:27 am
content: Quote from: JoannaK on January 15, 2013, 03:00:50 amThen its time for you to get a new pair of glasses. Most peripherals are quite versatile and can do a lot more than it seems at first sight. The SPI interface for instance has a variable word width up to 16 bit and a hardware buffer. The SPI interface also has several modes which also allow it to interface with several kinds of audio codecs. Depending on the device timers can be used as versatile PWM generators or even to trigger the ADC. For the projects I came across the NXP controllers turned out to be the best fit compared to TI's and ST's ARM offerings. Another neat feature is that the flash has multi bit error correction which improves reliability.

author: jerry507
author_rank: Regular Contributor
timestamp: January 15, 2013, 04:05:39 pm
content: Picking microcontrollers is largely personal preference masked by technical requirements.

author: nctnico
author_rank: Super Contributor
timestamp: January 15, 2013, 09:26:02 pm
content: Nonsense. A device fits the project or it doesn't.

author: JoannaK
author_rank: Frequent Contributor
timestamp: January 16, 2013, 01:11:13 am
content: In a sense I see a point. Since designs are at least partly made with compromises. And question usually is what is one willing to give up to make it fit and work.So far, of the Arm cores controlers (m0 or m0+) I have seen the Freescale KL2 series seems to be least ackward. Ok, their 'free compiler' that is avialable with the 10-20$ protoboards is apparently more limited than what's available at NXP, but IO modules have bit more oomph and documentation seems more trustworthy.

author: nctnico
author_rank: Super Contributor
timestamp: January 16, 2013, 01:57:14 am
content: For ARM controllers you use GCC and Eclipse. Both available for free and excellent.With Freescale you should watch out for availability of affordable programming tools. I've been down the Freescale road before with a Coldfire controller and got stuck on having to spend major $$$ on a programmer for any serious work. With the NXP parts you can use a simple circuit and program from an RS232 port or just hook up about any USB to serial converter chip. Newer parts with a USB bootloader can act as a USB stick so you can drag & drop new firmware using Windows explorer. No need to mess around with JTAG dongles and complicated software even if you choose not to use the vendor provided IDE (which usually is crap compared to Eclipse).

author: poorchava
author_rank: Super Contributor
timestamp: January 16, 2013, 08:40:14 am
content: It is true, that ARM controllers are dirt cheap for their computing power and availability of software development tools.But you simply cannot do some things without stuff like hardware deadtime generators, synchronized PWMs and the like. Sometimes you simply cannot beat a dedicated solution with an all-round cheap and powerful solution.On the other hand given the Microchip's reputation I wouldn't be surprised if half of the dedicated SMPS stuff didn't actually work.And for high reliability solutions: I'm working in automotive industry, I have taken part in development of hefty number of control units and also disassembled many of competitors' devices and never saw a single ARM controller. We tend to use Freescale or Fujitsu when 32-bit processor is needed, and those are PowerPC.A can see another 'which MCU is best' flamewar coming

author: nctnico
author_rank: Super Contributor
timestamp: January 17, 2013, 02:35:05 pm
content: Quote from: poorchava on January 16, 2013, 08:40:14 amActually lots of (ARM) microcontrollers can be used to create a 3 or 4 phase PWM (motor) controller. Dead time is just a matter of software. But then again if no further intelligence is needed a dedicated PWM chip is cheaper.QuoteMy guess is that that has more to do with the automotive world being conservative or the vendors have a succesfull lock-in with their tools. The whole world already buried the PPC architecture years ago. OTOH there are not many automotive ARM devices because the market for consumer and industrial devices is big enough. ST which has a strong automotive background offers several ARM based microcontrollers in the automotive temperature range though.

author: jerry507
author_rank: Regular Contributor
timestamp: January 17, 2013, 07:42:18 pm
content: nctnico has quite a long track record of evangelism for his brand. Meanwhile there are far more people using Keil and IAR for programming arm than using Eclipse and GCC straight up. Not to mention that most of the free vendor tools are Eclipse now.......Working on ARM projects right now, I'm not really sold on their awesomeness over any other solution. They tend to be significantly more powerful which makes them great for many more applications now. But it's a PSU, don't need an arm. Choosing an arm comes with trade offs and they're not a panacea.Picking an arm vendor is personal preference. They all have pro's and con's. Some people just can't see that though.

author: nctnico
author_rank: Super Contributor
timestamp: January 19, 2013, 12:16:52 am
content: Quote from: jerry507 on January 17, 2013, 07:42:18 pmNow you make it sound like I never used anything else than ARM but that is very far from the truth. Over the past decades I have tried and used many microcontrollers. The processing power an ARM offers opened many new possibilities for me like audio processing without tedious DSP assembly. And not to mention there is enough processing power to do stuff in software that was traditionally done in hardware. That has allowed me to come up with several very neat solutions.QuoteI have used Keil's and IAR's IDEs in the past but I didn't find them very usefull. The editor is minimalistic and things like subversion support are missing. Maybe they have improved in the meanwhile. Anyway, the people and companies (http://www.eclipse.org/membership/showAllMembers.php) behind Eclipse have put their heads together to make the best universal IDE with as many usefull features as possible for developing software so programmers only need to learn one IDE. There is a learning curve but the reward is that you (almost) never need to learn another IDE and never miss out on a feature. I have been using Eclipse exclusively for all the software I write for about 8 years now.

author: jerry507
author_rank: Regular Contributor
timestamp: January 21, 2013, 06:52:21 pm
content: Right, I actually agree 100% with you. If I had the time to learn and set all this up, it'd be well worth the effort. The advantages of Keil and IAR is that they just work, which is what you're paying for. The vendor IDEs are free and should just work, but they're piles of crap. Eclipse/GCC are free, very powerful but require work to start up. Those are the basic tradeoffs of money and time.Just fyi, Keil and IAR work just fine with revision control, because you just use Tortoise or whatnotWorks just fine.ARM is fine, but you can't blind yourself to the very high barriers to entry. They're easy to forget once you're past them. They're also not the worlds lowest power either, and often are lacking more analog-y peripherals. Bottom line is there are still many valid reasons to use something else in place of an ARM.We agree far more than we disagree on this, and it's just how we're conveying our positions that leads to the apparent gap.

author: Christe4nM
author_rank: Unknown
timestamp: January 21, 2013, 07:42:38 pm
content: Personally I don't think that the specifications mentioned in the first post are too special. When looking at Farnell, I can easily find a cheaper ARM Cortex-M MCU with at least similar specs. If you would take the time to investigate I'm positive there is one that has very similar peripherals as the PIC mentioned by the OP + a whole lot of extra's (Quick search example:STM32F1xx)Right now if I needed to choose a generic MCU for a project I would hardly look any further than ARM Cortex-M. The range is so very wide now that there is always one that fits your bill, and prices can be just as low, or even lower than a 16b equivalent one. With NXP getting into very cheap 8 pin MCU's they are even becoming 'glue logic'. The only headache is to find the right one in a maze of many many Cortex-M MCU's that seem almost similar, but can be very different under the hood, even within a single family.I'm relatively new to MCU's, and have no history with the 8b or 16b generations. Even though I read some saying that a 32b is killing a bug with a platoon of tanks, that platoon of tanks nowadays is cheaper than the good old slingshot. Moreover, from what I'm taught, the Cortex-M cannot be thought about in the classical way of 16b or 32b. The way it handles instructions is actually a combination of both 16b and 32b instructions in an efficiently managed way. Add the many power modes and energy management becomes more efficient too. Think of it as running instructions for a much shorter time and thus sleeping longer in an application where a 16b would take more time to process instructions and thus sleep shorter.Just my 2 (Euro)cents.

author: ptricks
author_rank: Frequent Contributor
timestamp: January 21, 2013, 10:18:31 pm
content: Quote from: Christe4nM on January 21, 2013, 07:42:38 pmThey are not the same chips. The ARM listed above is what I call a kitchen sink processor because they throw everything they can into it in the hopes that more will be better, but it actually can hurt a project designed around the part. Notice it includes things like HDMI CEC, something a PSU designer is not going to be interested in using. A user might choose to ignore that feature and use the part anyway but they can't ignore the limitations that having that hardware available on the die causes, and there are always limitations imposed when you add features. Both ARM and PIC make the mistake often of trying to include too many peripherals . That is what I found refreshing about the PIC16f1783 , it was clearly designed with power control in mind . There are parts included that are needed when doing a smps, like op amps, comparators, that normally require extra chips. The PSMC is another thing that is different . Nothing here is anything exclusive to microchip but they have added features that work together and left out the stuff that wouldn't be needed all while keeping the pin count much lower than an ARM design and pin count matters a lot when you are figuring out the total cost.QuoteYou can't compare architectures based on bits because they all are different . I use ARM for things that require high level processing not things like a power supply or a remote control and that is the reason 8bit and 16bit will be around for a long time the reason isn't because a 32 bit processor is too powerful, the reason is because a 32 bit processor brings other baggage along with it I don't need for smaller projects. In your tank example , sure the tank can kill easier, but then you need fuel, maintenance, men to run it, if I want to kill a bird I could use either but the slingshot takes a lot less effort and preparation . Don't restrict yourself into one platform or number of bits used, use whatever fits the job best. I learned from years of being an engineer that those who get caught up in platform loyalty are usually the engineers that end up moving from company to company looking for one that caters to their interest , instead check out every manufacturer , even ones you think don't have anything to offer. I will probably never use a renesas cpu but that doesn't mean I don't keep up with what they make and read their data sheets. In the 20+ years I have been doing this I have never been without someone wanting me to work for them and it has been because I don't fixate on one platform.You can tell the engineers who have locked themselves into one brand when they list themselves as being an Freescale developer or ARM or PIC developer, I still use the title embedded hardware engineer because that is what I do , design hardware based on whatever fits and the client wants, I don't sell myself as being a specific platform developer as I need to fill their needs not have them fill mine.

author: jeroen74
author_rank: Frequent Contributor
timestamp: January 21, 2013, 10:51:56 pm
content: On a side note... a while back when I worked at Philips I attended a presentation by a chip designer about a new generation of a fluorescent ballast control IC. Interestingly, the only feasible package was SO-14, which was a bit problematic because they really needed 16. But with 16 pins, even with many, many, many millions units produced annually, the IC would not be viable. In this sector, every tenth of a cent counts. So with a bit of some serious clever work they managed to combine the function of three pins into one.In the high end eHid ballast sector, where only each cent counts, they use 8 bit controllers from ST, custom versions that are augmented with some clever power control hardware (I can't share the details unfortunately as it is propriety). Still no 32 bits as it probably serves no purpose other then increase cost.

author: Christe4nM
author_rank: Unknown
timestamp: January 21, 2013, 11:28:38 pm
content: Thanks jeroen, seems my limited experience with MCU's led me into a bit of a tunnel vision. Your reply was educating. I'll try to keep my mind open. Thanks again.

author: nctnico
author_rank: Super Contributor
timestamp: January 22, 2013, 12:04:03 am
content: Quote from: jeroen74 on January 21, 2013, 10:51:56 pmThe key hint to take from the above is the part 'many million units'. The problem is that many people start to look at the costs of components after hearing/reading these kind of stories. They waste time and come up with obfusticated solutions which require complicated software. Even when the product you design sells 1000 pieces per year (which is a more realistic number for most professionals on this forum) it really doesn't matter if the microcontroller costs $2 or $5. The other costs involved are much higher. If you specialise on one or two microcontroller families you can easely make up for the price difference by cutting down the development time / cost.

author: jeroen74
author_rank: Frequent Contributor
timestamp: January 22, 2013, 12:14:27 am
content: I investigated a bit what MCUs they used in all the different products they have, and they were definitely not married to a single family or brand of MCUs. I have seen stuff from Microchip, Atmel, ST, NXP and TI. Other parts of Philips like Consumer Electronics might use Holtek too (some versions of the Senseo coffeemaker for example) or even weird Chinese brands that only have one product (a Philips alarm clock I have).Of course, for such big company, the cost of tools and compilers is quite insignificant on the total budget for a project. That is naturally completely different for an hobbyist,a one-man shop or a shop specializing in low volume stuff.So, I also agree with Nico. For that matter, I also don't understand why some people insist on an absolutely minimal number of external components for (usually) a switching PS. Those extra components are usually a few resistors and/or caps that cost almost nothing.

author: nctnico
author_rank: Super Contributor
timestamp: January 22, 2013, 12:29:09 am
content: About the external components... wait until you have to put a prototype togetherMore serious: less components make it easier to route a PCB. Also the number of resistors, capacitors, etc can grow very large and each of them needs to be placed which takes time and thus costs money. I recall creating an alternative design which cut the BOM cost in half but because the client used an expensive assembly house it was more expensive to make than the existing design.