timestep

Status
Not open for further replies.

imisendo_4036

New Member
hello...just need help

can anyone explain what is the meaning of time step too small in pic...
i have run my project's simulation...
but there is an error that highlight about the time step too small...
what should i do to overcome this problem...

I'm really appreciate your help....plz
 
i take this from the internet....

;PROGRAM TO CONTROL DC MOTOR SPEED
;BY MOHD ZULHILMI BIN MAT DAUD USING PIC16F873

;*****DECLARATION*****

PROCESSOR 16F873
#include "p16F873.INC"
__CONFIG _HS_OSC & _WDT_OFF & _PWRTE_ON & _LVP_OFF
errorlevel -302

;*****LABEL****

speed equ d'8';8x5/256=0.156
change equ d'1'
led equ h'20'

;****PROGRAM START*****

org 0
goto init
org 4
goto int

;*****INITIAL PROCESS******

init

;*****PORT****
bsf 03h,5
movlw b'00000010'
movwf 85h ;set port A bit 0 as input
clrf 86h ;port b output
clrf 87h ;port c output
bcf 03h,5

;****A/D CONVERTER*****

movlw b'10000101'
movwf 1Fh ;adcon0
bsf 03h,5
movlw b'00001110'
movwf 9Fh ;adcon1
bcf 03h,5

;*****PWM*****

clrf 11h ;tmr2
movlw d'255'
movwf 15h ;ccpr1L
bsf 03h,5
movlw d'255'
movwf 92h ;pr2
bcf 03h,5
movlw b'00000111'
movwf 12h ;t2con
movlw b'00011100'
movwf 17h ;ccp1con

;*****COMPARE MODE*****

clrf 0Fh ;tmr1h
clrf 0Eh ;tmr1L
movlw h'61'
movwf 1Ch;ccpr2h
movlw h'A8'
movwf 1Bh;ccpr2L
movlw b'00000001'
movwf 10h;t1con
movlw b'00001011'
movwf 1Dh;ccp2con

;****INTERRUPTION CONTROL******

bsf 03h,5
movlw b'00000001'
movwf 8Dh;pie2
bcf 03h,5
movlw b'11000000'
movwf 18Bh;intcon

wait
goto $

;*****INTERRUPTION PROCESS*****

int
clrf 0Dh

ad_check

btfsc 1Fh,2;cek A/D siap x?
goto ad_check
movlw 1Eh;adresh, A/D result high register
sublw speed
btfsc 03h,0;bit test f,skip next instruction if clear
goto check1

;****LOW SPEED*****
movlw 15h;ccpr1L
addlw change
btfss 03h,0;bit test f,skip next instruction if set
movwf 15h;ccpr1L
goto led_cont

check1
btfsc 03h,2
goto led_cont

;****FAST SPEED******
movlw change
subwf 15h,1;ccpr1L-1
btfsc 03h,0
goto led_cont
clrf 15h

;******LED CONTROL******

led_cont
comf 15h,0;ccpr1L
movwf led
movlw b'00010000'
subwf led,0
btfsc 03h,0
goto led1
movlw b'00000000'
goto int_end
led1
movlw b'00100000'
subwf led,0
btfsc 03h,0
goto led2
movlw b'00000001'
goto int_end
led2
movlw b'01000000'
subwf led,0
btfsc 03h,0
goto led3
movlw b'00000011'
goto int_end
led3
movlw b'01100000'
subwf led,0
btfsc 03h,0
goto led4
movlw b'00000111'
goto int_end
led4
movlw b'10000000'
subwf led,0
btfsc 03h,0
goto led5
movlw b'00001111'
goto int_end
led5
movlw b'10100000'
subwf led,0
btfsc 03h,0
goto led6
movlw b'00011111'
goto int_end
led6
movlw b'11000000'
subwf led,0
btfsc 03h,0
goto led7
movlw b'00111111'
goto int_end
led7
movlw b'11100000'
subwf led,0
btfsc 03h,0
goto led8
movlw b'01111111'
goto int_end
led8
movlw b'11111111'

;******END INTERRUPTION******
int_end
movwf 06h
retfie

;**********END OF DC MOTOTR SPEED CONTROLLER*******

END

end
 
You need to use the code tags when posting code, #
At a glance the code looks ok, just strangely written.
example
Code:
  movwf 10h;t1con
is normally written
  movwf T1CON
 
Last edited:
When MOHD ZULHILMI BIN MAT DAUD wrote the code he for whatever reason decided to use the absolute address of the SFRs even though he used an include file (which gives names to the absolute addresses)

If you're just starting out with PICs start with something simple like flashing an LED, g
 
Last edited:
imisendo_4036 said:
can anyone explain what is the meaning of time step too small in pic...
i have run my project's simulation...
but there is an error that highlight about the time step too small...
what should i do to overcome this problem...
Are you possibly talking about the MPLAB Simulator Animate Step Time?

The above is the default step time. Did you change it?
 
nope...
i run in my circuit simulation......
n i use isis simulator to create my circuit...

i have already done the basic project like LED and so on...
so right i now i just want to try project that using pwm to control the speed of motor....can anyone explain about it....
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…