Help for start PIC18 series programming language.

Started by Hasan Arslan November 9, 2004

Hi,

I'm use the PIC12F and PIC16F series MCU i will be upgrate to PIC18 Seres.

I have make sample program with 18F452. But I have a problem whit OSC select.

My program don't work if select XT,HS or HS PLL mode. It work only in RC02RA6 mod but i don't understand why the program not work.

I give a example for this progam, if anybody do program for PIC18 series whit ASM help me. Or give me sample program for 18f Series for understand how i can start it.

 

;********************************************************************

list pF452
#include p18F452.inc

;Program Configuration Registers

;*******??????????????????????????????????????????????????**********

; IF I HERE OPEN THIS FUSE THE PROGRAM DON'T RUN.   WHY ?????

; __CONFIG _CONFIG1H, _OSCS_OFF_1H & _EC_OSC_1H

;*******??????????????????????????????????????????????????**********__CONFIG _CONFIG2L, _BOR_OFF_2L & _PWRT_ON_2L
; __CONFIG _CONFIG2H, _WDT_OFF_2H
; __CONFIG _CONFIG3H, _CCP2MX_OFF_3H
__CONFIG _CONFIG4L, _STVR_OFF_4L & _LVP_OFF_4L & _DEBUG_OFF_4L
__CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L
; __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
__CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L
; __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
__CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L
; __CONFIG _CONFIG7H, _EBTRB_OFF_7Hcblock H'00'

delay1
delay2

endc
ORG 0X000

NOP
goto STARTSTART

MOVLW b'11111111'
MOVWF PORTB ;Set PortB as FOR INPUT

MOVLW B'00000000'
MOVWF PORTC ;SET PortC

MOVLW B'00000000'
MOVWF PORTD ;SET PortDMOVLW B'0111' ;RA ve RE PORTUNU DIJITALE CEVIRIR.
MOVWF ADCON1 ;

clrf TRISA ;Set PortC as output

clrf TRISC ;Set PortB as output

MOVLW b'11110011'
MOVWF TRISB ;Set PortB as FOR INPUT

MOVLW B'00000000'
MOVWF TRISD ;Set PortD as FOR OUTPUT

clrf TRISE ;Set PortC as output
KONTROL

CALL DELAY50

btfss PORTB,0
GOTO LED_AC
GOTO LED_KAPALED_AC

BSF PORTB,3

nop
nop
nop

BCF PORTB,2

GOTO KONTROL

LED_KAPA

BCF PORTB,3

nop
nop
nop

BSF PORTB,2

GOTO KONTROLDELAY50

clrf delay1 ; /R clear DelayA to 0
movlw 10h ; set DelayB to 40h
movwf delay2

Wait5

decfsz delay1 ; subtract 1 from DelayA
goto Wait5 ; if not 0, goto Wait1
decfsz delay2 ; subtract 1 from DelayB
goto Wait5 ; if not 0, goto Wait1
return ; finished the delayend

;********************************************************************


Gesendet von Yahoo! Mail - Jetzt mit 100MB kostenlosem Speicher


try not using in line configuration bit definition. Comment everything out and set the configuration bits trough the interface.
 
Mauricio Jancic
Janso Desarrollos
Microchip Consultant Program Member
(54) 11-4542-3519
i...@janso.com.ar
www.janso.com.ar
 


From: Hasan Arslan [mailto:h...@yahoo.de]
Sent: Tuesday, November 09, 2004 11:18 AM
To: p...@yahoogroups.com
Subject: [piclist] Help for start PIC18 series programming language.

Hi,

I'm use the PIC12F and PIC16F series MCU i will be upgrate to PIC18 Seres.

I have make sample program with 18F452. But I have a problem whit OSC select.

My program don't work if select XT,HS or HS PLL mode. It work only in RC02RA6 mod but i don't understand why the program not work.

I give a example for this progam, if anybody do program for PIC18 series whit ASM help me. Or give me sample program for 18f Series for understand how i can start it.

 

;********************************************************************

list pF452
#include p18F452.inc

;Program Configuration Registers

;*******??????????????????????????????????????????????????**********

; IF I HERE OPEN THIS FUSE THE PROGRAM DON'T RUN.   WHY ?????

; __CONFIG _CONFIG1H, _OSCS_OFF_1H & _EC_OSC_1H

;*******??????????????????????????????????????????????????**********__CONFIG _CONFIG2L, _BOR_OFF_2L & _PWRT_ON_2L
; __CONFIG _CONFIG2H, _WDT_OFF_2H
; __CONFIG _CONFIG3H, _CCP2MX_OFF_3H
__CONFIG _CONFIG4L, _STVR_OFF_4L & _LVP_OFF_4L & _DEBUG_OFF_4L
__CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L
; __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
__CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L
; __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
__CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L
; __CONFIG _CONFIG7H, _EBTRB_OFF_7Hcblock H'00'

delay1
delay2

endc
ORG 0X000

NOP
goto STARTSTART

MOVLW b'11111111'
MOVWF PORTB ;Set PortB as FOR INPUT

MOVLW B'00000000'
MOVWF PORTC ;SET PortC

MOVLW B'00000000'
MOVWF PORTD ;SET PortDMOVLW B'0111' ;RA ve RE PORTUNU DIJITALE CEVIRIR.
MOVWF ADCON1 ;

clrf TRISA ;Set PortC as output

clrf TRISC ;Set PortB as output

MOVLW b'11110011'
MOVWF TRISB ;Set PortB as FOR INPUT

MOVLW B'00000000'
MOVWF TRISD ;Set PortD as FOR OUTPUT

clrf TRISE ;Set PortC as output
KONTROL

CALL DELAY50

btfss PORTB,0
GOTO LED_AC
GOTO LED_KAPALED_AC

BSF PORTB,3

nop
nop
nop

BCF PORTB,2

GOTO KONTROL

LED_KAPA

BCF PORTB,3

nop
nop
nop

BSF PORTB,2

GOTO KONTROLDELAY50

clrf delay1 ; /R clear DelayA to 0
movlw 10h ; set DelayB to 40h
movwf delay2

Wait5

decfsz delay1 ; subtract 1 from DelayA
goto Wait5 ; if not 0, goto Wait1
decfsz delay2 ; subtract 1 from DelayB
goto Wait5 ; if not 0, goto Wait1
return ; finished the delayend

;********************************************************************


Gesendet von Yahoo! Mail - Jetzt mit 100MB kostenlosem Speicher

to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

--
Internal Virus Database is out-of-date.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.279 / Virus Database: 264.10.2 - Release Date: 10/8/2004



IN PROGAM ALGORITHM HAVE NOT PROBLEM
 
"PROTB,0" IS "HIGH" HE MAKE "PORTB,2" TO "LOW" AND "PORTB,3" TO "HIGH".
"PROTB,0" IS "LOW" HE MAKE "PORTB,2" TO "HIGH" AND "PORTB,3" TO "LOW".

MY PROBLEM BY DEFINE THE OSC.
 
LOOK FOR  CONFIG THE FUSE.
 
 
 

rtstofer <r...@pacbell.net> wrote:


I could be missing something but I don't see how LED_KAPA will ever
be executed.  The bits will be set in the LED_AC code and never
change.

--- In p...@yahoogroups.com, "Mauricio Jancic" <jancic@c...>
wrote:
> try not using in line configuration bit definition. Comment
everything out
> and set the configuration bits trough the interface.

> Mauricio Jancic
> Janso Desarrollos
> Microchip Consultant Program Member
> (54) 11-4542-3519
> info@j...
> www.janso.com.ar
> >   _____ 
>
> From: Hasan Arslan [mailto:harslan74@y...]
> Sent: Tuesday, November 09, 2004 11:18 AM
> To: p...@yahoogroups.com
> Subject: [piclist] Help for start PIC18 series programming
language.>
> Hi,
>
> I'm use the PIC12F and PIC16F series MCU i will be upgrate to
PIC18 Seres.
>
> I have make sample program with 18F452. But I have a problem whit
OSC
> select.
>
> My program don't work if select XT,HS or HS PLL mode. It work only
in
> RC02RA6 mod but i don't understand why the program not work.
>
> I give a example for this progam, if anybody do program for PIC18
series
> whit ASM help me. Or give me sample program for 18f Series for
understand
> how i can start it.
>

>
> ;******************************************************************
**
>
> list pF452
> #include p18F452.inc
>
> ;Program Configuration Registers
>
> ;*******??????????????????????????????????????????????????
**********
>
> ; IF I HERE OPEN THIS FUSE THE PROGRAM DON'T RUN.   WHY ?????> ; __CONFIG _CONFIG1H, _OSCS_OFF_1H & _EC_OSC_1H
>
> ;*******??????????????????????????????????????????????????
**********> __CONFIG _CONFIG2L, _BOR_OFF_2L & _PWRT_ON_2L
> ; __CONFIG _CONFIG2H, _WDT_OFF_2H
> ; __CONFIG _CONFIG3H, _CCP2MX_OFF_3H
> __CONFIG _CONFIG4L, _STVR_OFF_4L & _LVP_OFF_4L & _DEBUG_OFF_4L
> __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L &
_CP3_OFF_5L
> ; __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
> __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L &
> _WRT3_OFF_6L
> ; __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
> __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L &
> _EBTR3_OFF_7L
> ; __CONFIG _CONFIG7H, _EBTRB_OFF_7H> cblock H'00'
>
> delay1
> delay2
>
> endc>
> ORG 0X000
>
> NOP
> goto START> START
>
> MOVLW b'11111111'
> MOVWF PORTB ;Set PortB as FOR INPUT
>
> MOVLW B'00000000'
> MOVWF PORTC ;SET PortC
>
> MOVLW B'00000000'
> MOVWF PORTD ;SET PortD> MOVLW B'0111' ;RA ve RE PORTUNU DIJITALE CEVIRIR.
> MOVWF ADCON1 ;
>
> clrf TRISA ;Set PortC as output
>
> clrf TRISC ;Set PortB as output
>
> MOVLW b'11110011'
> MOVWF TRISB ;Set PortB as FOR INPUT
>
> MOVLW B'00000000'
> MOVWF TRISD ;Set PortD as FOR OUTPUT
>
> clrf TRISE ;Set PortC as output>
> KONTROL
>
> CALL DELAY50
>
> btfss PORTB,0
> GOTO LED_AC
> GOTO LED_KAPA> LED_AC
>
> BSF PORTB,3
>
> nop
> nop
> nop
>
> BCF PORTB,2
>
> GOTO KONTROL
>
> LED_KAPA
>
> BCF PORTB,3
>
> nop
> nop
> nop
>
> BSF PORTB,2
>
> GOTO KONTROL> DELAY50
>
> clrf delay1 ; /R clear DelayA to 0
> movlw 10h ; set DelayB to 40h
> movwf delay2
>
> Wait5
>
> decfsz delay1 ; subtract 1 from DelayA
> goto Wait5 ; if not 0, goto Wait1
> decfsz delay2 ; subtract 1 from DelayB
> goto Wait5 ; if not 0, goto Wait1
> return ; finished the delay> end
>
> ;******************************************************************
**>   _____ 
>
> Gesendet von Yahoo!
> <http://de.mail.yahoo.com>" target="_blank" rel="nofollow">http://de.rd.yahoo.com/mail/taglines/*http://de.mail.yahoo.com>
Mail -
> Jetzt mit 100MB kostenlosem Speicher
>
> to unsubscribe, go to http://www.yahoogroups.com and follow the
instructions> 
>
<http://us.ard.yahoo.com/SIG961cnn9/M)5196.4901138.6071305.30011
76/D=gr
>
oups/S06554205:HM/EXP00096264/A!28215/R=0/SIGse96mf6/*http
://comp
> anion.yahoo.com> click here     

> <http://us.adserver.yahoo.com/l?
M)5196.4901138.6071305.3001176/D=groups/S=
> :HM/A!28215/randY4787546>      >   _____ 
>
> > .>
> --
> Internal Virus Database is out-of-date.
> Checked by AVG Anti-Virus (http://www.grisoft.com).
> Version: 7.0.279 / Virus Database: 264.10.2 - Release Date:
10/8/2004


to unsubscribe, go to http://www.yahoogroups.com and follow the instructions


Gesendet von Yahoo! Mail - Jetzt mit 100MB kostenlosem Speicher




I messed up - too early in the morning, I guess.

--- In , Hasan Arslan <harslan74@y...> wrote:
> IN PROGAM ALGORITHM HAVE NOT PROBLEM
>
> "PROTB,0" IS "HIGH" HE MAKE "PORTB,2" TO "LOW" AND "PORTB,3"
TO "HIGH".
> "PROTB,0" IS "LOW" HE MAKE "PORTB,2" TO "HIGH" AND "PORTB,3"
TO "LOW".
>
> MY PROBLEM BY DEFINE THE OSC.
>
> LOOK FOR CONFIG THE FUSE. >
>
> rtstofer <rstofer@p...> wrote: > I could be missing something but I don't see how LED_KAPA will
ever
> be executed. The bits will be set in the LED_AC code and never
> change.
>
> --- In , "Mauricio Jancic" <jancic@c...>
> wrote:
> > try not using in line configuration bit definition. Comment
> everything out
> > and set the configuration bits trough the interface.
> >
> > Mauricio Jancic
> > Janso Desarrollos
> > Microchip Consultant Program Member
> > (54) 11-4542-3519
> > info@j...
> > www.janso.com.ar
> >
> >
> >
> > _____
> >
> > From: Hasan Arslan [mailto:harslan74@y...]
> > Sent: Tuesday, November 09, 2004 11:18 AM
> > To:
> > Subject: [piclist] Help for start PIC18 series programming
> language.
> >
> >
> >
> > Hi,
> >
> > I'm use the PIC12F and PIC16F series MCU i will be upgrate to
> PIC18 Seres.
> >
> > I have make sample program with 18F452. But I have a problem
whit
> OSC
> > select.
> >
> > My program don't work if select XT,HS or HS PLL mode. It work
only
> in
> > RC02RA6 mod but i don't understand why the program not work.
> >
> > I give a example for this progam, if anybody do program for
PIC18
> series
> > whit ASM help me. Or give me sample program for 18f Series for
> understand
> > how i can start it.
> >
> >
> >
>
> ;******************************************************************
> **
> >
> > list pF452
> > #include p18F452.inc
> >
> > ;Program Configuration Registers
> >
> > ;*******??????????????????????????????????????????????????
> **********
> >
> > ; IF I HERE OPEN THIS FUSE THE PROGRAM DON'T RUN. WHY ?????
> >
> >
> > ; __CONFIG _CONFIG1H, _OSCS_OFF_1H & _EC_OSC_1H
> >
> > ;*******??????????????????????????????????????????????????
> **********
> >
> >
> > __CONFIG _CONFIG2L, _BOR_OFF_2L & _PWRT_ON_2L
> > ; __CONFIG _CONFIG2H, _WDT_OFF_2H
> > ; __CONFIG _CONFIG3H, _CCP2MX_OFF_3H
> > __CONFIG _CONFIG4L, _STVR_OFF_4L & _LVP_OFF_4L & _DEBUG_OFF_4L
> > __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L &
> _CP3_OFF_5L
> > ; __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
> > __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L &
> > _WRT3_OFF_6L
> > ; __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
> > __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L &
_EBTR2_OFF_7L &
> > _EBTR3_OFF_7L
> > ; __CONFIG _CONFIG7H, _EBTRB_OFF_7H
> >
> >
> > cblock H'00'
> >
> > delay1
> > delay2
> >
> > endc
> >
> >
> >
> > ORG 0X000
> >
> > NOP
> > goto START
> >
> >
> > START
> >
> > MOVLW b'11111111'
> > MOVWF PORTB ;Set PortB as FOR INPUT
> >
> > MOVLW B'00000000'
> > MOVWF PORTC ;SET PortC
> >
> > MOVLW B'00000000'
> > MOVWF PORTD ;SET PortD
> >
> >
> > MOVLW B'0111' ;RA ve RE PORTUNU DIJITALE CEVIRIR.
> > MOVWF ADCON1 ;
> >
> > clrf TRISA ;Set PortC as output
> >
> > clrf TRISC ;Set PortB as output
> >
> > MOVLW b'11110011'
> > MOVWF TRISB ;Set PortB as FOR INPUT
> >
> > MOVLW B'00000000'
> > MOVWF TRISD ;Set PortD as FOR OUTPUT
> >
> > clrf TRISE ;Set PortC as output
> >
> >
> >
> > KONTROL
> >
> > CALL DELAY50
> >
> > btfss PORTB,0
> > GOTO LED_AC
> > GOTO LED_KAPA
> >
> >
> > LED_AC
> >
> > BSF PORTB,3
> >
> > nop
> > nop
> > nop
> >
> > BCF PORTB,2
> >
> > GOTO KONTROL
> >
> > LED_KAPA
> >
> > BCF PORTB,3
> >
> > nop
> > nop
> > nop
> >
> > BSF PORTB,2
> >
> > GOTO KONTROL
> >
> >
> > DELAY50
> >
> > clrf delay1 ; /R clear DelayA to 0
> > movlw 10h ; set DelayB to 40h
> > movwf delay2
> >
> > Wait5
> >
> > decfsz delay1 ; subtract 1 from DelayA
> > goto Wait5 ; if not 0, goto Wait1
> > decfsz delay2 ; subtract 1 from DelayB
> > goto Wait5 ; if not 0, goto Wait1
> > return ; finished the delay
> >
> >
> > end
> >
>
> ;******************************************************************
> **
> >
> >
> >
> >
> >
> > _____
> >
> > Gesendet von Yahoo!
> > <http://de.mail.yahoo.com>" target="_blank" rel="nofollow">http://de.rd.yahoo.com/mail/taglines/*http://de.mail.yahoo.com>
> Mail -
> > Jetzt mit 100MB kostenlosem Speicher
> >
> > to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions
> >
> >
> >
> >
> >
> >
> >
>
<http://us.ard.yahoo.com/SIG961cnn9/M)5196.4901138.6071305.30011
> 76/D=gr
> >
>
oups/S06554205:HM/EXP00096264/A!28215/R=0/SIGse96mf6/*http
> ://comp
> > anion.yahoo.com> click here
> >
> > <http://us.adserver.yahoo.com/l?
> M)5196.4901138.6071305.3001176/D=groups/S=
> > :HM/A!28215/randY4787546>
> >
> >
> > _____
> >
> > > .
> >
> >
> >
> > --
> > Internal Virus Database is out-of-date.
> > Checked by AVG Anti-Virus (http://www.grisoft.com).
> > Version: 7.0.279 / Virus Database: 264.10.2 - Release Date:
> 10/8/2004 > to unsubscribe, go to http://www.yahoogroups.com and follow the
instructions
>
>
> Yahoo! Groups Sponsor
> Get unlimited calls to
>
> U.S./Canada > ---------------------------------
> Yahoo! Groups Links
>
> To >
> ---------------------------------
> Gesendet von Yahoo! Mail - Jetzt mit 100MB kostenlosem Speicher



These config directives are from one of my programs, and it will get
your xt osc running in X4 mode:
;******************************************************************************

;Configuration bits
; The __CONFIG directive defines configuration data within the .ASM
file.
; The labels following the directive configuration bits.

__CONFIG _CONFIG1H, _OSCS_OFF_1H & _HSPLL_OSC_1H ;Oscillator
switching=OFF. High Speed PLL Oscillator enable=ON.

__CONFIG _CONFIG2L, _BOR_OFF_2L & _PWRT_ON_2L ;Brown Out
Reset=OFF. Power-up Timer=ON.
__CONFIG _CONFIG2H, _WDT_OFF_2H ;Watch Dog Timer=OFF.
__CONFIG _CONFIG3H, _CCP2MX_OFF_3H ;Mux on CCP2=OFF.
__CONFIG _CONFIG4L, _STVR_OFF_4L & _LVP_OFF_4L & _DEBUG_OFF_4L
;Stack overflow reset=OFF. Low Voltage Programming(ISCP)=OFF. Background
Debugger=OFF.
__CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L &
_CP3_OFF_5L ;Code Protection=OFF.
__CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H ;Boot Block Code
Protection=OFF. Data EEPROM Code Protection=OFF.
__CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L &
_WRT3_OFF_6L ;Program blocks 0:3 Write Protection=OFF.
__CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
;EEPROM Write protection=OFF. Boot Block Write Protection=OFF.
Configuration Register Write Protection=OFF.
__CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L &
_EBTR3_OFF_7L ;Table Read Protection blocks 0:3=OFF.
__CONFIG _CONFIG7H, _EBTRB_OFF_7H ;Boot Block Table Read
Protection=OFF.
;******************************************************************************

Hasan Arslan wrote:

>
>
> Hi,
>
> I'm use the PIC12F and PIC16F series MCU i will be upgrate to PIC18
> Seres.
>
> I have make sample program with 18F452. But I have a problem whit OSC
> select.
>
> My program don't work if select XT,HS or HS PLL mode. It work only in
> RC02RA6 mod but i don't understand why the program not work.
>
> I give a example for this progam, if anybody do program for PIC18
> series whit ASM help me. Or give me sample program for 18f Series for
> understand how i can start it.

--
*******************************************
VISIT MY HOME PAGE:
<http://home.online.no/~eikarlse/index.htm>
LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen



--- In , Hasan Arslan <harslan74@y...> wrote:
>
> Hi,
>
> I'm use the PIC12F and PIC16F series MCU i will be upgrate to PIC18
Seres.
>
> I have make sample program with 18F452. But I have a problem whit
OSC select.
>
> My program don't work if select XT,HS or HS PLL mode. It work only
in RC02RA6 mod but i don't understand why the program not work.
>

And what are you using to clock the PIC and how is it connected when
you select XT, HS, or HSPLL mode?





--- In , Hasan Arslan <harslan74@y...> wrote:
> ;*******??????????????????????????????????????????????????**********
>
> ; IF I HERE OPEN THIS FUSE THE PROGRAM DON'T RUN. WHY ????? > ; __CONFIG _CONFIG1H, _OSCS_OFF_1H & _EC_OSC_1H
>
> ;*******??????????????????????????????????????????????????**********

_EC_OSC_1H is selected when you are using an external clock such as a
canned oscillator from FOX. It is not used when you are using a
crystal or a resonator.


I will be use in HS mod. but it not work if i select HS mod.
 
 
 


Scott Lee <m...@yahoo.com> wrote:

--- In p...@yahoogroups.com, Hasan Arslan <harslan74@y...> wrote:
>
> Hi,
>
> I'm use the PIC12F and PIC16F series MCU i will be upgrate to PIC18
Seres.
>
> I have make sample program with 18F452. But I have a problem whit
OSC select.
>
> My program don't work if select XT,HS or HS PLL mode. It work only
in RC02RA6 mod but i don't understand why the program not work.And what are you using to clock the PIC and how is it connected when
you select XT, HS, or HSPLL mode?


to unsubscribe, go to http://www.yahoogroups.com and follow the instructions


Gesendet von Yahoo! Mail - Jetzt mit 100MB kostenlosem Speicher



And what are you using to clock the PIC and how is it connected?

--- In , Hasan Arslan <harslan74@y...> wrote:
> I will be use in HS mod. but it not work if i select HS mod. > Scott Lee <midl_man@y...> wrote:
>
> --- In , Hasan Arslan <harslan74@y...> wrote:
> >
> > Hi,
> >
> > I'm use the PIC12F and PIC16F series MCU i will be upgrate to
PIC18
> Seres.
> >
> > I have make sample program with 18F452. But I have a problem whit
> OSC select.
> >
> > My program don't work if select XT,HS or HS PLL mode. It work only
> in RC02RA6 mod but i don't understand why the program not work.
> >
>
> And what are you using to clock the PIC and how is it connected when
> you select XT, HS, or HSPLL mode? > to unsubscribe, go to http://www.yahoogroups.com and follow the
instructions
>
>
> Yahoo! Groups Sponsor
> Get unlimited calls to
>
> U.S./Canada > ---------------------------------
> Yahoo! Groups Links
>
> To >
> ---------------------------------
> Gesendet von Yahoo! Mail - Jetzt mit 100MB kostenlosem Speicher





--- In , Hasan Arslan <harslan74@y...> wrote:
>
> Hi,
>
> I'm use the PIC12F and PIC16F series MCU i will be upgrate to PIC18
Seres.
>
> I have make sample program with 18F452. But I have a problem whit
OSC select.
>
> My program don't work if select XT,HS or HS PLL mode. It work only
in RC02RA6 mod but i don't understand why the program not work.
>
> I give a example for this progam, if anybody do program for PIC18
series whit ASM help me. Or give me sample program for 18f Series for
understand how i can start it.
>

You do not have to set every config bit available. The PIC
defaults to the most reasonable ones (usually off) for everything,
just enable what you need and leave the rest alone. Refer to the
data sheet for the 18F family for the proper startup times etc.
for the type of OSC that you will be using and it'll work fine.

DLC

>
> ;*******************************************************************
*
>
> list pF452
> #include p18F452.inc
>
> ;Program Configuration Registers
>
> ;*******??????????????????????????????????????????????????
**********
>
> ; IF I HERE OPEN THIS FUSE THE PROGRAM DON'T RUN. WHY ????? > ; __CONFIG _CONFIG1H, _OSCS_OFF_1H & _EC_OSC_1H
>
> ;*******??????????????????????????????????????????????????
**********
>
>
> __CONFIG _CONFIG2L, _BOR_OFF_2L & _PWRT_ON_2L
> ; __CONFIG _CONFIG2H, _WDT_OFF_2H
> ; __CONFIG _CONFIG3H, _CCP2MX_OFF_3H
> __CONFIG _CONFIG4L, _STVR_OFF_4L & _LVP_OFF_4L & _DEBUG_OFF_4L
> __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L &
_CP3_OFF_5L
> ; __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
> __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L &
_WRT3_OFF_6L
> ; __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
> __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L &
_EBTR3_OFF_7L
> ; __CONFIG _CONFIG7H, _EBTRB_OFF_7H