Hi,
As what Jayanth has said plus a couple of other things.
PortA defaults to Analogue Inputs at power on, so you must change them to digital ports - ADCON1
The reason you have a problem with your second delay is the use of the 'end' instruction.
It denotes the end of the whole program code, you have used one after each delay, so its just ignoring delay2.
After your 'call delay2' that should be the end of your program loop, but there is nothing there to stop it going into the dealy1 routine.
It needs to be directed back to your loop.
You need to specify what speed oscillator you are using, I assume from your delays its 20mhz.
You need to specify this in you code by means of the Config statements.
I have added the correct one for 20mhz and a few other essential statements
Your code runs ok, if you use the Mplab, Debugger, 'Sim'ulator you can use its Stopwatch with the BreakPoints to check your timings.
Code:
; assignment.asm
title"assignment.asm"
list p=18f452, f=inhx32
#include<p18f452.inc>
CONFIG WDT=OFF ; Disable watchdog timer
CONFIG DEBUG = OFF ; Disable Debug Mode
CONFIG LVP = OFF ; Disable low voltage programming
CONFIG OSC=HS ; for 20mhz
delaycnt equ 0x04
org 0x00
goto start
start
movlw 0x07 ; set ports to digital from the power on default of analogue
movwf ADCON1
CLRF PORTA ; initalizing port A by clearing output
CLRF PORTC ; initalizing port C by clearing output
MOVLW b'00000001' ;move literal value 1 to working register
MOVWF TRISA ;set RA <0> as input and rest as output
MOVLW b'00000011' ;move literal value 3 to working register
MOVWF TRISC ;set RC <1:0> as input and rest as output
loop BCF PORTA,0
BCF PORTC,0
BCF PORTC,0
call delay1
BSF PORTA,0
call delay2
goto loop
delay1 movlw d'34' ;loop 50 micro seconds
movwf delaycnt
delayloop1 nop
nop
nop
nop
decfsz delaycnt, f
goto delayloop1
nop
nop
nop
nop
nop
nop
return
delay2 movlw d'70' ;loop 100 micro seconds
movwf delaycnt
delayloop2 nop
nop
nop
nop
decfsz delaycnt, f
goto delayloop2
nop
nop
nop
nop
return
end