luis wrote : > I=B4m starting to change the mid range family 16Fxxx for the=20 PIC18F4520. > In my first attempt, I will use the internal oscilator and=20 > the pins osc1 and osc2 like I/O. > Well, I didn=B4t do this work yet.=20 > I get the manual section 23.0 page 249. > Just to start with, and using asm language, I would like to=20 > get a simple example how to initialize the configuration word. First, the latest MPLAB has introduced a new method to specify the config parameters. Check the readme file for MPASM in that kit. This new method is oly for the PIC18 line. Well, maybe for the dsPIC30 also, I'm not sure... So the actual syntax is depending on if your're using the latest MPLAB (7.20 if I'm not wrong). Now, I think the old syntax still works, but since you're right in the middle of a family switch anyway, you can just as well start with the new syntax (which is simpler to use). >From the MPASM readme file : "The __CONFIG directive has been deprecated for all other PIC18 devices. A warning will be issued if the __CONFIG directive is used with one of these devices. Use the CONFIG directive instead." Also see the last part of P18F4520.INC (still, if you have at least MPALB 7.20 installed). And at last, look up the CONFIG (*not* __CONFIG !) in the online help for MPASM. In there there is an example thet looks like this : #include p18f452.inc ;Include standard header file ;for the selected device. ;code protect disabled CONFIG CP0=3DOFF ;Oscillator switch enabled, RC oscillator with OSC2 as I/O pin. CONFIG OSCS=3DON, OSC=3DLP ;Brown-OutReset enabled, BOR Voltage is 2.5v CONFIG BOR=3DON, BORV=3D25 ;Watch Dog Timer enable, Watch Dog Timer PostScaler count - 1:128 CONFIG WDT=3DON, WDTPS=3D128 ;CCP2 pin Mux enabled CONFIG CCP2MUX=3DON ;Stack over/underflow Reset enabled CONFIG STVR=3DON Jan-erik. >=20 > Anybody could help me >=20 > Thanks in advanced. >=20 > Luis F. > --=20 > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist >=20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist