If you put the following at the beginning of your code You will be able to use words like TRISB, PORTB , STATUS etc.
list P=16f627
#include "p16f627a.inc"
__config _HS_OSC & _WDT_OFF & _PWRTE_ON & _LVP_OFF
The #include does this.
The _config sets the type of oscillator to be used for the system clock
As you are using a 20 MHZ crystal the instruction cycle time will be 200 nS (4 cycles of 20 MHZ)
As the BSF instruction takes 1 system clock cycle the LEDs will only be on for 200 nS
The reason for the stack overflow is because you do not have a return instruction at the end of your delay subroutine.
Also you either have to jump past the delay subroutine to get to the main program loop or move the delay routine to the end of the code.
The logic of your program will not do what has been specified.
Your delay routine needs to either contain a loop to count a lot of instructions or use one of the timers to produce a delay. Note 1 second delay requires 5000000 instruction cycles.
If you are counting instruction cycles bear in mind that some instructions take more than 1 instruction cycle.
Les.
list P=16f627
#include "p16f627a.inc"
__config _HS_OSC & _WDT_OFF & _PWRTE_ON & _LVP_OFF
The #include does this.
The _config sets the type of oscillator to be used for the system clock
As you are using a 20 MHZ crystal the instruction cycle time will be 200 nS (4 cycles of 20 MHZ)
As the BSF instruction takes 1 system clock cycle the LEDs will only be on for 200 nS
The reason for the stack overflow is because you do not have a return instruction at the end of your delay subroutine.
Also you either have to jump past the delay subroutine to get to the main program loop or move the delay routine to the end of the code.
The logic of your program will not do what has been specified.
Your delay routine needs to either contain a loop to count a lot of instructions or use one of the timers to produce a delay. Note 1 second delay requires 5000000 instruction cycles.
If you are counting instruction cycles bear in mind that some instructions take more than 1 instruction cycle.
Les.