>I'm using a 8MHz crystal. I use the same crystal to drive another PIC
>(PIC16F84A) on my circuit board which is working pretty fine, except that
>when
>i connect this crystal for the PIC18F2220, it seems to do nothing. 'MCLR is
>set
>to 5V, and got capacitor between Vdd and VSS, and got capacitors on ground
>for
>the crystal. So I'm assuming that the problem has something to do with
>registers in the micro. I'm looking for some code examples over the web for
>this micro, but cannot find any. Anybody could provide me a simple code
>example
>in assembler working fine for a PIC18f2220 ? I'm using MPLAB with the
>picstart
>plus programmer...
>
>Thanks in advance!
>
>
>Serge
>
>
>
>
>
>
>
>Selon Mike Hord <
KILLspamgaidinmdKILLspam
HOTMAIL.COM>:
>
> > Near as I can tell, that's a-okay code-wise and config-wise.
> > Looks pretty similar to the code I have for a 2220.
> >
> > All that's left now is to check up on the circuit...
> >
> > Do you have a bypass capacitor between Vdd and Vss?
> > Do you have 'MCLR pulled high?
> > Is your oscillator oscillating?
> > Capacitors to ground on the OSC pins?
> >
> > You MAY be overdriving the crystal...The HS osc setting
> > is usually for higher crystal frequencies; try XT if you have
> > a 4 MHz in your circuit.
> >
> > Mike H.
> >
> > >I been using PIC16F84A with no problem. All i want to do is a simple
> > >program to
> > >light up a led on a port (any ports, A, B or C). It seems like my code
>is
> > >not
> > >working at all, and really don't know what is the mistake, anyone could
> > >help ?
> > >I'm using an external crystal. I'm just not sure about those __CONFIG
> > >lines....
> > >could it be the problem? Or is there any special registers to
>initialise?
> > >
> > >
> > >
> > > list p=18f2220
> > > include "P18F2220.INC"
> > >
> > > __CONFIG _CONFIG1H, _IESO_ON_1H & _FSCM_OFF_1H & _HS_OSC_1H
> > > __CONFIG _CONFIG2L, _PWRT_OFF_2L & _BOR_OFF_2L & _BORV_20_2L
> > > __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_32K_2H
> > > __CONFIG _CONFIG3H, _MCLRE_ON_3H & _PBAD_DIG_3H & _CCP2MX_C1_3H
> > > __CONFIG _CONFIG4L, _DEBUG_OFF_4L & _LVP_OFF_4L & _STVR_OFF_4L
> > >
> > > __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L
> > > __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
> > > __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L
> > > __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
> > > __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L
> > > __CONFIG _CONFIG7H, _EBTRB_OFF_7H
> > >
> > >
> > > org 00000h
> > > goto Start
> > >
> > > org 00020h
> > >Start
> > >
> > > movlw 0x07
> > > movwf CMCON ;turn comparators off
> > >
> > > movlw 0x00
> > > movwf ADCON0
> > > movlw 0x0F
> > > movwf ADCON1 ;initialise ports for digital
> > >
> > > clrf PORTA
> > > clrf PORTB
> > > clrf PORTC
> > >
> > > clrf TRISA
> > > clrf TRISB
> > > clrf TRISC
> > >
> > >Loop
> > >
> > > movlw 0xFF
> > > movwf PORTA
> > > movwf PORTB
> > > movwf PORTC
> > >
> > > goto Loop
> > > END ; directive indicates end of code
> > >
> > >--
> > >
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
> > >email
RemoveMElistservTakeThisOuT
mitvma.mit.edu with SET PICList DIGEST in the body
> >
> > _________________________________________________________________
> > Getting married? Find great tips, tools and the latest trends at MSN
>Life
> > Events. lifeevents.msn.com/category.aspx?cid=married
> >
> > --
> >
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
> > email
spamBeGonelistservspamBeGone
mitvma.mit.edu with SET PICList DIGEST in the body
> >
>
>--
>
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
>email
TakeThisOuTlistservEraseME
spam_OUTmitvma.mit.edu with SET PICList DIGEST in the body