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.

16F84A urgent

Status
Not open for further replies.

iceman83

New Member
hi! I am working on a porject and I have a very simple problem on programming PIC16F84A. I cannot write any information on the OPTION_REG(81H) and TRISA(85H) registers since they are out of the scope of movlw command. by using movlw command I can only write to addresses from 0x00 to 0xFF. how can I write on OPTION_REG? Please urgent!
 
Hi
First with "movlw" you cant write to any register exept the wreg !

IF you can write to address 0x00 to 0xff than why cant you write to 0x81 and 0x85, they are lower than 0xff !!?
I gues you need to select BANK1

Read the data sheets for more info !
Here is the part you should look in to.

Data memory is partitioned into two banks which
contain the general purpose registers and the special
function registers. Bank 0 is selected by clearing the
RP0 bit (STATUS<5>). Setting the RP0 bit selects Bank
1. Each Bank extends up to 7Fh (128 bytes). The first
twelve locations of each Bank are reserved for the
Special Function Registers. The remainder are General
Purpose Registers implemented as static RAM.

Good luck.

STEVE
 

Attachments

  • banks.gif
    banks.gif
    39.3 KB · Views: 583
Check my tutorials, every one writes to the TRIS registers, as 'csaba911' says, you simply have to select bank 1.

Are you also aware that the 16F84 has been obselete for years?, unless you've got an old box full of them you shouldn't really use them for new projects. It's replacement was the 16F628 - higher spec, less money, and was the chip chosen for my tutorials.
 
Nigel Goodwin said:
Are you also aware that the 16F84 has been obselete for years?.

It's not yet obsolete, the 16F84A is still supported by microchip and can still be ordered from them. However, the 16F84A is US$3.42 compared to the 16F628 at US$1.61 and of course, the 628 is a far superior chip.

So, technically not obsolete, but as you rightly pointed out, the 628 is definitely the right choice for any new stuff.

Mike.
 
Pommie said:
Nigel Goodwin said:
Are you also aware that the 16F84 has been obselete for years?.

It's not yet obsolete, the 16F84A is still supported by microchip and can still be ordered from them. However, the 16F84A is US$3.42 compared to the 16F628 at US$1.61 and of course, the 628 is a far superior chip.

So, technically not obsolete, but as you rightly pointed out, the 628 is definitely the right choice for any new stuff.

MicroChip still have limited stocks of it, presumably back from when they last made them?. But they listed it as 'not recommended for current designs' many years ago, when it was replaced by the 628. The list price reflects it's non-current status.

Prehaps you would prefer the term 'obsolescent' rather than 'obselete' 8)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top