![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
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 | |
| |
| | #2 |
| 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 | |
| |
| | #3 |
|
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
| |
| |
| | #4 | |
|
I like Mikes way to it is so easy to type the wrong hex in a config Quote:
| ||
| |
| | #5 |
|
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." | |
| |
| | #6 |
|
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. | |
| |
|
| 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 |