kahjoo
Junior Member level 2
- Joined
- Jul 23, 2012
- Messages
- 21
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,456
Hi,
I in the middle of porting the MCU from 16F685 to 16F1828. Before transfer the old code to 18F1828, I've tried to run the MCU with the simple test program.
I'm using PICKit Eval board as to test the program. After program and run, found out the output pin of RC0 cannot drive the LED which only give about 1V output.
with the same code, change of config, I've run in 16F690 and there is no problem and LED able to be light up. Anything config that I miss out or wrong which I may overlook.
Below is original code of the 16F1828:-
I in the middle of porting the MCU from 16F685 to 16F1828. Before transfer the old code to 18F1828, I've tried to run the MCU with the simple test program.
I'm using PICKit Eval board as to test the program. After program and run, found out the output pin of RC0 cannot drive the LED which only give about 1V output.
with the same code, change of config, I've run in 16F690 and there is no problem and LED able to be light up. Anything config that I miss out or wrong which I may overlook.
Below is original code of the 16F1828:-
#include <p16F1828.inc>
__CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_OFF & _MCLRE_ON & _CP_OFF & _CPD_OFF & _BOREN_OFF & _CLKOUTEN_ON & _IESO_OFF & _FCMEN_OFF __CONFIG _CONFIG2, _WRT_OFF & _PLLEN_OFF & _STVREN_OFF & _BORV_19 & _LVP_OFF
cblock 0x20
Delay1 ;Define two file registers for the
Delay2 ; delay loop endc
org 0
Start
banksel TRISC
bcf TRISC,0 ; make IO Pin B.0 an output
movlw b'01101010' ;set osc
banksel OSCCON
movwf OSCCON ;configure OSCCON register
MainLoop
bsf PORTC,0 ; turn on LED C0
OndelayLoop
decfsz Delay1,f ; Waste time.
goto OndelayLoop ; The Inner loop takes 3 instructions per loop * 256 loopss = 768 instructions
decfsz Delay2,f ; The outer loop takes and additional 3 instructions per lap * 256 loops
goto OndelayLoop ; (768+3) * 256 = 197376 instructions / 1M instructions per second = 0.197 sec. ; call it a two-tenths of a second.
bcf PORTC,0 ; Turn off LED C0
OffDelayLoop
decfsz Delay1,f ; same delay as above goto OffDelayLoop
decfsz Delay2,f
goto OffDelayLoop
goto MainLoop ; Do it again...
end