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.

migrating code 16F84 ==> 16F628A

Status
Not open for further replies.

whiz115

Member
How is it done?

I only now that i have to shut off the comparators which are in default enabled on 16F628A, the code for this job is:

MOVLW 7
MOVWF CMCON

then i have to adjust some GPR registers which on 16F628A start at 20h and on 16F84 at 0Ch.

is this can be done by adding the following line in a 16F84 code?

CBLOCK 0x20 ; Declare variable addresses starting at 0x20

if not pls give me advices because i have lot's of code to migrate to the microntroller i'm using.

thanks!
 
You've got the two main changes. The other thing that will not work is any EEPROM code as the registers are at a different address. You can also get problems with the additional ram in the 628, on the 84 the bank you in doesn't matter for ram access - for the 628 it does. This last problem is very rare and would require the original code to be poorly written.

What does the code actually do?

Mike.
 
whiz115, besides the mentioned changes, you have to care about configuring the PIC16F628A properly. This PIC have a few extra configuration bits. You'll probably want to disable the LVP mode. Also, you could use the internal oscillator and you'd have to set the configuration word accordingly.
 
mostly i want to migrate code from 16F84... :rolleyes:

one thing is what Gayan Soyza said, and i REALLY must find a way
to do it and next thing is the code i'm attaching...

Author says:

---- Legal stuff ----
PIC-Tetris (C) Rickard Gunιe. This is open source, use this at your own risk ! You may use the information on
this page for your own projects as long as you refer to the original author (by name and link to authors
homepage), don't do it for profit and don't hurt or harm anyone or anything with it. The author can not be
held responsible for any damage caused by the information on this and related pages
.


so i guess there isn't any problem uploading it here or altering it for my needs a bit... :D
 

Attachments

  • tetris.asm
    27 KB · Views: 256
Last edited:
I got the Tetris program working fine, both these programs are pretty rigid and not sure how well they'd port as they use instruction timing and what not to get the picture on the TV to sync properly. Not sure why tetris wouldn't work if pong works for you, I just swap out the PIC on my board and it works for me.
 
Oh, sweet memory of nearly three years ago!

Just rename the file tetris_F628A.txt into one with .HEX extension and load it into a F628A for it to work.
 

Attachments

  • Tetris.jpg
    Tetris.jpg
    26.5 KB · Views: 302
  • tetris_F628A.asm
    28 KB · Views: 266
  • tetris_F628A.txt
    6 KB · Views: 271
eblc1388 said:
Oh, sweet memory of nearly three years ago!


very nice eblc1388... but where's your joysticks? :D thanks for your help! (and the other guys too..)
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top