Author Topic: I am staring at a PIC16F57 chip...  (Read 4129 times)

0 Members and 1 Guest are viewing this topic.

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
I am staring at a PIC16F57 chip...
« on: January 22, 2019, 03:21:02 pm »
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.
 

Offline rhodges

  • Frequent Contributor
  • **
  • Posts: 306
  • Country: us
  • Available for embedded projects.
    • My public libraries, code samples, and projects for STM8.
Re: I am staring at a PIC16F57 chip...
« Reply #1 on: January 22, 2019, 03:57:45 pm »
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
Currently developing STM8 and STM32. Past includes 6809, Z80, 8086, PIC, MIPS, PNX1302, and some 8748 and 6805. Check out my public code on github. https://github.com/unfrozen
 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: I am staring at a PIC16F57 chip...
« Reply #2 on: January 22, 2019, 05:03:24 pm »
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.  :)
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: I am staring at a PIC16F57 chip...
« Reply #3 on: January 22, 2019, 05:24:46 pm »
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.  :)
That 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?
 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: I am staring at a PIC16F57 chip...
« Reply #4 on: January 22, 2019, 05:39:28 pm »
What can it do other than flashing a LED? Anything more it can do?
1x 8-bit counter/timer.... Probably lots of things... possibly the landing system on a moon lander?  ;)
 
The following users thanked this post: cobusve

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7369
  • Country: nl
  • Current job: ATEX product design
Re: I am staring at a PIC16F57 chip...
« Reply #5 on: January 22, 2019, 05:40:21 pm »
Here is a programmer for it.
http://urriellu.net/en/projects-electronics/pic3prog-pic-programmer-parallel-port.html
If 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.
« Last Edit: January 22, 2019, 05:43:00 pm by NANDBlog »
 

Online Bud

  • Super Contributor
  • ***
  • Posts: 6905
  • Country: ca
Re: I am staring at a PIC16F57 chip...
« Reply #6 on: January 22, 2019, 06:00:20 pm »
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.
Facebook-free life and Rigol-free shack.
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: I am staring at a PIC16F57 chip...
« Reply #7 on: January 22, 2019, 07:00:38 pm »
Here is a programmer for it.
http://urriellu.net/en/projects-electronics/pic3prog-pic-programmer-parallel-port.html
I already have a genuine PICkit 3 and a DIY PICkit 2, no need for that programmer.

If 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.
JLCPCB offers free shipping to Shanghai for their $5 PCB. I would just have them made boards for me instead.

I know a guy who has the assembler for it, it is only 4 floppy drives.
I also already have MPLAB X and XC8 on my workstation.

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.
My local library (Shanghai Library Changning Branch) does not have a good selection of that type of magazines.

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.
I don't have their address since I bought it on my phone. Also I think this "free shipping" stuff is their black friday special.

What can it do other than flashing a LED? Anything more it can do?
1x 8-bit counter/timer.... Probably lots of things... possibly the landing system on a moon lander?  ;)
Are you sure? :P

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.
My chip here is a PIC16F57, not '16F684...
 

Online Bud

  • Super Contributor
  • ***
  • Posts: 6905
  • Country: ca
Re: I am staring at a PIC16F57 chip...
« Reply #8 on: January 22, 2019, 07:06:51 pm »
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.
Facebook-free life and Rigol-free shack.
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3143
  • Country: ca
Re: I am staring at a PIC16F57 chip...
« Reply #9 on: January 22, 2019, 07:09:28 pm »
You can make its copy in FPGA, and then use the real chip to validate your design

Or 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 ...
 

Offline hans

  • Super Contributor
  • ***
  • Posts: 1637
  • Country: nl
Re: I am staring at a PIC16F57 chip...
« Reply #10 on: January 22, 2019, 08:03:21 pm »
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.
« Last Edit: January 22, 2019, 08:04:54 pm by hans »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12855
Re: I am staring at a PIC16F57 chip...
« Reply #11 on: January 22, 2019, 08:47:00 pm »
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.
 

Offline KL27x

  • Super Contributor
  • ***
  • Posts: 4099
  • Country: us
Re: I am staring at a PIC16F57 chip...
« Reply #12 on: January 22, 2019, 09:19:46 pm »
Quote
I am staring at a PIC16F57 chip...
Take 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.
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7369
  • Country: nl
  • Current job: ATEX product design
Re: I am staring at a PIC16F57 chip...
« Reply #13 on: January 22, 2019, 11:18:34 pm »
Here is a programmer for it.
http://urriellu.net/en/projects-electronics/pic3prog-pic-programmer-parallel-port.html
I already have a genuine PICkit 3 and a DIY PICkit 2, no need for that programmer.
I 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.
 

Online Bud

  • Super Contributor
  • ***
  • Posts: 6905
  • Country: ca
Re: I am staring at a PIC16F57 chip...
« Reply #14 on: January 22, 2019, 11:25:43 pm »
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.
Facebook-free life and Rigol-free shack.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: I am staring at a PIC16F57 chip...
« Reply #15 on: January 22, 2019, 11:52:22 pm »
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?
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14447
  • Country: fr
Re: I am staring at a PIC16F57 chip...
« Reply #16 on: January 23, 2019, 12:02:20 am »
One 8-bit timer, 72 bytes of RAM, and a whopping 2-level stack. You decided to harm yourself? ;D
 

Offline rhodges

  • Frequent Contributor
  • **
  • Posts: 306
  • Country: us
  • Available for embedded projects.
    • My public libraries, code samples, and projects for STM8.
Re: I am staring at a PIC16F57 chip...
« Reply #17 on: January 23, 2019, 02:16:37 am »
One 8-bit timer, 72 bytes of RAM, and a whopping 2-level stack. You decided to harm yourself? ;D
That 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.
Currently developing STM8 and STM32. Past includes 6809, Z80, 8086, PIC, MIPS, PNX1302, and some 8748 and 6805. Check out my public code on github. https://github.com/unfrozen
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12855
Re: I am staring at a PIC16F57 chip...
« Reply #18 on: January 23, 2019, 03:15:30 am »
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.
 
The following users thanked this post: NivagSwerdna

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 7727
  • Country: ca
Re: I am staring at a PIC16F57 chip...
« Reply #19 on: January 23, 2019, 04:11:42 am »
 :scared: Arrrrrrrrrrrrrrrggggggggggggggg!!!!!!  :scared:

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.
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: I am staring at a PIC16F57 chip...
« Reply #20 on: January 23, 2019, 02:47:18 pm »
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.
The 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.

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.

I 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.

:scared: Arrrrrrrrrrrrrrrggggggggggggggg!!!!!!  :scared:

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.

*sigh*

The lack of interrupts of all things made it a bit tough for me to use really.
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 4766
  • Country: nr
  • It's important to try new things..
Re: I am staring at a PIC16F57 chip...
« Reply #21 on: January 24, 2019, 10:27:20 am »
That is a great chip! With 72bytes ram and 2kx12 flash you can do almost everything :)

For 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.php

I built several mods of the both above with 16f84/628 and used for decades as my metrology level stuff :)

And there are hundreds of apps for pic16f84/628 and friends which can be flashed in easily. You may play with the chip for months :)
« Last Edit: January 24, 2019, 10:36:40 am by imo »
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: I am staring at a PIC16F57 chip...
« Reply #22 on: January 24, 2019, 11:13:31 am »
That is a great chip! With 72bytes ram and 2kx12 flash you can do almost everything :)

For 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.php

I built several mods of the both above with 16f84/628 and used for decades as my metrology level stuff :)

And there are hundreds of apps for pic16f84/628 and friends which can be flashed in easily. You may play with the chip for months :)
Oof L-C meter with this...

I was on the edge of building a RLC meter using STM32F303, maybe that was a severe overkill then.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12855
Re: I am staring at a PIC16F57 chip...
« Reply #23 on: January 24, 2019, 12:21:08 pm »
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. 
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 4766
  • Country: nr
  • It's important to try new things..
Re: I am staring at a PIC16F57 chip...
« Reply #24 on: January 24, 2019, 01:17:41 pm »
15y
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.
Yes, 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.php

C-compiler: the best C compiler I ever had for these smallest pics is this one
http://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).
« Last Edit: January 24, 2019, 02:33:38 pm by imo »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf