Log in

View Full Version : 16F84 to 16F648A program converter



camerart
- 7th January 2013, 22:45
Hi All,

My first post.

I want to make a morse decoder, that will change radio morse signals to a display screen, also a a second one where I can type a letter and convert to morse for sending via radio.

I have circuits and programs that use 16F84 chips (which I have), but setting the programming programs on the computer is proving a bit difficult, and I would rather use 16F648A or 16F819 chips, as I can program them, and am set-up for them.

If anyone can help I would appreciate it.

Cheers, Camerart

Archangel
- 8th January 2013, 03:41
Hi camerart,
add cmcon = 7 into the top area of your code. Should be all you need to change as the 16F648 has analog comparators and the 16F84 does not. (working' from memory here)

camerart
- 8th January 2013, 08:52
Hi camerart,
add cmcon = 7 into the top area of your code. Should be all you need to change as the 16F648 has analog comparators and the 16F84 does not. (working' from memory here)

Hi Archangel,

Thanks. When I said I have the programs, I meant programs for the 16F84. I have attached one. I need to either study and understand it, or convert it somehow to PIC basic for 16F648A. Quite a task, especially from memory :)

Cheers, Camerart.

Sherbrook
- 8th January 2013, 11:53
Hi camerart

Have a look at Nigel Goodwins WinPicProg PIC Tutorial http://www.winpicprog.co.uk/pic_tutorial.htm
Tutorial 1 shows how to turn off comparators and make PIC like a 16F84

movlw 0x07
movwf CMCON ;turn comparators off (make it like a 16F84)

Phil

camerart
- 8th January 2013, 21:51
Hi Phil,

Thanks, I had a look, but I prefer in this case if someone can decode the program I attached, which is already proven, and goes straight into the circuit. I don't want to have to do R and D.

Camerart.



Hi camerart

Have a look at Nigel Goodwins WinPicProg PIC Tutorial http://www.winpicprog.co.uk/pic_tutorial.htm
Tutorial 1 shows how to turn off comparators and make PIC like a 16F84

movlw 0x07
movwf CMCON ;turn comparators off (make it like a 16F84)

Phil

Art
- 25th May 2013, 17:03
And again, add this to the source code you posted (after it's init label) :


movlw 0x07
movwf CMCON

Research and development is over! def works with 16F628/A.
Don't know how you're going to get on when you come to actually having to do some.


Quite a task, especially from memory

Yes, adding two instructions of spoon fed code is much more difficult
than porting an entire program from a low level language to a high level one!

camerart
- 25th May 2013, 21:14
And again, add this to the source code you posted (after it's init label) :


movlw 0x07
movwf CMCON

Research and development is over! def works with 16F628/A.
Don't know how you're going to get on when you come to actually having to do some.

Yes, adding two instructions of spoon fed code is much more difficult
than porting an entire program from a low level language to a high level one!

Hi ART,

Do I detect a hint of sarcasm?

Actually, my answers are after many years of trying to learn to be expert in PIC programming, but I'm afraid age has caught me up and it is really difficult for me.

What you ( and previous messages) say is probably true and I'll try it.

Thanks, Camerart.

Art
- 26th May 2013, 01:28
Of course.
You can probably get the chip as a free sample, build the project with an 18 pin (or whatever) IC socket,
and you have nothing to lose.

camerart
- 26th May 2013, 09:42
Of course.
You can probably get the chip as a free sample, build the project with an 18 pin (or whatever) IC socket,
and you have nothing to lose.

Which chip? I have 16F84, but nothing to program them, and 16F648A with simulator, compiler and programmer.

I looked at the code I posted in #3, and realised, I didn't pose the original question correctly. I don't know how to use this type of code, only Qbasic, I hoped for a Qbasic program from the code I posted, then I could understand and alter things if needed. With my system I write Qbasic and the simulator compiles it to .LST and .ASM and .HEX. The programmer uses the .HEX file to program. So even if I changed the code I posted, I then couldn't program it to the chip.

I have PICSIMULATORIDE simulator and PICKIT 2 programmer.



Cheers. Camerart.

Art
- 26th May 2013, 12:05
Microchip's RISC asm was free last I got it.
That code should compile in the MPLAB development environment they provide for free.
It's not a language you want to jump into straight up, but to insert two lines of code, yes.
They also provide free sample chips from their site, and I think 16F628 is on the list
so long as you can write to them.

camerart
- 26th May 2013, 14:40
Ok, I will add it.

I searched for init, but couldn't tell which one was the correct one, or do you mean at the beginning, under the 5 *****?

Thanks, Camerart.

Art
- 27th May 2013, 01:36
Straight after this:


init movlw 0x04 ; divide XTAL OSC by 4 and then 32 for 4ms ticks
option ; later, load TMR0 with 256-140 and let overflow

camerart
- 27th May 2013, 09:17
Thanks for your patience Art.

Camerart.

muhammadbilal
- 1st April 2014, 17:01
hi.please help me because i have a moving message display but i lost eeprom programe file so please you help me so i start it .i hope you help me?