If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Well, at maximum I presume ? actually I don't really understand what they mean exactly in that part of the datasheet, I would belive that I set one speed on the oscillator, and then the PLL multiplies it ? then 8x4 would give 32Mhz ? ..Ofcourse that would give me troubles to get excactly 20Mhz then, but still, it would work I think ? (but for exampe, "pause 1000" would not be one second)
Anyway, I could use another clock frequency too, the main reason to use 20Mhz is that I tried the same program on a 16f PIC with no internal oscillator, and then I used a 20Mhz xtal.
I simply wrote:
@ __CONFIG _CONFIG1H, _OSC_INTIO67_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
with no comment at all..
I don't have an 18F2520 to test this on, but give this a try;
Code:asm __CONFIG _CONFIG1H, _OSC_INTIO67_1H & _FCMEN_OFF_1H & _IESO_OFF_1H __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H __CONFIG _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_OFF_3H __CONFIG _CONFIG4L, _STVREN_OFF_4L & _LVP_OFF_4L & _XINST_OFF_4L endasm DEFINE OSC 32 ' internal 8MHz x 4 with PLL enabled blueled var LATB.4 ' prevents read-modify-write redled var LATB.5 ' problems OSCTUNE = %0100000 ' turn on PLL for 4 x 8MHz OSCCON = %01110000 ' set 8MHz internal osc ADCON1 = %00001111 ' disable all A/D main: low redled low blueled pause 500 high redled pause 500 high blueled pause 500 goto main END
bruce:
I get this..
Warning[230] C:\PBP\LTIMERT3.ASM 64 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Error[113] C:\PBP\LTIMERT3.ASM 64 : Symbol not previously defined (_OSC_INTIO67_1H)
Warning[230] C:\PBP\LTIMERT3.ASM 65 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Warning[230] C:\PBP\LTIMERT3.ASM 66 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Error[113] C:\PBP\LTIMERT3.ASM 66 : Symbol not previously defined (_CCP2MX_PORTC_3H)
Warning[230] C:\PBP\LTIMERT3.ASM 67 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Hi Glenn,
Newer versions of PBP include w = -230 in the .INC file that gets rid of the deprecated
warning.
I.E. a new version .INC file looks something like this if you have the default config settings
commented out.
These are all you have commented out right? What version of PBP are you using?Code:NOLIST ifdef PM_USED LIST "Error: PM does not support this device. Use MPASM." NOLIST else LIST LIST p = 18F2520, r = dec, w = -311, w = -230, f = inhx32 INCLUDE "P18F2520.INC" ; MPASM Header ; __CONFIG _CONFIG1H, _OSC_INTIO67_1H & _FCMEN_OFF_1H & _IESO_OFF_1H ; __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H ; __CONFIG _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H ; __CONFIG _CONFIG4L, _STVREN_OFF_4L & _LVP_OFF_4L & _XINST_OFF_4L NOLIST endif LIST EEPROM_START EQU 0F00000h BLOCK_SIZE EQU 64
I'm using 2.50b, and my include looks like:
However, its not the warings that I have problems with, its the errorsCode:;**************************************************************** ;* 18F2550.INC * ;* * ;* By : Leonard Zerman, Jeff Schmoyer * ;* Notice : Copyright (c) 2004 microEngineering Labs, Inc. * ;* All Rights Reserved * ;* Date : 12/31/04 * ;* Version : 2.46 * ;* Notes : * ;**************************************************************** NOLIST ifdef PM_USED LIST "Error: PM does not support this device. Use MPASM." NOLIST else LIST LIST p = 18F2550, r = dec, w = -311, f = inhx32 INCLUDE "P18F2550.INC" ; MPASM Header ;__CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L ;__CONFIG _CONFIG1H, _FOSC_HS_1H ;__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H ;__CONFIG _CONFIG3H, _PBADEN_OFF_3H ;__CONFIG _CONFIG4L, _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L NOLIST endif LIST EEPROM_START EQU 0F00000h BLOCK_SIZE EQU 32![]()
Hmm, strange. I thought the "version 2.46" was a bit suspect, so I looked one time more, and found a "18f2520.inc.org", which probably is the correct file, and the other is something I cut'n'pasted in from someone else ?
That one looks like:
Still bot 2.50b, but 2.47, but maybe the includes only get updated when needed. (sounds logical)Code:;**************************************************************** ;* 18F2520.INC * ;* * ;* By : Leonard Zerman, Jeff Schmoyer * ;* Notice : Copyright (c) 2006 microEngineering Labs, Inc. * ;* All Rights Reserved * ;* Date : 06/05/06 * ;* Version : 2.47 * ;* Notes : * ;**************************************************************** NOLIST ifdef PM_USED LIST "Error: PM does not support this device. Use MPASM." NOLIST else LIST LIST p = 18F2520, r = dec, w = -311, w = -230, f = inhx32 INCLUDE "P18F2520.INC" ; MPASM Header __CONFIG _CONFIG1H, _OSC_XT_1H __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H __CONFIG _CONFIG3H, _PBADEN_OFF_3H __CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L NOLIST endif LIST EEPROM_START EQU 0F00000h BLOCK_SIZE EQU 64
Also I didnt do a clean install, I upgraded from an old version.
Bookmarks