Truncated match.
PICList
Thread
'Help with simulator's stimulus file'
1998\02\03@011311
by
Rawle Watson
|
Hi Guys,
I 'm using microchip's simulator (MPSIM 5.20) to test my program. For the
loading and the execution of the program, everything went alright. However,
I'm experiencing difficulty creating the stimulus file.
I'm not too clear on how the steps in the this file are determined. For the
example (see below) given in the users manual, there is cycle 3, cycle 10,
cycle 16 etc. in the Column Headings section, corresponding with step 3,
step 4, step 9 etc. Where did these numbers come from?
Thanks for your speedy response.
Rawle
STEP RB2 RA3 RA2 RA1 RA0 !Column Headings
3 0 0 1 0 0 !stimulus before cyc1e 3
4 1 0 1 0 1 !injected before cycle 10
9 1 1 0 1 0 !injected before cycle 16
10 0 1 0 1 1 !stimulus before cyc1e 3
15 0 0 0 0 0 !injected before cycle 9
16 1 0 0 0 1 !injected before cycle 15
Fig 1. Stimulus file (sample.sti)
;*******************************************************************
; SAMPLE.ASM
; 8x8 Software Multiplier
;*******************************************************************
;
; The 16 bit result is stored in 2 bytes
;
; Before calling the subroutine " mpy ", the multiplier should
; be loaded in location " mulplr ", and the multiplicand in
; " mulcnd " . The 16 bit result is stored in locations
; H_byte & L_byte.
;
; Performance :
; Program Memory : 15 locations
; # of cycles : 71
; Scratch RAM : 0 locations
;
; This routine is optimized for code efficiency ( looped code )
; For time efficiency code refer to "mult8x8F.asm" ( straight line code )
;*******************************************************************
;
LIST p=16C54 ; PIC16C54 is the target processor
mulcnd equ 09 ; 8 bit multiplicand
mulplr equ 10 ; 8 bit multiplier
H_byte equ 12 ; High byte of the 16 bit result
L_byte equ 13 ; Low byte of the 16 bit result
count equ 14 ; loop counter
portb equ 06 ; I/O register F6
STATUS equ 03 ; STATUS register F3
CARRY equ 0 ; Carry bit in status register
Same equ 1 ;
;
;
; ***************************** Begin Multiplier Routine
mpy_S clrf H_byte
clrf L_byte
movlw 8
movwf count
movf mulcnd,w
bcf STATUS,CARRY ; Clear the carry bit in the status Reg.
loop rrf mulplr,Same
btfsc STATUS,CARRY
addwf H_byte,Same
rrf H_byte,Same
rrf L_byte,Same
decfsz count,Same
goto loop
;
retlw 0
;
;********************************************************************
; Test Program
;*********************************************************************
start clrw
option
main movf portb,w
movwf mulplr ; multiplier (in mulplr) = 05
movf portb,w
movwf mulcnd
;
call_m call mpy_S ; The result is in locations F12 & F13
; H_byte & L_byte
;
goto main
;
org 01FFh
goto start
;
END
Step RB2 RA3 RA2 RA1 RA0 !Column Headings
3 0 0 1 0 0 !stimulus before cyc1e 3
4 1 0 1 0 1 !injected before cycle 10
9 1 1 0 1 0 !injected before cycle 16
10 0 1 0 1 1 !stimulus before cyc1e 3
15 0 0 0 0 0 !injected before cycle 9
16 1 0 0 0 1 !injected before cycle 15
Bye,
Rawle.
1998\02\03@070317
by
Rawle Watson
|
Hi Guys,
I 'm using microchip's simulator (MPSIM 5.20) to test my program. For the
loading and the execution of the program, everything went alright. However,
I'm experiencing difficulty creating the stimulus file.
I'm not too clear on how the steps in the this file are determined. For the
example (see below) given in the users manual, there is cycle 3, cycle 10,
cycle 16 etc. in the Column Headings section, corresponding with step 3,
step 4, step 9 etc. Where did these numbers come from?
Thanks for your speedy response.
Rawle
STEP RB2 RA3 RA2 RA1 RA0 !Column Headings
3 0 0 1 0 0 !stimulus before cyc1e 3
4 1 0 1 0 1 !injected before cycle 10
9 1 1 0 1 0 !injected before cycle 16
10 0 1 0 1 1 !stimulus before cyc1e 3
15 0 0 0 0 0 !injected before cycle 9
16 1 0 0 0 1 !injected before cycle 15
Fig 1. Stimulus file (sample.sti)
;*******************************************************************
; SAMPLE.ASM
; 8x8 Software Multiplier
;*******************************************************************
;
; The 16 bit result is stored in 2 bytes
;
; Before calling the subroutine " mpy ", the multiplier should
; be loaded in location " mulplr ", and the multiplicand in
; " mulcnd " . The 16 bit result is stored in locations
; H_byte & L_byte.
;
; Performance :
; Program Memory : 15 locations
; # of cycles : 71
; Scratch RAM : 0 locations
;
; This routine is optimized for code efficiency ( looped code )
; For time efficiency code refer to "mult8x8F.asm" ( straight line code )
;*******************************************************************
;
LIST p=16C54 ; PIC16C54 is the target processor
mulcnd equ 09 ; 8 bit multiplicand
mulplr equ 10 ; 8 bit multiplier
H_byte equ 12 ; High byte of the 16 bit result
L_byte equ 13 ; Low byte of the 16 bit result
count equ 14 ; loop counter
portb equ 06 ; I/O register F6
STATUS equ 03 ; STATUS register F3
CARRY equ 0 ; Carry bit in status register
Same equ 1 ;
;
;
; ***************************** Begin Multiplier Routine
mpy_S clrf H_byte
clrf L_byte
movlw 8
movwf count
movf mulcnd,w
bcf STATUS,CARRY ; Clear the carry bit in the status Reg.
loop rrf mulplr,Same
btfsc STATUS,CARRY
addwf H_byte,Same
rrf H_byte,Same
rrf L_byte,Same
decfsz count,Same
goto loop
;
retlw 0
;
;********************************************************************
; Test Program
;*********************************************************************
start clrw
option
main movf portb,w
movwf mulplr ; multiplier (in mulplr) = 05
movf portb,w
movwf mulcnd
;
call_m call mpy_S ; The result is in locations F12 & F13
; H_byte & L_byte
;
goto main
;
org 01FFh
goto start
;
END
Bye,
Rawle.
1998\02\03@090904
by
Gene Norris
|
They come from the stopwatch. Open the stopwatch window reset it to zero,
step your program from the beginning to where you want a stimulus activated
and note the cycle number.
Good luck, Gene.
At 02:08 AM 2/3/98 -0400, you wrote:
{Quote hidden}>Hi Guys,
>
>I 'm using microchip's simulator (MPSIM 5.20) to test my program. For the
>loading and the execution of the program, everything went alright. However,
>I'm experiencing difficulty creating the stimulus file.
>
>I'm not too clear on how the steps in the this file are determined. For the
>example (see below) given in the users manual, there is cycle 3, cycle 10,
>cycle 16 etc. in the Column Headings section, corresponding with step 3,
>step 4, step 9 etc. Where did these numbers come from?
>
>Thanks for your speedy response.
>
>Rawle
>
>
>STEP RB2 RA3 RA2 RA1 RA0 !Column Headings
>3 0 0 1 0 0 !stimulus before cyc1e 3
>4 1 0 1 0 1 !injected before cycle 10
>9 1 1 0 1 0 !injected before cycle 16
>10 0 1 0 1 1 !stimulus before cyc1e 3
>15 0 0 0 0 0 !injected before cycle 9
>16 1 0 0 0 1 !injected before cycle 15
>
>Fig 1. Stimulus file (sample.sti)
>
>
>
>
>;*******************************************************************
>; SAMPLE.ASM
>; 8x8 Software Multiplier
>;*******************************************************************
>;
>; The 16 bit result is stored in 2 bytes
>;
>; Before calling the subroutine " mpy ", the multiplier should
>; be loaded in location " mulplr ", and the multiplicand in
>; " mulcnd " . The 16 bit result is stored in locations
>; H_byte & L_byte.
>;
>; Performance :
>; Program Memory : 15 locations
>; # of cycles : 71
>; Scratch RAM : 0 locations
>;
>; This routine is optimized for code efficiency ( looped code )
>; For time efficiency code refer to "mult8x8F.asm" ( straight line code )
>;*******************************************************************
>;
> LIST p=16C54 ; PIC16C54 is the target processor
>
>mulcnd equ 09 ; 8 bit multiplicand
>mulplr equ 10 ; 8 bit multiplier
>H_byte equ 12 ; High byte of the 16 bit result
>L_byte equ 13 ; Low byte of the 16 bit result
>count equ 14 ; loop counter
>portb equ 06 ; I/O register F6
>STATUS equ 03 ; STATUS register F3
>CARRY equ 0 ; Carry bit in status register
>Same equ 1 ;
>;
>;
>; ***************************** Begin Multiplier Routine
>mpy_S clrf H_byte
> clrf L_byte
> movlw 8
> movwf count
> movf mulcnd,w
> bcf STATUS,CARRY ; Clear the carry bit in the status Reg.
>loop rrf mulplr,Same
> btfsc STATUS,CARRY
> addwf H_byte,Same
> rrf H_byte,Same
> rrf L_byte,Same
> decfsz count,Same
> goto loop
>;
> retlw 0
>;
>;********************************************************************
>; Test Program
>;*********************************************************************
>start clrw
> option
>main movf portb,w
> movwf mulplr ; multiplier (in mulplr) = 05
> movf portb,w
> movwf mulcnd
>;
>call_m call mpy_S ; The result is in locations F12 & F13
> ; H_byte & L_byte
>;
> goto main
>;
> org 01FFh
> goto start
>;
> END
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>Step RB2 RA3 RA2 RA1 RA0 !Column Headings
>3 0 0 1 0 0 !stimulus before cyc1e 3
>4 1 0 1 0 1 !injected before cycle 10
>9 1 1 0 1 0 !injected before cycle 16
>10 0 1 0 1 1 !stimulus before cyc1e 3
>15 0 0 0 0 0 !injected before cycle 9
>16 1 0 0 0 1 !injected before cycle 15
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>Bye,
>Rawle.
>
>
Gene Norris
spam_OUTGnorrisTakeThisOuT
earthlink.net
E. Windsor, NJ USA
More... (looser matching)
- Last day of these posts
- In 1998
, 1999 only
- Today
- New search...