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.

convert from 16c84 to 16f628a need help

Status
Not open for further replies.
Dear good morning, with the 16f84a the board works, with the 16f628a it doesn't, I made the various suggested changes, but it still didn't work, I'm not giving up, but I'm almost discouraged, I thought it wouldn't be so complicated.
 
If your using I think RA4 as output it can only sink power on the 16F628
the 16F84 could sink and source power on that pin
 
Also, the 16F84 has only one block of RAM (in bank 0) that is mirrored in bank 1. So any reference to the GPR's from bank 1 will have to be changed.

Also, what does "still didn't work" mean? I would be inclined to add simple debugging code: turning on an LED attached to one of the pins to find out when sections get processed or not.
 
Friends, I say it didn't work because I'm recording and sticking on the repeater board and it doesn't do the basic function of receiving the COR signal and triggering the PTT of the Transmitter and triggering the Bip, the board with the old 16f84 works all normal these functions, I record the 16f628A and skewer on the board and it doesn't do these basic functions, as if the board was dead, I used 3 units of 16f628A to make sure it's not a defect in the microcontroller, but to no avail.
 
I notice one difference in the EEPROM write routines between the 84 and the 628a, in the datasheets. For the 628a, they changed the order of a couple of lines, and then loop testing if GIE is actually clear before continuing with the EEPROM write (section 13.4 of datasheet). Similar changes for reading EEPROM on the 628A
 
Also... Your code hasn't been modified to allow for the change in banks between EEADR and EEDATA.

Both are now in Bank 1 and were in bank 0 on the latter chip.. Your code is trying to acces location 0x1B and it needs to go to 0x9B Banksel EEADR...
 
I suppose it makes sense to move to a less antique device?, however moving to the 'almost as old' 16F628 isn't much of a step forward - but 'should' be a pretty trival change, as the differences are very small.
I don't want to get into an argument on someone else's thread, or take away from him getting help...But a device that works is a device that works. I don't see a reason that it *must* be upgraded.
 
I don't want to get into an argument on someone else's thread, or take away from him getting help...But a device that works is a device that works. I don't see a reason that it *must* be upgraded.
To make it a far more useful and 'modern' project - not to mention considerably cheaper, as the old PIC's while currently still available have punishing prices. Personally, while I've got both 16F84's and 16C84's, finding them would be a different matter :D
 
Dear good afternoon, the conversion to the 16f628 was that I don't have any more parts from the 16f84, in Brazil it's hard to find so I was presented with some parts from the 16f628. The controller equipment is on top of a hill, subject to lightning strikes, and if you lose that last piece, we'll be down for a long time. I apologize for my ignorance in programming.
 
I have placed a banksel before the first movwf EEADR (just before LPinit ) and removed the one in the EEprog function in the EEPloop... The eeprom then will work.
FRIEND can you send me the code with these changes to test? Thanks again to everyone for the effort, my Amateur Radio spirit is renewed with effective collaboration from everyone, I would like to have the knowledge to be able to share, my knowledge is focused on electronics, in programming I am extremely limited at the moment.
 
Does anyone know if a 628 can use an oscillator like this?
pic.png


Mike.
 
Yes with the EXT_OSC function in Config, I've done that before.

It's much the same as running a TCXO or other oscillator module in to it - one of my current 16F628A based Frequency counters is run that way with an external oscillator reference.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top