Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 29th May 2009, 10:34 PM   #1
Default ...Config lines for PIC16F88 (ASM)

Hi...

I've been writing in assembler for the PIC16F84 for a while and then, switched to C.

Now, i have to write an assembler code, but for the PIC16F88 rather than the F84.

The problem i have is that the PIC16F88 has TWO config registers (CONFIG1 and CONFIG2) instead of one for the F84. For the F84 the line is simply:

__CONFIG 0xFFF1 (example)

But for the F88, i can't do anything. I tried:

__CONFIG1 0xFFE4
__CONFIG2 0xFFFE

__CONFIG 1 0xFFE4
__CONFIG 2 0xFFFE

__CONFIG 1,0xFFE4
__CONFIG 2,0xFFFE

...etc... and MPASM always reported me errors !

Does anyone know how to correctly address those two CONFIG registers ?

Thanks !

Normand Martel
St-Hubert (Montreal) Qc. Canada
Martel is offline  
Old 29th May 2009, 10:56 PM   #2
Default

I found a way to work around with my CONFIG problem:

In PIC16F88.INC, i found those two lines:

_CONFIG1 EQU H'2007'
_CONFIG2 EQU H'2008'

So i tried:

__CONFIG _CONFIG1,0xFFE4
__CONFIG _CONFIG2,0xFFFE

w/o success. I don't know why !

I finally went with:

__CONFIG 0x2007,0xFFE4
__CONFIG 0x2008,0xFFFE

And my code finally assembled !

But i still don't know why the EQU lines are not recognized !

Normand Martel
Martel is offline  
Old 29th May 2009, 11:21 PM   #3
Default

Here's the way I do it (no defines required as they're all in the 'include' file);

Code:
    __CONFIG  _CONFIG1, _DEBUG_OFF&_LVP_OFF&_BODEN_OFF&_WDT_OFF&_HS_OSC
    __CONFIG  _CONFIG2, _IESO_OFF&_FCMEN_OFF
Mike, K8LH is offline  
Old 30th May 2009, 04:43 AM   #4
Default

I like Mikes way to it is so easy to type the wrong hex in a config
Quote:
But i still don't know why the EQU lines are not recognized !
post your code it would be easier to help if we can see it
be80be is offline  
Old 30th May 2009, 11:38 PM   #5
Default

That's why those include files have all those defines =) To avoid the confusion, it also helps with porting to other chips which might have slightly different address structure.
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."
Sceadwian is online now  
Old 31st May 2009, 11:13 AM   #6
Default

My code is an application for AES on the PIC16F84:

Implementing AES using PIC16F84 The Hardware Side of Cryptography

that i want to modify to have it work on the F88.
Martel is offline  
Reply

Tags
asm, config, lines, pic16f88

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
PIC16F88 sleep bananasiong Micro Controllers 3 25th December 2007 09:04 AM
Pic16f88 Mark (Imagine Design) Micro Controllers 5 6th June 2006 10:21 PM
PIC16F88 questions HarveyH42 Micro Controllers 14 11th May 2006 07:05 AM
How to use all pins on PIC16F88? adamthole Micro Controllers 4 6th March 2006 04:53 AM
howto config the lvp bit in config fsr anojm Micro Controllers 6 24th November 2005 10:53 AM



All times are GMT. The time now is 05:28 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker