16F84 to 16F628A help needed

Status
Not open for further replies.

stamiher

New Member
Hi all,
my name is Stamatis and i'm from Heraklion-Crete, Greece.
I am totaly new here in this forum and in the world of PIC's
although i do have a advanced understanding in analog and HF electronics.

I am searching here for some help from PIC-Cracks to jumpstart.

My Problem is, that i've builded up a 16F84 based darkroom timer and can't programm the PIC.
The schematic was published in 2001 by Elektor.
As said above it was based on the 16F84.
The magazine can not provide the chip anymore and as i searched through the internet i found out that the chip is obsolete and was replaced last century by better chips.
So i bought some of the recommended 16F628A's.
I need to migrate the 16F84-code to the 16F628A.
So far i have read that i need to change some bits to make it work.
I always read that is easy done but i always get errors.
The original programm was programmed in JAL.
Elektor has provides the .asm and the .hex files on their webpage as free download.
I have downloaded the datasheets for both Pics and i'm more confused than before.
So far i know that need to change the memory adress, disable the comparators which are set by default in the 16F628A.
I also would like to use the internal 4 MHz oscillator of the 16F628A to save the crystal and the capacitors needed in the 16F84.

If i am not mistaken i need to do the following steps:

1.Disassemble the original .HEX file or use the original .ASM file

2.Add the two extra lines to disable the comparators

MOVLW 0x07
MOVWF CMCON


3.Set the fuses right (to use the internal oscillator)

4.Reassemble with MPASM

So far i am stucked on step 2 because i really don't know where EXACTLY i need to put the extra lines.
I made some attempts but at he end the MPASM always finds errors.

What am i doing wrong ?

Thank you in advance for your help.


Stamatis
-----------------------------------------
Here is the original HEX File.

:10000000FF308E008F009000FF309200D8208C10BF
:10001000D2208C10CC208C10C6208C10C0208C14C8
:10002000BA208C14B4208C14AE208C14A820920119
:10003000930194018C100C118C11A1208C119D2026
:100040008C1199208C119520061A27280C150C1D4F
:100050002D28061E2D288C140C118C184C288C155C
:10006000A120013095007F20050892008C11A1206D
:100070008C159D20013095007F20050893008C1180
:100080009D208C159920013095007F200508940053
:100090000310940D8C1199208C1C68288C159520C8
:1000A00001301202031C57281208950078200130F5
:1000B0001302031C5E2813089500712001301402FE
:1000C000031C6528140895006A208C108C1195205B
:1000D0002428692815089600FA309700C83098003F
:1000E00086281508960064309700643098008628AA
:1000F00015089600643097000A3098008628150885
:1001000096006430970001309800862817089A00FE
:10011000160899001730FF3E03188B28990B8A2880
:100120009A0B8828980B8628080091118C19911534
:10013000A52811118C191115A52891108C1991144D
:10014000A52811108C191114A52811088600080083
:100150008C1CAC288F17AD288F13DC288C1CB22880
:100160000F17B3280F13DC288C1CB8288F16B9285A
:100170008F12DC288C1CBE280F16BF280F12DC281B
:100180008C1CC4288F15C5288F11DC288C1CCA280C
:100190000F15CB280F11DC288C1CD0288F14D128E8
:1001A0008F10DC288C1CD6280F14D7280F10DC28C1
:1001B00012088E00650008000F0866000800DF289E
:02400E00F13F80
:00000001FF
 
I notice that the article is published in April2001.
the source code is an asm derived from JAL. i hoped to see a pure .asm file, but unlucky.

Instead of the struggle to swap to F628A, why not implement on F84A?
 
Last edited:
Hello Sarma,
thanks for your reply.

You are right.
The article was published in april 2001.
This timer suits my needs very well.

I purchased the 16F628A because an all articles i found for migrating from the 16F84 to a newer PIC, this was the one which was the more up-to-date for todays purposes, because it is pin compatible and so on...
I have it already sioi will try to migrate to this chip.

I will upload the original .ASM file
but i must split it in two parts because it is to big to post it here directly,


Thank you.

Regards

Stamatis
 
I will upload the original .ASM file
but i must split it in two parts because it is to big to post it here directly,

Thank you.

Regards

Stamatis


hi,
You can 'attach' an asm file... use the 'manage attachments' lower down the 'Post Reply' page... very easy..
 
Last edited:
OK.
Here is the ASM File.

Thank you Eric for the hint !!
 

Attachments

  • duka_jal.asm
    28.9 KB · Views: 191
Last edited:
OK.
Here is the ASM File.

Thank you Eric for the hint !!

hi,
Looked at your file.
The 628A user registers start at 0x20 and for the F84 0x0C.

These registers need to be moved from below 0x20 for the F628.

Where did you get that disassembly listing.?
 
Hello Eric,

the disassembly listing is on the magazines site for free download.

**broken link removed**
 
Hello Eric,

the disassembly listing is on the magazines site for free download.

**broken link removed**

hi.
Looked at that website, you have to give out your email address before you can download, I dont want to pass my email address around.

Tell me which pins on the 16F84 are inputs and outputs.
 
I've uploaded the schematic and the provided files on a single .zip file.
There you can see which pin is in- or output.

Thank you all for your help.


@mvs sarma,
right now i am building the PCB.
I will test it in a few hours when i'm ready.
After the initial test i can give you more info if the code works.
Thank you very much for your help.
 

Attachments

  • Darkroom.zip
    2.3 MB · Views: 211
Last edited:
hi.
Looked at that website, you have to give out your email address before you can download, I dont want to pass my email address around.

Tell me which pins on the 16F84 are inputs and outputs.
here is the schematic. Perhaps, you can simplify the whole thing i hope.
 

Attachments

  • timer94a.PNG
    72.4 KB · Views: 258
Last edited:
hi Sarma,
Many thanks.
There is an issue, BCD switches setting is a problem in darkness, as there is no safe light (red) like in the olden days B&W prints exposing and development.
appears the O P has taken up a weak project.
 
The whole circuit is imho not bad.
I will not use it as a darkroom timer but as a precision timer for inflating balloons for my wife.
She is into this business.
So the issue for the BCD switches in low light conditions does not apply to my actual needs.

@mvs sarma,
would it be to much to ask you for a version of the code for use with the internal osc?
PLEEEEAAAASE ???!!!??!!
 

What time delay ranges do you want for inflating balloons.?
 
The range depends not only on the time but also on the provided pressure.
If you have a timer with 0,1 sec accuracy you are ok.
You can then also adjust the input pressure and the end result is perfect.
The timing must be adjustable to inflate different balloon sizes.
The size of the balloons ranges usually from 5" to 3 feet in diameter.
With this timer we want to inflate balloons from 5" to 12" diameter.
For this balloon sizes i aim a inflating time range from 2 sec to 5 sec , and with a input pressure below 80 psi (5,5 Bar).under
The output pin of the PIC will control a 230VAC valve through a Sharp S201S02.
I forgot to mention that i will stay under 10 sec.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…