PDA

View Full Version : ARM 2106 USB IsoMax code is slow , slow


DHD
05-06-07, 02:08 PM
I installed the following code on a ARM 2106 USB from NMI.

1) When I ran the word "GGG" , I measured pulses that were 1 usec wide and that occurred every 230 usecs. Is the scheduler running on a ARM 2106 USB board "off" by this factor ?

2) When I ran the state machine "TOGGLE" , my toggle rate was about 10 Hz. Why is the state machine so slow in my code ?





\ Reconfigure the Terminal Input Buffer
HEX
CREATE NTIB \ NEW TIB
100 ALLOT \ Save 256D locations for TIB


400003C0 CONSTANT TIBL
NTIB 8 + TIB ! \ move TIB to new saved space
F0 TIBL C! \ make TIB 248D characters long

\ 000000000000000000000000000000000000000000000000000000000000000000
\ 000000000000000000000000000000000000000000000000000000000000000000

\ SPTK ???? <----- PROJECT number
\ VERSION v0.0.1
\ 20070505 IsoMax Speed Test
\ based on isoMAX for the ARM processor
\ baud rate is 115K BAUD 8N1
\ 000000000000000000000000000000000000000000000000000000000000000000
\ HISTORY


\ 20070505 v001 created speed test

\ 0000000000000000000000000000000000000000000000000000000000000000000
\ CREATED BY DHD aka Bill Goodrich billgoodrich.com
\ AGSC @ RADMI.com omegadogs.com wftelectronics.com
\ 0000000000000000000000000000000000000000000000000000000000

\ create names P30 and P31 for appropriate addresses
HEX
40000000 CONSTANT P30 \ data zero
80000000 CONSTANT P31 \ data one
FFFFFFFF CONSTANT TRUE \ defines true
00000000 CONSTANT FALSE \ defines false



HEX
C0000000 IODIR !

\ define the state machine named CRDRDR

MACHINE TOGGLE ON-MACHINE CRDRDR
APPEND-STATE AAA
APPEND-STATE BBB


\ begin definitions of states used by CRDRDR


\ rest state

IN-STATE
AAA
CONDITION
TRUE
CAUSES
P31 ON
THEN-STATE
BBB
TO-HAPPEN

IN-STATE
BBB
CONDITION
TRUE
CAUSES
P31 OFF
THEN-STATE
AAA
TO-HAPPEN


: PULSE P31 ON P31 OFF ;


\ end of definitions of states
\ 0000000000000000000000000000000000000000000000000000


: GG ." TOGGLE running " CR AAA SET-STATE INSTALL TOGGLE ;
: GGG ." SCHEDULE running " CR EVERY 100 MICROSECONDS SCHEDULE-RUNS PULSE ;

Dave
05-09-07, 05:02 PM
I believe the state machine (renamed CRDRDR to match other references and avoid conflict with WORD TOGGLE) is running at the default period of every 50000 cycles, or every 50000 microseconds.

The other word GGG, not sure what is going on there, but checking. I'm getting about 250 usec, which may mean an extra clock divider has been set somewhere.

DHD
05-09-07, 07:16 PM
How do you change the default scheduling value for the state machine ?

Best Cedric

DHD
05-09-07, 09:47 PM
There were some typos in the code I gave you. I don't know how they got in there. Thanks for relating that the the state machine was running at a default of 50,000 microseconds. I have figured that part out now I think. What is the range of microseconds for scheduling ? What is the largest and smallest amount you can have for the ARM 2106 USB board ?

Best

nmitech
05-10-07, 10:47 AM
: GG ." TOGGLE running " CR AAA SET-STATE INSTALL TOGGLE ;

If you don't define PERIOD based on the the above statement, the default period is 1 MILLISECONDS, and the lowest period you can set is 50 MICROSECONDS. See page 60 of the IsoMax ARM manual,
http://www.newmicros.com/store/product_manual/isomaxarmum.pdf

To change the default scheduling value for the state machine, simply do
100 MICROSECONDS PERIOD
: GG ." TOGGLE running " CR AAA SET-STATE INSTALL TOGGLE ;
or,
: GG ." TOGGLE running " CR EVERY 100 MICROSECONDS SCHEDULE-RUNS TOGGLE ;

nmitech
05-10-07, 11:48 AM
Your GGG was running at 100 hex not 100 decimal microseconds.
Besure to put it in decimal mode,
DECIMAL 100 MICROSECONDS PERIOD
: GG ." TOGGLE running " CR AAA SET-STATE INSTALL TOGGLE ;
or,
DECIMAL
: GGG ." SCHEDULE running " CR EVERY 100 MICROSECONDS SCHEDULE-RUNS PULSE ;