I am staring at a PIC16F57 chip... - Page 1
Forum section: electronics / general

author: technix
author_rank: Super Contributor
timestamp: January 22, 2019, 03:21:02 pm
content: As the title suggests, that is a chip I bought for no reason other than padding out an order to net myself some savings. (Some Taobao sellers offer free shipping if the order exceeds a certain amount. I was 10 yuan away from dodging a 23 yuan shipping so I bought a few PIC16F57 to pad out the bill, and pocketed an 11 yuan delta.)Now what can I do with it? It is the 0.6 inch wide 28-pin version too, not the usual 0.3-in wide version.

author: rhodges
author_rank: Frequent Contributor
timestamp: January 22, 2019, 03:57:45 pm
content: I remember a short discussion about a PIC marker generator. Maybe this is the one?https://www.qsl.net/yo5ofh/pic/marker_generator_with_pic6f.htm

author: NivagSwerdna
author_rank: Super Contributor
timestamp: January 22, 2019, 05:03:24 pm
content: Not much. You bought a very dull device. Should have gone up market and got a model with more on-board peripherals.You can make it go to sleep, wake up, flash an LED.

author: technix
author_rank: Super Contributor
timestamp: January 22, 2019, 05:24:46 pm
content: Quote from: NivagSwerdna on January 22, 2019, 05:03:24 pmThat specific shop does not carry many MCU, and I have no need for their higher end ones which I has a stock already. I just happen to have no sample of that chip, and I need to pad the order.What can it do other than flashing a LED? Anything more it can do?

author: NivagSwerdna
author_rank: Super Contributor
timestamp: January 22, 2019, 05:39:28 pm
content: Quote from: technix on January 22, 2019, 05:24:46 pm1x 8-bit counter/timer.... Probably lots of things... possibly the landing system on a moon lander?

author: tszaboo
author_rank: Super Contributor
timestamp: January 22, 2019, 05:40:21 pm
content: Here is a programmer for it.http://urriellu.net/en/projects-electronics/pic3prog-pic-programmer-parallel-port.htmlIf you have a laser printer, than you should go to the local pharmacy and buy ferric chloride, and make a proper PCB to program it.I know a guy who has the assembler for it, it is only 4 floppy drives.There are a bunch of good projects in the Elektor magazine, If you dont have it, then the local library for sure will. Photo copy it or rent it out. But make sure not to scale it, otherwise you will have a hard time bending all the leads.Can you tell me the address of this taobao shop? I thought I know all the local vendors. Is it far, I usually go with bicycle? I cannot find it in the phonebook.

author: Bud
author_rank: Super Contributor
timestamp: January 22, 2019, 06:00:20 pm
content: You can do a lot of simple projects such as quadrature decoder or frequency counter or clock, many out of say pic16f684 projects with the ports ptoperly remapped.

author: technix
author_rank: Super Contributor
timestamp: January 22, 2019, 07:00:38 pm
content: Quote from: NANDBlog on January 22, 2019, 05:40:21 pmI already have a genuine PICkit 3 and a DIY PICkit 2, no need for that programmer.Quote from: NANDBlog on January 22, 2019, 05:40:21 pmJLCPCB offers free shipping to Shanghai for their $5 PCB. I would just have them made boards for me instead.Quote from: NANDBlog on January 22, 2019, 05:40:21 pmI also already have MPLAB X and XC8 on my workstation.Quote from: NANDBlog on January 22, 2019, 05:40:21 pmMy local library (Shanghai Library Changning Branch) does not have a good selection of that type of magazines.Quote from: NANDBlog on January 22, 2019, 05:40:21 pmI don't have their address since I bought it on my phone. Also I think this "free shipping" stuff is their black friday special.Quote from: NivagSwerdna on January 22, 2019, 05:39:28 pmAre you sure?Quote from: Bud on January 22, 2019, 06:00:20 pmMy chip here is a PIC16F57, not '16F684...

author: Bud
author_rank: Super Contributor
timestamp: January 22, 2019, 07:06:51 pm
content: I understand, i was saying you can use the 57 chip for many 628 chip projects as a substutute, just remap the ports in the code. It just seems there was a lot more projects published using 628 chip with a great variety of use cases easier to pick from.

author: NorthGuy
author_rank: Super Contributor
timestamp: January 22, 2019, 07:09:28 pm
content: You can make its copy in FPGA, and then use the real chip to validate your designOr you can design a tutorial and donate it along with the chips to poor kids who want to study electronics.Or you can melt off the cover and see if you can break in the protected chip with microprobes.Or you can make experiments on the extreme temperatures the chip can take.Or you can practice your basketball skills by throwing the chips into the basket one by one.The possibilities are endless ...

author: hans
author_rank: Super Contributor
timestamp: January 22, 2019, 08:03:21 pm
content: I guess you can use the chip as a power sequencer and fault monitor.Or a device that reads a button and then activates a relay for a given period.That's about it I can think of. The chip doesn't even have interrupts, so the timer is only good for measuring intervals or determining the pace of your main program using a spinlock/busy loop.The chip only has a 2 level deep stack, so don't expect to build anything complicated. Because of that as well, don't expect it to replace the 628. That chip is a completely different league of functionality.

author: Ian.M
author_rank: Super Contributor
timestamp: January 22, 2019, 08:47:00 pm
content: Its an early baseline PIC (it doesn't even have on-chip brownout reset), in an obsolete pinout, so unless you want to practice your baseline PIC assembler skills on a breadboard, build an old project that uses it (or a 'C57), or repair something that uses it, that you can still get a firmware image for, its essentially useless.OTOH, as they are only worth $0.85 USD each (from MicrochipDirect), it doesn't really matter. Maybe send them to anyone who's interested and will either pay postage or swap for something interesting.Another idea would be to solder all the legs to a block of brass to stabilise them and try decapping the chip with boiling Rosin to look at the die.

author: KL27x
author_rank: Super Contributor
timestamp: January 22, 2019, 09:19:46 pm
content: QuoteTake a picture. It will last longer.Usually when you buy one chip, it is to learn how to use it. So you can buy a lot more.The only way i'd bother to use this model chip is if I had 10,000 of them. And I couldn't get anyone to take the lot off my hands for $20.00 plus shipping.

author: tszaboo
author_rank: Super Contributor
timestamp: January 22, 2019, 11:18:34 pm
content: Quote from: technix on January 22, 2019, 07:00:38 pmI dont think you got the irony in my writing. This is a chip we dealt about 20-25 years ago. If you wanted to get into microcontollers that time, this is all that we have to deal with. I remember taking a train to another town, because they did not have the right 74LS chip. This was before computers were connected to the internet, or there was someone in the street who had a dialup modem.

author: Bud
author_rank: Super Contributor
timestamp: January 22, 2019, 11:25:43 pm
content: I think a quadrature rotary decoder a very practical circuit that can be made out of it. Not the best optimized in terms of physical size but nonetheless.

author: westfw
author_rank: Super Contributor
timestamp: January 22, 2019, 11:52:22 pm
content: My last 16f57 design was a serial-input 8digit LED display. (Theoretically, anyway. I never did finish the software.)Nowadays, I've been thinking even simpler: two digit hex-to-7segment decoder? 8x debounced pushbuttons? Semi-virtual front panel with a bunch of toggle switches and query-able serial interface?

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 23, 2019, 12:02:20 am
content: One 8-bit timer, 72 bytes of RAM, and a whopping 2-level stack. You decided to harm yourself?

author: rhodges
author_rank: Frequent Contributor
timestamp: January 23, 2019, 02:16:37 am
content: Quote from: SiliconWizard on January 23, 2019, 12:02:20 amThat might replace a lot of logic chips, if the signals are very slow. I think the Playstation mod chips were one or two under than this chip, and they provided a useful function.At one time, these were very useful. Today, I would suggest looking at the STM8 line.But as an educational experience, I think the PIC is great. Write a lot of PIC assembler code and you will benefit from it.

author: Ian.M
author_rank: Super Contributor
timestamp: January 23, 2019, 03:15:30 am
content: The trouble is, its a piece of s--t for the board area it occupies, and due to the odd package pinout, there's absolutely no upgrade path if you've under-estimated your processing requirements.IMHO the PIC baseline (12 bit) core just isn't worth learning. Its got too many ugly compromises, and if you need to make a million units of a blinky LED badge or other daggy doller store trash, there are better cheaper MCUs to use.OTOH the 'classic' PIC midrange (14 bit) core is much nicer to work with. Its still got some fiddly details you have to get just right to make your code reliable, but writing hand-optimised assembler for it for either minimum resource usage or cycle accurate timing will teach you a lot.

author: BrianHG
author_rank: Super Contributor
timestamp: January 23, 2019, 04:11:42 am
content: Arrrrrrrrrrrrrrrggggggggggggggg!!!!!!Do you know how many projects I made using a PIC16C54/55/56/57 over 20 years ago. And now that you ask this question today and I cannot give you a single answer!Ok, here is 1 useful one. I synthesized a PWM output from a PIC16C54 to drive the output mosfet stage in my 12vdc to 120v AC inverter to generate a 60hz true sine waveform (well rounded, yet a little amplified and squished at the peaks since the DC-DC converter in the box I had only gave 145v DC and I wanted to read 115v AC on my volt meter) go get rid of that buzz.Again, today I would use a new PIC with true PWM outputs and use an input as feedback to ensure regulated amplitude output.

author: technix
author_rank: Super Contributor
timestamp: January 23, 2019, 02:47:18 pm
content: Quote from: KL27x on January 22, 2019, 09:19:46 pmThe sole reason I bought that chip is that I need to pad out the bill to dodge some shipping fees and actually save some money. Learning is a secondary goal.Quote from: Ian.M on January 23, 2019, 03:15:30 amI think am going to use it as a scale-down chip, if PIC16F72 or ATmega8 turned out to be overkill for the project at hand.Quote from: BrianHG on January 23, 2019, 04:11:42 am*sigh*The lack of interrupts of all things made it a bit tough for me to use really.

author: iMo
author_rank: Super Contributor
timestamp: January 24, 2019, 10:27:20 am
content: That is a great chip! With 72bytes ram and 2kx12 flash you can do almost everythingFor example a 50Mhz 8 digits counter.There is an 8-bit real-time clock/counter (TMR0) with 8-bit programmable prescaler, and with some tricks you can read the prescaler's content out. The prescaler itself runs till 50-60MHz sure.Or famous high precision LC meter -http://electronics-diy.com/lc_meter.phpI built several mods of the both above with 16f84/628 and used for decades as my metrology level stuffAnd there are hundreds of apps for pic16f84/628 and friends which can be flashed in easily. You may play with the chip for months

author: technix
author_rank: Super Contributor
timestamp: January 24, 2019, 11:13:31 am
content: Quote from: imo on January 24, 2019, 10:27:20 amOof L-C meter with this...I was on the edge of building a RLC meter using STM32F303, maybe that was a severe overkill then.

author: Ian.M
author_rank: Super Contributor
timestamp: January 24, 2019, 12:21:08 pm
content: Except the PIC16F84 and 'F628 are midrange (14 bit) core devices, so they have an eight level call stack, interrupts and the CALL instruction can reach any address in the program memory, not just the low half of each page (limitation of baseline core). Also the baseline Timer 0 module doesn't have an overflow bit - there are no interrupts so no TMR0IF bit.Porting a midrange core application to baseline core is going to involve a ground-up rewrite and may not even be possible if it made significant use of interrupts.You *can* perform reasonably accurate frequency and time measurement with a 'F57 with a crystal oscillator, but whether you can fit all the code you need for a RLC or even just a LC meter with a human readable display in only 2 Kword of baseline instructions is another matter. IMHO its a seriously hair shirt programming exercise that if you do decide to attempt it, will probably drive you to madness.

author: iMo
author_rank: Super Contributor
timestamp: January 24, 2019, 01:17:41 pm
content: 15yQuote from: Ian.M on January 24, 2019, 12:21:08 pmYes, you can run the LC code in it, the original LC meter works with 16f84 which is 68bytes of ram and 1024Words of flash only. I did it and the LC meter is pretty accurate when calibrated. People did a comparison with big HP LCR stuff and it performed almost same.Click on the link I posted above and you will see.When googling you may find megatons of various mods of the LC meter code as the design is maybe 20y old.PS: and here is the 50MHz counter:http://electronics-diy.com/50MHz_Frequency_Meter_Counter.phpC-compiler: the best C compiler I ever had for these smallest pics is this onehttp://www.bknd.com/cc5x/I wrote my own LC meter code in that cc5x with 32bit floating point calculations for 16f628 (228bytes ram, 2kWords flash).

author: Doctorandus_P
author_rank: Super Contributor
timestamp: January 26, 2019, 11:12:10 am
content: Pic's are obsolete. Go buy some AVR's.

author: KL27x
author_rank: Super Contributor
timestamp: January 26, 2019, 09:19:16 pm
content: ^LOL.That PIC is obsolete. Atmel has historically discontinued chips like this, abruptly. When their industrial users stop buying it, you can kiss it goodbye. Microchip has historically given you the option to continue using obsolete PICmicros, if you want to. Microchip maintains archive of every revision of their IDE and dev tools going back to 1970, you can go and download for free. They have excellent direct to consumer business model where Joe Nobody can open an account and get volume pricing and allocation of devices 1.5 years in advance to ensure availability to support a given project. They not only make dozens of variations of their devices with different option, but they manage to make all these variations available. The documentation is also way better. In another ten or twenty years, Microchip might bring AVR line up to speed in some or all of these aspectsW/e one you personally prefer, dicking around with your one dev board, that's fine and all. There are other factors you might consider if you take a product into production. PIC is obviously superior in many of those. The whole entire point of microcontrollers is to make it cheaper and easier to mass produce things. Microchip has kept this in focus in their business model, of bringing this capability to small businesses and individuals that other manufacturers essentially ignore. The AVR push into universities and for hobbyists is strong, now, and there's an active community/forum for AVR, but that is just a small part of what Microchip already has in place with PICmicro.