home | area personale         schemi | tutorial | robotica | pic micro | recensioni         forum | chat irc         faq | contatti         store | Ordina PCB
username
password
cerca

 
FORUM: Pic Micro
Tutto quanto riguarda questi microprocessori... progetti, suggerimenti, aiuti, discussioni...ecc


PIC18F2550 16 LED LAMPEGGI DIVERSI PROGRAMMA
     
Autore Messaggio opzioni
cavallo_leo





postato il:
21.11.2021, alle ore 12:21
PIC18F2550 16 LED LAMPEGGI DIVERSI PROGRAMMA 

MI POTREBBE, PER FAVORE FARE IL PROGRAMMA PIC18F2550 (ASSEMBLER MASM + HEX)
DELLA MIE LUCE DI NATALE DI MODO CHE LAMPEGGI FINO 16 LED DIVERSI.
IO NON SONO IN GRADO IL PROGRAMMA (PIC18F2550) DI FARLO...
GRAZIE A TUTTI
VEDI LA FOTO



icom 7400





postato il:
21.11.2021, alle ore 16:43
Hai già disponibile il PIC18F2550 ?
cavallo_leo





postato il:
22.11.2021, alle ore 08:52
icom 7400:
Hai già disponibile il PIC18F2550 ?




SI
rcc.roberto



[pagine pubblicate]

postato il:
22.11.2021, alle ore 16:22
rispondo anche qui alla tua domanda di farti il programma che mi hai inviato con MP.

No, non è possibile, per due motivi.. uno è che non ho assolutamente tempo.
Il secondo, più importante è che qui non forniamo programmi fatti, ma aiutiamo chi vuole imparare a svilupparsi da solo il suo programma correggendo gli errori che fa, in modo che possa imparare.
cavallo_leo





postato il:
28.11.2021, alle ore 08:57
PROBLEMA CON PIC 18F2550... !!!
PROGRAMMA Great Cow BASIC

======================================

;Chip Settings
#chip 18F2550

;Defines (Constants)
#define LED1 PORTB.7
#define LED2 PORTB.6
#define LED3 PORTB.5
#define LED4 PORTB.4
#define LED5 PORTB.3
#define LED6 PORTB.2
#define LED7 PORTB.1
#define LED8 PORTB.0
#define LED9 PORTC.7
#define LED10 PORTC.6
#define LED11 PORTA.0
#define LED12 PORTA.1
#define LED13 PORTA.2
#define LED14 PORTA.3
#define LED15 PORTA.4
#define LED16 PORTA.5
#define FlashDelay 250 ms

----- Configuration
start:
set LED1 ON
set LED2 ON
set LED3 ON
set LED4 ON
set LED5 OFF
set LED6 OFF
set LED7 OFF
set LED8 OFF
set LED9 OFF
set LED10 OFF
set LED11 OFF
set LED12 OFF
set LED13 OFF
set LED14 OFF
set LED15 OFF
set LED16 OFF
wait FlashDelay
set LED1 OFF
set LED2 OFF
set LED3 OFF
set LED4 OFF
set LED5 ON
set LED6 ON
set LED7 ON
set LED8 ON
set LED9 OFF
set LED10 OFF
set LED11 OFF
set LED12 OFF
set LED13 OFF
set LED14 OFF
set LED15 OFF
set LED16 OFF
wait FlashDelay
set LED1 OFF
set LED2 OFF
set LED3 OFF
set LED4 OFF
set LED5 OFF
set LED6 OFF
set LED7 OFF
set LED8 OFF
set LED9 ON
set LED10 ON
set LED11 ON
set LED12 ON
set LED13 OFF
set LED14 OFF
set LED15 OFF
set LED16 OFF
wait FlashDelay
set LED1 OFF
set LED2 OFF
set LED3 OFF
set LED4 OFF
set LED5 OFF
set LED6 OFF
set LED7 OFF
set LED8 OFF
set LED9 OFF
set LED10 OFF
set LED11 OFF
set LED12 OFF
set LED13 ON
set LED14 ON
set LED15 ON
set LED16 ON
wait FlashDelay
set LED1 OFF
set LED2 OFF
set LED3 OFF
set LED4 OFF
set LED5 OFF
set LED6 OFF
set LED7 OFF
set LED8 OFF
set LED9 ON
set LED10 ON
set LED11 ON
set LED12 ON
set LED13 OFF
set LED14 OFF
set LED15 OFF
set LED16 OFF
wait FlashDelay
set LED1 OFF
set LED2 OFF
set LED3 OFF
set LED4 OFF
set LED5 ON
set LED6 ON
set LED7 ON
set LED8 ON
set LED9 OFF
set LED10 OFF
set LED11 OFF
set LED12 OFF
set LED13 OFF
set LED14 OFF
set LED15 OFF
set LED16 OFF
wait FlashDelay
set LED1 ON
set LED2 ON
set LED3 ON
set LED4 ON
set LED5 OFF
set LED6 OFF
set LED7 OFF
set LED8 OFF
set LED9 OFF
set LED10 OFF
set LED11 OFF
set LED12 OFF
set LED13 OFF
set LED14 OFF
set LED15 OFF
set LED16 OFF
wait FlashDelay
set LED1 OFF
set LED2 OFF
set LED3 OFF
set LED4 OFF
set LED5 ON
set LED6 ON
set LED7 ON
set LED8 ON
set LED9 OFF
set LED10 OFF
set LED11 OFF
set LED12 OFF
set LED13 OFF
set LED14 OFF
set LED15 OFF
set LED16 OFF
wait FlashDelay
set LED1 OFF
set LED2 OFF
set LED3 OFF
set LED4 OFF
set LED5 OFF
set LED6 OFF
set LED7 OFF
set LED8 OFF
set LED9 ON
set LED10 ON
set LED11 ON
set LED12 ON
set LED13 OFF
set LED14 OFF
set LED15 OFF
set LED16 OFF
wait FlashDelay
set LED1 OFF
set LED2 OFF
set LED3 OFF
set LED4 OFF
set LED5 OFF
set LED6 OFF
set LED7 OFF
set LED8 OFF
set LED9 OFF
set LED10 OFF
set LED11 OFF
set LED12 OFF
set LED13 ON
set LED14 ON
set LED15 ON
set LED16 ON
wait FlashDelay
set LED1 OFF
set LED2 OFF
set LED3 OFF
set LED4 OFF
set LED5 OFF
set LED6 OFF
set LED7 OFF
set LED8 OFF
set LED9 ON
set LED10 ON
set LED11 ON
set LED12 ON
set LED13 OFF
set LED14 OFF
set LED15 OFF
set LED16 OFF
wait FlashDelay
set LED1 OFF
set LED2 OFF
set LED3 OFF
set LED4 OFF
set LED5 ON
set LED6 ON
set LED7 ON
set LED8 ON
set LED9 OFF
set LED10 OFF
set LED11 OFF
set LED12 OFF
set LED13 OFF
set LED14 OFF
set LED15 OFF
set LED16 OFF
wait FlashDelay
set LED1 ON
set LED2 ON
set LED3 ON
set LED4 ON
set LED5 OFF
set LED6 OFF
set LED7 OFF
set LED8 OFF
set LED9 OFF
set LED10 OFF
set LED11 OFF
set LED12 OFF
set LED13 OFF
set LED14 OFF
set LED15 OFF
set LED16 OFF
wait FlashDelay
goto start
end

cavallo_leo





postato il:
28.11.2021, alle ore 09:00
QUALCOSA NON VA BENE, DOVE ERRORE?

PROGRAMMA ASM

=======================

;Program compiled by Great Cow BASIC (0.98.07 2021-07-24 (Windows 64 bit) : Build 1005) for Microchip MPASM
;Need help? See the GCBASIC forums at http://sourceforge.net/projects/gcbasic/forums,
;check the documentation or email w_cholmondeley at users dot sourceforge dot net.

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

;Set up the assembler options (Chip type, clock source, other bits and pieces)
LIST p=18F2550, r=DEC
#include <P18F2550.inc>
CONFIG WRTD = OFF, WRTB = OFF, CPD = OFF, XINST = OFF, LVP = OFF, MCLRE = OFF, WDT = OFF, FCMEN = ON, FOSC = INTOSCIO_EC

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

;Set aside memory locations for variables
DELAYTEMP EQU 0
DELAYTEMP2 EQU 1
SYSWAITTEMPMS EQU 2
SYSWAITTEMPMS_H EQU 3

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

;Vectors
ORG 0
goto BASPROGRAMSTART
ORG 8
retfie

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

;Start of program memory page 0
ORG 12
BASPROGRAMSTART
;Call initialisation routines
rcall INITSYS
;Automatic pin direction setting
bcf TRISC,7,ACCESS
bcf TRISC,6,ACCESS
bcf TRISB,7,ACCESS
bcf TRISB,6,ACCESS
bcf TRISB,5,ACCESS
bcf TRISB,4,ACCESS
bcf TRISB,3,ACCESS
bcf TRISB,2,ACCESS
bcf TRISB,1,ACCESS
bcf TRISB,0,ACCESS
bcf TRISA,5,ACCESS
bcf TRISA,4,ACCESS
bcf TRISA,3,ACCESS
bcf TRISA,2,ACCESS
bcf TRISA,1,ACCESS
bcf TRISA,0,ACCESS

;Start of the main program
;Chip Settings
;Defines (Constants)
;#define LED1 PORTB.7
;#define LED2 PORTB.6
;#define LED3 PORTB.5
;#define LED4 PORTB.4
;#define LED5 PORTB.3
;#define LED6 PORTB.2
;#define LED7 PORTB.1
;#define LED8 PORTB.0
;#define LED9 PORTC.7
;#define LED10 PORTC.6
;#define LED11 PORTA.0
;#define LED12 PORTA.1
;#define LED13 PORTA.2
;#define LED14 PORTA.3
;#define LED15 PORTA.4
;#define LED16 PORTA.5
;#define FlashDelay 250 ms
;----- Configuration
clrf
START
;set LED1 ON
bsf LATB,7,ACCESS
;set LED2 ON
bsf LATB,6,ACCESS
;set LED3 ON
bsf LATB,5,ACCESS
;set LED4 ON
bsf LATB,4,ACCESS
;set LED5 OFF
bcf LATB,3,ACCESS
;set LED6 OFF
bcf LATB,2,ACCESS
;set LED7 OFF
bcf LATB,1,ACCESS
;set LED8 OFF
bcf LATB,0,ACCESS
;set LED9 OFF
bcf LATC,7,ACCESS
;set LED10 OFF
bcf LATC,6,ACCESS
;set LED11 OFF
bcf LATA,0,ACCESS
;set LED12 OFF
bcf LATA,1,ACCESS
;set LED13 OFF
bcf LATA,2,ACCESS
;set LED14 OFF
bcf LATA,3,ACCESS
;set LED15 OFF
bcf LATA,4,ACCESS
;set LED16 OFF
bcf LATA,5,ACCESS
;wait FlashDelay
movlw 250
movwf SysWaitTempMS,ACCESS
clrf SysWaitTempMS_H,ACCESS
rcall Delay_MS
;set LED1 OFF
bcf LATB,7,ACCESS
;set LED2 OFF
bcf LATB,6,ACCESS
;set LED3 OFF
bcf LATB,5,ACCESS
;set LED4 OFF
bcf LATB,4,ACCESS
;set LED5 ON
bsf LATB,3,ACCESS
;set LED6 ON
bsf LATB,2,ACCESS
;set LED7 ON
bsf LATB,1,ACCESS
;set LED8 ON
bsf LATB,0,ACCESS
;set LED9 OFF
bcf LATC,7,ACCESS
;set LED10 OFF
bcf LATC,6,ACCESS
;set LED11 OFF
bcf LATA,0,ACCESS
;set LED12 OFF
bcf LATA,1,ACCESS
;set LED13 OFF
bcf LATA,2,ACCESS
;set LED14 OFF
bcf LATA,3,ACCESS
;set LED15 OFF
bcf LATA,4,ACCESS
;set LED16 OFF
bcf LATA,5,ACCESS
;wait FlashDelay
movlw 250
movwf SysWaitTempMS,ACCESS
clrf SysWaitTempMS_H,ACCESS
rcall Delay_MS
;set LED1 OFF
bcf LATB,7,ACCESS
;set LED2 OFF
bcf LATB,6,ACCESS
;set LED3 OFF
bcf LATB,5,ACCESS
;set LED4 OFF
bcf LATB,4,ACCESS
;set LED5 OFF
bcf LATB,3,ACCESS
;set LED6 OFF
bcf LATB,2,ACCESS
;set LED7 OFF
bcf LATB,1,ACCESS
;set LED8 OFF
bcf LATB,0,ACCESS
;set LED9 ON
bsf LATC,7,ACCESS
;set LED10 ON
bsf LATC,6,ACCESS
;set LED11 ON
bsf LATA,0,ACCESS
;set LED12 ON
bsf LATA,1,ACCESS
;set LED13 OFF
bcf LATA,2,ACCESS
;set LED14 OFF
bcf LATA,3,ACCESS
;set LED15 OFF
bcf LATA,4,ACCESS
;set LED16 OFF
bcf LATA,5,ACCESS
;wait FlashDelay
movlw 250
movwf SysWaitTempMS,ACCESS
clrf SysWaitTempMS_H,ACCESS
rcall Delay_MS
;set LED1 OFF
bcf LATB,7,ACCESS
;set LED2 OFF
bcf LATB,6,ACCESS
;set LED3 OFF
bcf LATB,5,ACCESS
;set LED4 OFF
bcf LATB,4,ACCESS
;set LED5 OFF
bcf LATB,3,ACCESS
;set LED6 OFF
bcf LATB,2,ACCESS
;set LED7 OFF
bcf LATB,1,ACCESS
;set LED8 OFF
bcf LATB,0,ACCESS
;set LED9 OFF
bcf LATC,7,ACCESS
;set LED10 OFF
bcf LATC,6,ACCESS
;set LED11 OFF
bcf LATA,0,ACCESS
;set LED12 OFF
bcf LATA,1,ACCESS
;set LED13 ON
bsf LATA,2,ACCESS
;set LED14 ON
bsf LATA,3,ACCESS
;set LED15 ON
bsf LATA,4,ACCESS
;set LED16 ON
bsf LATA,5,ACCESS
;wait FlashDelay
movlw 250
movwf SysWaitTempMS,ACCESS
clrf SysWaitTempMS_H,ACCESS
rcall Delay_MS
;set LED1 OFF
bcf LATB,7,ACCESS
;set LED2 OFF
bcf LATB,6,ACCESS
;set LED3 OFF
bcf LATB,5,ACCESS
;set LED4 OFF
bcf LATB,4,ACCESS
;set LED5 OFF
bcf LATB,3,ACCESS
;set LED6 OFF
bcf LATB,2,ACCESS
;set LED7 OFF
bcf LATB,1,ACCESS
;set LED8 OFF
bcf LATB,0,ACCESS
;set LED9 ON
bsf LATC,7,ACCESS
;set LED10 ON
bsf LATC,6,ACCESS
;set LED11 ON
bsf LATA,0,ACCESS
;set LED12 ON
bsf LATA,1,ACCESS
;set LED13 OFF
bcf LATA,2,ACCESS
;set LED14 OFF
bcf LATA,3,ACCESS
;set LED15 OFF
bcf LATA,4,ACCESS
;set LED16 OFF
bcf LATA,5,ACCESS
;wait FlashDelay
movlw 250
movwf SysWaitTempMS,ACCESS
clrf SysWaitTempMS_H,ACCESS
rcall Delay_MS
;set LED1 OFF
bcf LATB,7,ACCESS
;set LED2 OFF
bcf LATB,6,ACCESS
;set LED3 OFF
bcf LATB,5,ACCESS
;set LED4 OFF
bcf LATB,4,ACCESS
;set LED5 ON
bsf LATB,3,ACCESS
;set LED6 ON
bsf LATB,2,ACCESS
;set LED7 ON
bsf LATB,1,ACCESS
;set LED8 ON
bsf LATB,0,ACCESS
;set LED9 OFF
bcf LATC,7,ACCESS
;set LED10 OFF
bcf LATC,6,ACCESS
;set LED11 OFF
bcf LATA,0,ACCESS
;set LED12 OFF
bcf LATA,1,ACCESS
;set LED13 OFF
bcf LATA,2,ACCESS
;set LED14 OFF
bcf LATA,3,ACCESS
;set LED15 OFF
bcf LATA,4,ACCESS
;set LED16 OFF
bcf LATA,5,ACCESS
;wait FlashDelay
movlw 250
movwf SysWaitTempMS,ACCESS
clrf SysWaitTempMS_H,ACCESS
rcall Delay_MS
;set LED1 ON
bsf LATB,7,ACCESS
;set LED2 ON
bsf LATB,6,ACCESS
;set LED3 ON
bsf LATB,5,ACCESS
;set LED4 ON
bsf LATB,4,ACCESS
;set LED5 OFF
bcf LATB,3,ACCESS
;set LED6 OFF
bcf LATB,2,ACCESS
;set LED7 OFF
bcf LATB,1,ACCESS
;set LED8 OFF
bcf LATB,0,ACCESS
;set LED9 OFF
bcf LATC,7,ACCESS
;set LED10 OFF
bcf LATC,6,ACCESS
;set LED11 OFF
bcf LATA,0,ACCESS
;set LED12 OFF
bcf LATA,1,ACCESS
;set LED13 OFF
bcf LATA,2,ACCESS
;set LED14 OFF
bcf LATA,3,ACCESS
;set LED15 OFF
bcf LATA,4,ACCESS
;set LED16 OFF
bcf LATA,5,ACCESS
;wait FlashDelay
movlw 250
movwf SysWaitTempMS,ACCESS
clrf SysWaitTempMS_H,ACCESS
rcall Delay_MS
;set LED1 OFF
bcf LATB,7,ACCESS
;set LED2 OFF
bcf LATB,6,ACCESS
;set LED3 OFF
bcf LATB,5,ACCESS
;set LED4 OFF
bcf LATB,4,ACCESS
;set LED5 ON
bsf LATB,3,ACCESS
;set LED6 ON
bsf LATB,2,ACCESS
;set LED7 ON
bsf LATB,1,ACCESS
;set LED8 ON
bsf LATB,0,ACCESS
;set LED9 OFF
bcf LATC,7,ACCESS
;set LED10 OFF
bcf LATC,6,ACCESS
;set LED11 OFF
bcf LATA,0,ACCESS
;set LED12 OFF
bcf LATA,1,ACCESS
;set LED13 OFF
bcf LATA,2,ACCESS
;set LED14 OFF
bcf LATA,3,ACCESS
;set LED15 OFF
bcf LATA,4,ACCESS
;set LED16 OFF
bcf LATA,5,ACCESS
;wait FlashDelay
movlw 250
movwf SysWaitTempMS,ACCESS
clrf SysWaitTempMS_H,ACCESS
rcall Delay_MS
;set LED1 OFF
bcf LATB,7,ACCESS
;set LED2 OFF
bcf LATB,6,ACCESS
;set LED3 OFF
bcf LATB,5,ACCESS
;set LED4 OFF
bcf LATB,4,ACCESS
;set LED5 OFF
bcf LATB,3,ACCESS
;set LED6 OFF
bcf LATB,2,ACCESS
;set LED7 OFF
bcf LATB,1,ACCESS
;set LED8 OFF
bcf LATB,0,ACCESS
;set LED9 ON
bsf LATC,7,ACCESS
;set LED10 ON
bsf LATC,6,ACCESS
;set LED11 ON
bsf LATA,0,ACCESS
;set LED12 ON
bsf LATA,1,ACCESS
;set LED13 OFF
bcf LATA,2,ACCESS
;set LED14 OFF
bcf LATA,3,ACCESS
;set LED15 OFF
bcf LATA,4,ACCESS
;set LED16 OFF
bcf LATA,5,ACCESS
;wait FlashDelay
movlw 250
movwf SysWaitTempMS,ACCESS
clrf SysWaitTempMS_H,ACCESS
rcall Delay_MS
;set LED1 OFF
bcf LATB,7,ACCESS
;set LED2 OFF
bcf LATB,6,ACCESS
;set LED3 OFF
bcf LATB,5,ACCESS
;set LED4 OFF
bcf LATB,4,ACCESS
;set LED5 OFF
bcf LATB,3,ACCESS
;set LED6 OFF
bcf LATB,2,ACCESS
;set LED7 OFF
bcf LATB,1,ACCESS
;set LED8 OFF
bcf LATB,0,ACCESS
;set LED9 OFF
bcf LATC,7,ACCESS
;set LED10 OFF
bcf LATC,6,ACCESS
;set LED11 OFF
bcf LATA,0,ACCESS
;set LED12 OFF
bcf LATA,1,ACCESS
;set LED13 ON
bsf LATA,2,ACCESS
;set LED14 ON
bsf LATA,3,ACCESS
;set LED15 ON
bsf LATA,4,ACCESS
;set LED16 ON
bsf LATA,5,ACCESS
;wait FlashDelay
movlw 250
movwf SysWaitTempMS,ACCESS
clrf SysWaitTempMS_H,ACCESS
rcall Delay_MS
;set LED1 OFF
bcf LATB,7,ACCESS
;set LED2 OFF
bcf LATB,6,ACCESS
;set LED3 OFF
bcf LATB,5,ACCESS
;set LED4 OFF
bcf LATB,4,ACCESS
;set LED5 OFF
bcf LATB,3,ACCESS
;set LED6 OFF
bcf LATB,2,ACCESS
;set LED7 OFF
bcf LATB,1,ACCESS
;set LED8 OFF
bcf LATB,0,ACCESS
;set LED9 ON
bsf LATC,7,ACCESS
;set LED10 ON
bsf LATC,6,ACCESS
;set LED11 ON
bsf LATA,0,ACCESS
;set LED12 ON
bsf LATA,1,ACCESS
;set LED13 OFF
bcf LATA,2,ACCESS
;set LED14 OFF
bcf LATA,3,ACCESS
;set LED15 OFF
bcf LATA,4,ACCESS
;set LED16 OFF
bcf LATA,5,ACCESS
;wait FlashDelay
movlw 250
movwf SysWaitTempMS,ACCESS
clrf SysWaitTempMS_H,ACCESS
rcall Delay_MS
;set LED1 OFF
bcf LATB,7,ACCESS
;set LED2 OFF
bcf LATB,6,ACCESS
;set LED3 OFF
bcf LATB,5,ACCESS
;set LED4 OFF
bcf LATB,4,ACCESS
;set LED5 ON
bsf LATB,3,ACCESS
;set LED6 ON
bsf LATB,2,ACCESS
;set LED7 ON
bsf LATB,1,ACCESS
;set LED8 ON
bsf LATB,0,ACCESS
;set LED9 OFF
bcf LATC,7,ACCESS
;set LED10 OFF
bcf LATC,6,ACCESS
;set LED11 OFF
bcf LATA,0,ACCESS
;set LED12 OFF
bcf LATA,1,ACCESS
;set LED13 OFF
bcf LATA,2,ACCESS
;set LED14 OFF
bcf LATA,3,ACCESS
;set LED15 OFF
bcf LATA,4,ACCESS
;set LED16 OFF
bcf LATA,5,ACCESS
;wait FlashDelay
movlw 250
movwf SysWaitTempMS,ACCESS
clrf SysWaitTempMS_H,ACCESS
rcall Delay_MS
;set LED1 ON
bsf LATB,7,ACCESS
;set LED2 ON
bsf LATB,6,ACCESS
;set LED3 ON
bsf LATB,5,ACCESS
;set LED4 ON
bsf LATB,4,ACCESS
;set LED5 OFF
bcf LATB,3,ACCESS
;set LED6 OFF
bcf LATB,2,ACCESS
;set LED7 OFF
bcf LATB,1,ACCESS
;set LED8 OFF
bcf LATB,0,ACCESS
;set LED9 OFF
bcf LATC,7,ACCESS
;set LED10 OFF
bcf LATC,6,ACCESS
;set LED11 OFF
bcf LATA,0,ACCESS
;set LED12 OFF
bcf LATA,1,ACCESS
;set LED13 OFF
bcf LATA,2,ACCESS
;set LED14 OFF
bcf LATA,3,ACCESS
;set LED15 OFF
bcf LATA,4,ACCESS
;set LED16 OFF
bcf LATA,5,ACCESS
;wait FlashDelay
movlw 250
movwf SysWaitTempMS,ACCESS
clrf SysWaitTempMS_H,ACCESS
rcall Delay_MS
;goto start
bra START
;end
bra BASPROGRAMEND
BASPROGRAMEND
sleep
bra BASPROGRAMEND

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

Delay_MS
incf SysWaitTempMS_H, F,ACCESS
DMS_START
movlw 4
movwf DELAYTEMP2,ACCESS
DMS_OUTER
movlw 165
movwf DELAYTEMP,ACCESS
DMS_INNER
decfsz DELAYTEMP, F,ACCESS
bra DMS_INNER
decfsz DELAYTEMP2, F,ACCESS
bra DMS_OUTER
decfsz SysWaitTempMS, F,ACCESS
bra DMS_START
decfsz SysWaitTempMS_H, F,ACCESS
bra DMS_START
return

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

;Source: system.h (154)
INITSYS
;asm showdebug This code block sets the internal oscillator to ChipMHz
;The section now handles two true tables for frequency
;Supports 16f and 18f (type1 max frq of 8mhz) classes and 18f (type2 max frq of 16mhz) classes
;Assumes that testing the ChipMaxMHz >= 48 is a valid test for type2 microcontrollers
;Supports IntOsc MaxMhz of 64 and not 64 ... there may be others true tables that GCB needs to support in the future
;asm showdebug OSCCON type is 104' NoBit(SPLLEN) And NoBit(IRCF3) Or Bit(INTSRC)) and ifdef Bit(HFIOFS)
;= 8Mhz
;OSCCON = OSCCON AND b'10001111'
movlw 143
andwf OSCCON,F,ACCESS
;Address the two true tables for IRCF
;[canskip] IRCF2, IRCF1, IRCF0 = b'111' ;111 = 8 MHz (INTOSC drives clock directly)
bsf OSCCON,IRCF2,ACCESS
bsf OSCCON,IRCF1,ACCESS
bsf OSCCON,IRCF0,ACCESS
;asm showdebug _Complete_the_chip_setup_of_BSR,ADCs,ANSEL_and_other_key_setup_registers_or_register_bits
;Clear BSR on ChipFamily16 MCUs
;BSR = 0
clrf BSR,ACCESS
;Clear TBLPTRU on MCUs with this bit as this must be zero
;TBLPTRU = 0
clrf TBLPTRU,ACCESS
;Ensure all ports are set for digital I/O and, turn off A/D
;SET ADFM OFF
bcf ADCON2,ADFM,ACCESS
;Switch off A/D Var(ADCON0)
;SET ADCON0.ADON OFF
bcf ADCON0,ADON,ACCESS
;SET PCFG3 ON
bsf ADCON1,PCFG3,ACCESS
;SET PCFG2 ON
bsf ADCON1,PCFG2,ACCESS
;SET PCFG1 ON
bsf ADCON1,PCFG1,ACCESS
;SET PCFG0 ON
bsf ADCON1,PCFG0,ACCESS
;Turn off comparator - this is the default setting
;CMCON = 7
movlw 7
movwf CMCON,ACCESS
;
;'Turn off all ports
;PORTA = 0
clrf PORTA,ACCESS
;PORTB = 0
clrf PORTB,ACCESS
;PORTC = 0
clrf PORTC,ACCESS
;PORTE = 0
clrf PORTE,ACCESS
return

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


END
cavallo_leo





postato il:
28.11.2021, alle ore 12:08
Ho risolto.. grazie..
segui questo thread con grixFC, per questa funzione devi aver installato il software grixFC

torna su
     

Come utente anonimo puoi leggere il contenuto di questo forum ma per aprire una discussione
o per partecipare ad una discussione esistente devi essere registrato ed accedere al sito




 

 
 
indietro | homepage | torna su copyright © 2004/2022 GRIX.IT - La community dell'elettronica Amatoriale