Qualcuno potrebbe aiutarmi a sistemare un programma che è stato scritto per PIC16F84A
in modo che vada bene per il PIC16F628.
Non mi importa di usare l' oscillatore interno voglio proprio che il minimo cambiamento da fare dei registri in modo che vada tutto bene.
I registri che devo settare (ma dove vano scritti?) dovrebbero essere
Riassumendo
Per il PICF1628 funzionante come ilPIC16F84A configurare quanto segue:
Configuration Word è 1 1| 1 1 0 1| 0 0 1 0 | 0 0 0 1 B (0X 3D
3 D 2 1PCON REGISTER: modificarlo solo per eliminare il quarzo esterno e la freq di
oscill. (si trova nel bank 1)
Caricare 7 in CMCON (è nel banK0)
usare ORG 20H
e se, meglio ancora, mi aggiustate questo pezzo vecchio? (forse capisco meglio)
;**************************************************
; Pic by example
; SEmaforo.ASM
;;**************************************************
PROCESSOR 16F84A
RADIX DEC
INCLUDE "P16F84A.INC"
ERRORLEVEL -302
;Setup of PIC configuration flags
;XT oscillator
;Disable watch dog timer
;Enable power up timer
;Disable code protect
__CONFIG 0x3FF1
LED1 EQU 1
LED2 EQU 2
LED3 EQU 3
LED4 EQU 4
LED5 EQU 5
LED6 EQU 6
SW1 EQU 7
ORG 0x0C
Count RES 3
;Reset Vector
;Start point at CPU reset
ORG 0x00
bsf STATUS,RP0
;******************* 1 ingresso 0 uscita
movlw B'00011111'
movwf TRISA
;******************* 1 ingresso 0 uscita
movlw B'10000000'
movwf TRISB
bcf STATUS,RP0
bcf PORTB,LED1
bcf PORTB,LED2
bcf PORTB,LED3
bcf PORTB,LED4
bcf PORTB,LED5
bcf PORTB,LED6
MainLoop
;*******************tempo rosso verde, con SW1 RB7 bit 13 a 5V va a notte
un milione di grazie