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.

PIC16F628 to PIC16F84

Status
Not open for further replies.

kasamiko

Member
Hi,
Is it possible to use the program intended for PIC16F628 to PIC16F84? If not what should I change?

If this is the code for PIC16F628:
DEVICE 16F628 ' We are using a PIC16F628 (18PIN SMD)
DECLARE XTAL = 20 ' And a 20MHz crystal
CONFIG HS_OSC , WDT_OFF , PWRTE_ON , BODEN_OFF , LVP_OFF , CP_OFF , MCLRE_OFF

is this correct for 16F84?
DEVICE 16F84A ' We are using a PIC16F84 (18PIN)
DECLARE XTAL = 4 ' And a 4MHz crystal
CONFIG XT_OSC , WDT_OFF , PWRTE_ON , CP_OFF , MCLRE_OFF

How about this:
DECLARE HSERIAL_BAUD = 9600 ' Set baud rate to 9600
DECLARE HSERIAL_RCSTA = %10010000 ' Enable serial port and continuous receive
DECLARE HSERIAL_TXSTA = %00100100 ' Enable transmit and asynchronous mode
DECLARE HSERIAL_CLEAR = ON ' Enable Error clearing on received characters

How should I do it on 16F84A?

Thanks
 
kasamiko said:
DEVICE 16F84A ' We are using a PIC16F84 (18PIN)
DECLARE XTAL = 4 ' And a 4MHz crystal
CONFIG XT_OSC , WDT_OFF , PWRTE_ON , CP_OFF , MCLRE_OFF
16F84 can't turn MCLR OFF !!! Maybe you will have a problem if your design is using RA,5 (which 16F84 doesn't have)

This is what I use:
Code:
	list	p=16F84A
	#include	<p16F84A.inc>
	__CONFIG	_CP_OFF & _WDT_OFF & _PWRTE_ON &_XT_OSC
 
The 16F84 is a far inferior chip (and costs a lot more!), unless the 628 program is only using the chip as an 84 you won't be able to replace it with an 84.

In particular the 628 has three more I/O pins, an internal oscillator, internal comparators, a USART, twice the program memory, more GPR's.

As long as none of those are used it willbe simple to replace with an 84.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top