Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

16F628 projects?

Status
Not open for further replies.

epilot

Member
hi there after some of post about 16F84 PIC some of friends here invented me using from 16F628 and today i got a few but can not fond any circuit or project with them in the net!?
does anyone know any link please?

i will check tomorrow but before can someone please tell me if 16f628 pins are the same with 16f84? it seems they are not?

thanks
 
Nigel Goodwin said:
Check my tutorials, they use the 16F628 - the 16F628 is a direct pin for pin replacement for the 16F84 (or the even older 16C84).

i have a program based 16F84 and i used 16F628 instead, the pic becames programmed with my pic programmer but it did not work on the circuit!

which part of your tutorial? i cheked it but i could not find any project based 16f628!?

thanks
 
epilot said:
Nigel Goodwin said:
Check my tutorials, they use the 16F628 - the 16F628 is a direct pin for pin replacement for the 16F84 (or the even older 16C84).

i have a program based 16F84 and i used 16F628 instead, the pic becames programmed with my pic programmer but it did not work on the circuit!

You can't just use the same HEX file, you need to reasseble it for the 16F628, the migration document at MicroChip explains the simple steps required.

which part of your tutorial? i cheked it but i could not find any project based 16f628!?
/quote]

See csaba911's post.
 
Nigel Goodwin said:
epilot said:
Nigel Goodwin said:
Check my tutorials, they use the 16F628 - the 16F628 is a direct pin for pin replacement for the 16F84 (or the even older 16C84).

i have a program based 16F84 and i used 16F628 instead, the pic becames programmed with my pic programmer but it did not work on the circuit!

You can't just use the same HEX file, you need to reasseble it for the 16F628, the migration document at MicroChip explains the simple steps required.

which part of your tutorial? i cheked it but i could not find any project based 16f628!?
/quote]

See csaba911's post.


oh thanks Nigel that was what i forgot although i dont know how i can make the Hex or ASM files reusable for 16f628 really?
 
epilot said:
oh thanks Nigel that was what i forgot although i dont know how i can make the Hex or ASM files reusable for 16f628 really?

You can't (easily) alter the HEX files, but it's simple to alter the ASM file and reassemble it - you need to change the GPR start address (0x0C for 16F84 and 0x20 for 16F628), you need to add two lines turning off the comparator module (see my tutorials which all do this), and alter the config fuse settings to be as you want them - not forgetting to change the processor and include names at the top of the assembler file. Then assemble the code, this produces a 16F628 compatible HEX file.

If you've got a short program, then post it (using the CODE button to keep it formatted correctly), and I'll post it back with the required mods.

It's really VERY easy!.
 
Nigel Goodwin said:
epilot said:
oh thanks Nigel that was what i forgot although i dont know how i can make the Hex or ASM files reusable for 16f628 really?

You can't (easily) alter the HEX files, but it's simple to alter the ASM file and reassemble it - you need to change the GPR start address (0x0C for 16F84 and 0x20 for 16F628), you need to add two lines turning off the comparator module (see my tutorials which all do this), and alter the config fuse settings to be as you want them - not forgetting to change the processor and include names at the top of the assembler file. Then assemble the code, this produces a 16F628 compatible HEX file.

If you've got a short program, then post it (using the CODE button to keep it formatted correctly), and I'll post it back with the required mods.


It's really VERY easy!.

thanks Nigel i'll try it and if i had a peroblem then let you know

thanks alot again
 
Hi Guys, First time here :)
I completed this project a few years ago:
https://www.freewebs.com/defxev/player.htm
based on the btc sound algo by Roman Black, but considerable work of my own
went into the project, as speed/playback control was implemented, and there
weren't any methods to load the EEPROM at the time, and I had to write a conversion
program of my own. This was done with a 16f84A, but years later,
I'm having trouble porting it fro the 16f628, or even understanding it at all after
a couple of years programming with C.

I was hoping to use the internal clock of the 16f628, and have a talking
greeting card ready in time for Mother's Day! :D
Any help with this would be greatly appreciated.
Cheers,Art.
 

Attachments

  • sound.zip
    3.5 KB · Views: 439
No takers? I thought it was supposed to be dead easy?

I've tried pasting the 16f628 include file right at the top of my program,
and setting CMCON to 0x07, which is all that I thought the migration involved,
but the generated compiler errors are huge.

Any tips on what I'm not doing?
This source compiles and runs fine for 16f84A.
The frustrating thing is that I've written other programs for the 16f628 that work fine,
it's just been so long since I've touched them. This would probably have been a snap
a couple of years ago.
 
Thanks, I've already gotten it working :)
Once i turned off case sensitivity in the project, the only errors were
bad RAM addresses, and I soon figured it out from the datasheet.
Great that you replied though.

Now I can lower the part count by using internal clock,
internal pullup resistors, and disable MCLR to save another resistor.
Pretty crucial when trying to fit it in a greeting card.
Cheers, Art.
 
This is a nice project. I too used that BTC application. What I did different was to use the program flash memory of the, yes its me and my 24F again, 24F family. This way I got rid of the external EEPROM, its price, its slow speed, and its volume consumption :) Made my own vb app to read from the BTC output of retlw 'xxxxxxxx' and convert them to a series of .pword 0x000000 for the 24F family. The resulting file is included in the MPLAB project as an include so that every time I hit build, the micro would automatically be burned with the 1-bit encoding sound fresh out the oven.

So tell me, how do the asterisks in the words "f**cking" sound, like bleep bleep?
 
Cartman's "F**cking" is censored because the original was recorded from TV in
Australia where it was censored. I could have used a download, but I sort of
wanted it that way so I could show it to a wider audience without offending too many people.

I wrote a program for the Playstation Portable to convert the retlw instructions
to a bin file. It just looked at the hex values that are in the comment at the end of every line.
Then I figured out RB's application produces the same bin file directly,
so it was a waste of time :D

I still like the EEPROM idea, as the next step is to fit it into a pic wafer card so
the whole thing is the size of a credit card.
Also, in a large circuit, it might be desirable to add more EEPROMs on the same I2C bus,
and run the whole thing faster for better sound quality.

Each to his own though. I'm sure your version was done to suit your own needs :)
Cheers, Art.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top