View Full Version : Configuration of 18F268x
Mike2545
- 30th September 2011, 16:33
I am currently working on a project with an 18F4550. 32k seemed like it would be enough program memory :rolleyes:... I purchased some 18F2682, 18F2680 and 18F2685, because of their enormous program memory. However, simple Serin2 & Serout2, SDA & SCL do not work.
I did set the OSC in the 18F2680 as such
INCLUDE "P18F2680.INC" ; MPASM Header
__CONFIG _CONFIG1H, _OSC_IRCIO67_1H
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
__CONFIG _CONFIG3H, _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
__CONFIG _CONFIG4L, _LVP_OFF_4L
NOLIST
But even such statements like PORTB.1=1 do nothing...
I have the INCLUDE "ALLDIGITAL.pbp"
Any help would be great.
Mike
Darrel Taylor
- 30th September 2011, 22:19
Are you writing in assembly language or PicBasic Pro?
If PicBasic Pro, you should not include the MPASM header.
Since MCLRE is ON, do you have a pull-up resistor on the MCLR pin?
Mike2545
- 30th September 2011, 23:00
Are you writing in assembly language or PicBasic Pro?
If PicBasic Pro, you should not include the MPASM header.
Since MCLRE is ON, do you have a pull-up resistor on the MCLR pin?
I am writing the program in PicBasic Pro... the above [code] is from the PBP file in my C drive.
Yes I have a pull up resistor/diode on my MCLR
Darrel Taylor
- 1st October 2011, 01:10
Oh, you're modifying the 18F2680.inc file in your PBP folder, of an older version of PBP.
_OSC_RCIO_1H is for an external RC oscillator.
Do you have a resistor/capacitor circuit on your OSC pin?
Or did you really want the Internal oscillator?
_OSC_IRCIO67_1H
You should also have _XINST_OFF_4L since PBP cannot use the extended instruction set.
Try them like this ...
__CONFIG _CONFIG1H, _OSC_IRCIO67_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
__CONFIG _CONFIG3H, _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
__CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _BBSIZ_1024_4L & _XINST_OFF_4L
Don't forget to set the OSCCON register or it will be running at the default 1Mhz.
Mike2545
- 1st October 2011, 01:26
Thank you, Thank you, & Thank you! Worked like a charm, I just moved some ports around and it took right off.
Could you help me out with the Config fuses for the 18F2682 and 18F2685 while we are at it? :rolleyes:
Darrel Taylor
- 2nd October 2011, 03:17
I think they will be the same.
But you might want to verify them in the bottom of the P18F2682.inc and P18F2685.inc files in your C:\Program Files\Microchip\MPASM Suite folder.
C:\Program Files (x86)\Microchip\MPASM Suite - for 64-bit systems.
Mike2545
- 2nd October 2011, 18:02
Ah yes...Nice to have the elbow room of 96K (program memory). At least this way I can start big and choose the correct size after I am done. Thanks again for your help.
I have been getting better at finding just such information in the 400+ page data sheets:rolleyes:
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.