; description for embedded beginner, feedback and sugesstion for next steps
; P2MA683blink 20240320
; board: curiosity development PIC12F683 5V INTOSC8MHZ
; MCU: PIC12F683 8pin DIP ROM:2KW,RAM:126byte
; language: Assembler pic-as(v2.46)
; IDE: MPLAB XIDE v6.20
; Debug: Tool PICkit3/PICkit4
;//PINOUT: PIC12F683 8PINDIP
;//3V3 1 VDD VSS 8 GND
;// 2 GP5 GP0 7 ICSPDAT
;// 3 GP4 GP1 6 ICSPCLK
;//RST S1 4 GP3/MCR GP2 5 D6
;---------------------------------------
PROCESSOR 12F683
#include
config FOSC = INTOSCIO
config WDTE = OFF, PWRTE = OFF, MCLRE = ON
config CP = OFF, CPD = OFF, BOREN = ON, IESO = ON, FCMEN = ON
; ******* RAM *************************
count1 equ 0x70
count2 equ 0x71
count3 equ 0x72
; ******* main ***********************
PSECT Por_Vec,class=CODE,delta=2
BANKSEL(OSCCON) ;
movlw 0x70
movwf BANKMASK(OSCCON); OSC:8MHz
BANKSEL(GPIO) ;
clrf BANKMASK(GPIO) ; GPIO:0
BANKSEL(ANSEL) ;
clrf BANKMASK(ANSEL) ; ALL Digital
BANKSEL( TRISIO) ;
clrf BANKMASK(TRISIO) ; ALL OUTPUT
BANKSEL(GPIO) ;
;-------------------------------------
Loop: bsf GP2 ; GP2=1
call delay ; dalay
bcf GP2 ; GP2=0
call delay ; delay
goto Loop
;;----------------------------------------------
delay: clrf count1
clrf count2
movlw 4
movwf count3
;------------------------------------------------
delayLoop:
decfsz count1,F
goto delayLoop
decfsz count2,F
goto delayLoop
decfsz count3,F
goto delayLoop
return
;--------------------------------------------------
; result
; Data 0/128 bytes 0%
; program 27/2048word 1%
end