PDA

View Full Version : How to Branch States?


panorama
04-28-03, 09:49 PM
Hi,
Boy am I rusty after being away for awhile.

I have three states, A, B, C. Half the time I must go from state A to B to C and back to A, etc. The other half of the time I must go from A to C to B and back to A, etc.

The direction is determined by a global variable set by another machine. The states are changed when a timer expires. I want to do this:

Machine Quad
On-Machine Quad
Append-State A+
Append-State A-
Append-State B+
Append-State B-
Append-State C+
Append-State C-

In-State A+
Condition TimerDone
Causes PA0 On
Then-State B+
To-Happen

In-State A-
Condition TimerDone
Causes PA1 On
Then-State C-
To-Happen

Suppose I start with A+. This is fine as long as global variable DIR is True, except how do I get to State A- when I determine that DIR is False? Can I do an IF THEN ELSE to determine which state to go to next?

Thanks,
Tim

RMDumse
04-28-03, 10:24 PM
There is no concept like IF-ELSE-THEN in state transitions. Each transition must be uniquely identified.

If you wish to go backwards around your loop of states, You need a transition for every possible path between given states.

I am not quite following your example, but perhaps you should have only three states, A B C (and maybe a D for quad?), and two transitions for each state with an additional qualification in the condition part of the transition, like this:

IN-STATE A
CONDITION TimerDone Dir @ 0= NOT AND
CAUSES PA0 ON
THEN-STATE B
TO-HAPPEN

IN-STATE A
CONDITION TimerDone Dir @ 0= AND
CAUSES PA1 ON
THEN-STATE C
TO-HAPPEN

panorama
04-28-03, 11:43 PM
Yeah,
After two days of thinking and studying about it, I realized about an hour later how to do it. Problem is, there are four states, as you suggest, and it starts to get ugly. I'm wondering if it may be better to use spagetti code:

In-State Quad
condition timer-ready
causes EvalQuad
Then-State Quad
To-Happen

And EvalQuad will test the current State and Dir in a binary branching tree.

Neither way is very elegant, though I am starting to lean toward your way. It reduces the number of proceedures to call.

Thanks.

Tim

RMDumse
04-29-03, 12:38 AM
Let me ask, if you want to generate a quadrature output with a timer, why not let the hardware of the timer do the job? It has a setting for that, if you didn't know. Consider this:

SCRUB

HEX
: QUAD-GEN-INIT
0000 D26 ! ( CTRL TMRB0 STOP TIMER WHILE INIT
0000 D2E ! ( CTRL TMRB1 STOP TIMER WHILE INIT
0000 D36 ! ( CTRL TMRB2 STOP TIMER WHILE INIT
0000 D3E ! ( CTRL TMRB3 STOP TIMER WHILE INIT

0.0 E57 2! ( CLEAR QUAD REG

FFFF D38 ! ( CMP1 FOR OVERFLOW
0000 D39 ! ( CMP2 FOR UNDERFLOW
9C40 D3B ! ( LOAD ON UNDERFLOW ( 40,000 gives 1ms toggles .2ms period
0000 D3D ! ( COUNTER
31B3 D3E ! ( CTRL TMRB3 COUNT ON
0001 D3F ! ( STATUS


FFFF D30 ! ( CMP1 FOR OVERFLOW
0000 D31 ! ( CMP2 FOR UNDERFLOW
0064 D33 ! ( LOAD ON UNDERFLOW ( 100 gives .2s toggless .4s period
0000 D35 ! ( COUNTER
2F33 D36 ! ( CTRL TMRB2
0001 D37 ! ( STATUS

FFFF D28 ! ( CMP1 FOR OVERFLOW
0000 D29 ! ( CMP2 FOR UNDERFLOW
0003 D2B ! ( CMP2 FOR UNDERFLOW
0003 D2D ! ( COUNTER
( 2C33 D2E ! ( CTRL TMRB1
0001 D2F ! ( STATUS

FFFF D20 ! ( CMP1 FOR OVERFLOW
0000 D21 ! ( CMP2 FOR UNDERFLOW
0003 D23 ! ( CMP2 FOR UNDERFLOW
0001 D25 ! ( COUNTER
( 2C33 D26 ! ( CTRL TMRB0
0001 D27 ! ( STATUS

( START THEM AT THE SAME TIME
2C33 D2E ! ( CTRL TMRB1
2C33 D26 ! ( CTRL TMRB0
; EEWORD

( FOLLOW GIVES A VISUAL INDICATION,
( BUT IT SHOULD ONLY BE TRUSTED AT
( LOW OUTPUT RATES LESS THAN 125 Hz
( BECAUSE IT RUNS ONLY 1000 TIMES A SECOND
( AND CAN GET INTO SYNCH'D ALIASING MODES
( WHICH LOOK ERRONEOUS FOR HIGHER FREQS.
( FOLLOW IS ONLY A TOOL AND CAN BE OMITTED
( AS CAN IT'S STARTUP LINE "EVERY C...." LINE
: FOLLOW
E5D @ 0080 AND REDLED SET ( QUAD DECODER INPUT PH A
E5D @ 0040 AND YELLED SET ( QUAD DECODER INPUT PH B
E5D @ 0020 AND GRNLED SET ( QUAD DECODER INPUT PH IN
; EEWORD

HEX
: STARTUP
QUAD-GEN-INIT
EVERY C350 A / CYCLES SCHEDULE-RUNS FOLLOW
; EEWORD

D3B CONSTANT PRESCALER EEWORD ( DEFAULT CONTENTS 94C0 40,000
D33 CONSTANT COUNTER EEWORD ( DEFAULT CONTENTS 64 100
( USE
( 0 PRESCALER !
( 0 COUNTER !
( GIVES 1.2 MHz OUTPUT
( DECIMAL
( 40000 1- PRESCALER !
( 50000 1- COUNTER !
( GIVES .0006 Hz OUTPUT

DECIMAL
: CYC/SEC
40.E6 PRESCALER @ 1+ 0 D>F F/
COUNTER @ 1+ 0 D>F F/
32 S>F F/
( F/ F. ." Hz"
; EEWORD

: DUR. ( HALF CYCLE TIME
.5E0
CYC/SEC
F/ F. ." SEC/H.C."
; EEWORD

: FREQ.
CYC/SEC
F. ." Hz"
; EEWORD

HEX
: QUAD.
E57 2@ D.
; EEWORD

HEX
: REV D2D @ D24 @ DUP 0= IF 4 + THEN U< IF 4 D2D ELSE 4 D25 THEN +! ; EEWORD

( HEX 7C00 AUTOSTART STARTUP
( SAVE-RAM

panorama
04-29-03, 11:20 AM
This is great, but since I have 3 quad outputs to handle, and it will take a lot of work anyway to take care of the zero case, and the negitive case, I think it will be just as good to do it in program.

Also, I don't need much speed, and there is nothing else to do except read the joysticks to determine the speed and direction.

Question: Is it better to run the analog conversion continuously, or turn it on and off each time I read? At what rate is the cut-off?

Tim

RMDumse
04-29-03, 11:54 AM
My preference is to set the A/D up to convert continously, then just take the data when I want it. Why not? Covernsions should be less than a few microseconds old that way.

But what I really perfer is to take a time weighted average, as much of the jitter and noise can be surpressed.


SCRUB ( CLEARS THE MEMORY

HEX

2VARIABLE RUN-AVE EEWORD
VARIABLE RUN# EEWORD 40 RUN# !

DECIMAL
1.0E0 FCONSTANT SCALE EEWORD
HEX

: INIT
2003 0E80 ! ( ASSIGN ADC CONTROL REG 1
003D 0E81 ! ( ASSIGN ADC CONTROL REG 2
3210 0E83 ! ( ASSIGN ADC CHANNEL LIST REG 1
7654 0E84 ! ( ASSIGN ADC CHANNEL LIST REG 2

0.0 RUN-AVE 2!
40 RUN# !
; EEWORD

: ANA0
E89 @ 8 / ( OUTPUT REGISTER FOR ADC CHANNEL ZERO
; EEWORD

: A/D
RUN-AVE 2@ D>F FDUP RUN# @ S>F F/ F-
F>D ANA0 S->D D+ RUN-AVE 2! ( running average
; EEWORD

: SMOOTH. RUN-AVE 2@ D>F RUN# @ S>F F/ SCALE F* F. ; EEWORD


( TEST WORD
( DISPLAYS THE VALUE OF ADC REGISTER VS. SMOOTHED
: Z DECIMAL BEGIN CR ANA0 . SMOOTH. ?TERMINAL UNTIL ; EEWORD

MACHINE-CHAIN ALL
A/D
( ...
( ...
END-MACHINE-CHAIN EEWORD

INIT EVERY 2000 CYCLES SCHEDULE-RUNS ALL ( KEEP ON REPEATING

panorama
04-29-03, 12:53 PM
Thanks again,
I already noticed this, but if you keep the averaging number under 40 Hex (I use 20,) you don't have to bother with either double or floating values until the very end:

: A/D
RUN-AVE @ DUP RUN# @ / - ANA0 + RUN-AVE ! ( running average
; EEWORD

: SMOOTH. RUN-AVE @ S>F RUN# @ S>F F/ F. ; EEWORD

or simply:
: SMOOTH. RUN-AVE @ RUN# @ / . ; EEWORD

Although you might theoretically lose a little accuracy, I doubt that you will lose any real accuracy.

For my joystick to quadrature application, I need a small dead spot anyway, so +/- one count is good enough for me.

Tim

panorama
05-02-03, 12:00 PM
Hi,
Got the app working pretty well, but have a few questions about the development system.
1) the NMITerm program seems to have some problems with file i/o. I loose data, and find it somewhere else, or I cancel a file open, but it is opened anyway, etc. Has this been updated?
2) What is the proper way to initialize double and floating data? Right now I use X S->D D>F, which is not very convienient.
3) Please point me to an application complete with autostart.
Thanks
Tim

RMDumse
05-02-03, 11:44 PM
1) See if you have the latest version of NMITerm. It has gotten much better with revisions.

2) You can directly enter doubles by putting a decimal point in them. The decimal point doesn't stick with the value as a radix, that takes extra programming (see DPL), but only signifies the value goes on the stack as a double. You can directly enter Floats by putting and exponent on the end of them.

2VARIABLE DVAR
FVARIABLE FVAR

DECIMAL
: INIT
0.0 DVAR 2! ( or .0 or 0. all the same, or 1234.4457
0.0E0 FVAR F! ( or 123E0 or 0.123E-9 etc.
;


3) See the QUAD Generator program above. Notice the last two commented out lines.

( HEX 7C00 AUTOSTART STARTUP
( SAVE-RAM

Uncommenting them is all that's needed to autostart that program.

nmitech
05-03-03, 08:56 PM
panorama,

Here is the Isopod's download page that you can get the latest version of NMITerm & Austostart appnotes,
http://www.newmicros.com/store/produt_details/download.html

panorama
05-22-03, 12:55 PM
I just downloaded the latest NMITerm, and it still has at least one serious problem. If you have an edit window open, in addition to the terminal window, and the terminal window is active, and you happen to try to scroll in the edit window, the program crashes.

I can't tell you how many times I have lost program updates this way. Terrible!

One feature that is not there, that must be there, is a Find function. If you change some function and need to search for each occurance, you are out of luck.

Question on programming:
I need just one input bit to my current program. Since I am already using most of the center row of pins on J6 for quadrature detectors, it would be very convienient for me to use INDEX1 as the input pin. I have programmed it, but it didn't work as expected. I was able to get it to work, but I want to explain what I did so you can verify that this is valid. I don't want to have a surprise later that it doesn't work on another system.

I initialized Timer B in the same way you initialized the quadrature detection using INDEX0 and HOME0:
2580 D26 !
Then I read and test like this: D27 @ 100 AND 100 =.

Why is the address D26 and D27? Since INDEX1 is on channel 2, I thought it should be D36 and D37, but that does not work.

Thanks,
Tim

nmitech
05-22-03, 02:09 PM
Use the pre-defined word, TB2 for INDEX1 as input,
TB2 ON? ( check if INDEX1/TB2 pin is a logic '1' )


What type of your PC and operating system that NMITerm crashed when you editing the document file? The SEARCH feature will be added on the next release.

nmitech
05-22-03, 02:44 PM
Does it crash everytime time you try to scroll the document window or it will take awhile for the system to crash?

What is your Operating System? Speed? Memory?

I could not duplicate this problem on my PC Win98, 2K, & XP. I am testing on NMITerm V0.9.76

Dave
05-22-03, 03:31 PM
Working with this a bit, loaded 2500 in D36 control register and then reading the 8th bit of D37 reported status well. If setting D36 with 2580, it may be waiting for an input on the Home pin (TMRB3) before changing the status.

100 D36 !

or even
2500 D36 !

then

D37 @ 100 AND 100 = .
to test

seemed to accurately report whether INDEX1 was either low or high. The suggestion above using TB2 ON? seems much simpler though. If attempting to use the INDEX1 and HOME1 as an additional A and B quadrature input, then loading 2580 in D36 should work well.

panorama
05-22-03, 04:37 PM
Dave,
Thanks for the info on using TB2. I'll use that.

NMITerm does not actually crash, it gives a message saying that the object does not support the requested function. When I say OK (the only choise is to say OK,) then the program shuts down.

I am using Win98 with 256K memory. It's an old slow machine, probably 233 Mz.

I am also running v 9.76.

Tim

Dave
05-22-03, 05:05 PM
Hi Tim,
I actually duplicated the close down described with a slightly earlier version (0.9.71) of NMITerm on a Windows XP 1.8 G Pent 4 with 128 meg.
Just installed 0.9.76, and now it won't repeat, but it seemed to be due to using a \ instead of a ( do delineate the first comment line.. others afterwards had been ok.

\ THIS IS A TEST

( THIS IS ANOTHER TEST

HEX
: TEST D36 @ D37 @ D. ;

: TEST2 D36 @ . D37 @ . ;

The above had caused the crash you described in my 9.71 version, but will not do it for 9.76 now, interesting difference.. Perhaps using parenthesis comment lines can help for now?

Dave

panorama
05-25-03, 06:29 PM
Dave and all,
I just discovered something that you might find useful.

I was comparing numbers with A B > and found that it failed when one number rolled over to a negative.

At first, I thought the only solution was to go to doubles, but after some testing, I found this solution:
A B - 0> works even across the 32K boundry.

This is great, because it is so much easier and faster than resorting to doubles.

Tim

RMDumse
05-25-03, 07:16 PM
Consider reversing the order of the items and using U< instead.

panorama
05-26-03, 12:46 PM
Randy,

I do not see that U< will work for me. For example:
65535 65534 U< . 0 OK
0 65535 U< . -1 OK

This is no different than:
32767 32766 < . 0 OK
-32768 32767 < . -1 OK

You have just shifted the problem from from one boundry to another.

Whereas my solution works on both boundries:
32767 32766 - 0< . 0 OK
-32768 32767 - 0< . 0 OK
0 -1 - 0< . 0 OK
1 0 - 0< . 0 OK

Tim

panorama
05-26-03, 02:31 PM
Guys,
I have some problems with my ISOPOD.

1) It takes a long time to respond when I attach the power. About 5 minutes. This time may be increasing.

2) Now that I have finally tried to AUTOSTART, it will not run, even after 15 minutes. This could be my fault as a programmer, or part of problem 1).

Suggestions?

3) I want to power the Isopod with a USB port. It seems the USB does not supply enough current. The USB spec says up to 400mA. How much current does the Isopod require? I found a USB Hub that can supply up to 1250 mA, so maybe that will work.

Thanks.
Tim

panorama
05-26-03, 02:34 PM
Sorry, I forgot to ask one more question.

4) When powering the Isopod with a +5v supply, can I just connect to any pin showing +5V? Do I need to remove the 5V regulator? Will it draw any power?

Tim

RMDumse
05-26-03, 03:32 PM
1) It takes a long time to respond when I attach the power. About 5 minutes. This time may be increasing.

This is very odd. Do you have the SR (Switching Regulator) or the linear option power supply?

I suppose a bad SAVE-RAM could set things off. You may need a cold reset.

2) Now that I have finally tried to AUTOSTART, it will not run, even after 15 minutes. This could be my fault as a programmer, or part of problem 1).

So the question is hardware (powersupply) or software (flashed settings of some kind). Measure the 3V rail. It should be nice and stable at something around 3.3V. Try bypassing the AUTOSTART and SAVE-RAM settings with the jumper on the SPI connector (if you have a late enough version of the software). After you get the system back, SCRUB it clean.

3) I want to power the Isopod with a USB port. It seems the USB does not supply enough current. The USB spec says up to 400mA. How much current does the Isopod require? I found a USB Hub that can supply up to 1250 mA, so maybe that will work.


The 'Pod should only take less than 230 mA. You'd think it would work on almost any USB port. Normally the 'Pods run something around 180 to 220mA's. If you have the SR option, it will be less as the supply rises due to the switching energy efficiencies. The SR option doesn't work below about 7V so this won't work off the 5V USB supply.

4) When powering the Isopod with a +5v supply, can I just connect to any pin showing +5V? Do I need to remove the 5V regulator? Will it draw any power?

You should be able to feed the 5V USB signal into the VIN pin directly, since the 5V regulator is a low pass, or into any 5V pin bypassing the 5V regulator and driving the 3V regulator directly, without having to remove anything. Efficiency could suffer, but it should work. I don't know how these specific regulator chips react to back voltage application, but others (7805's for instance I've tried) simply draw a few mills of current and are otherwise happy. The only thing on the board which runs from the 5V supply is the CAN driver. Everything else is powered from the 3V side.

panorama
05-26-03, 07:37 PM
Dave,
OK, I got it working. Problem was that I was using the PE port because it was convienient. I am planning to move to the PWM pins for I/O. I hope there is no significant speed penalty.

This actually works out better, because now I have only one connector for Quad counters and I/O.

The PA and PB pins are not convienient for my app.

Tim

panorama
05-27-03, 05:55 PM
Hi again,
I can't be sure without re-wiring my system again, but it seems that my program has slowed A LOT since I changed to the PWM ports in place of the PE ports. Does this make any sense? I am using your PWM Class functions. I use a maximum of

Please explain how scheduling works.
1) Do the machines run in the order that they appear in the machine chain statement?
2) Do all machines and all IN-STATE functions run (if condition true) on every interval?
3) What happens if your machines take longer than the interval to run?
4) Why does the prompt still appear after I burn the program in Flash and reboot? Doesn't this take time from the other machines running?
5) How can I figure out the minimum cycles that my program can run in, in order to prevent 3) above.

Thanks,
Tim

RMDumse
05-27-03, 08:33 PM
1) Do the machines run in the order that they appear in the machine chain statement?

Yes.

2) Do all machines and all IN-STATE functions run (if condition true) on every interval?

No. That's how this implementation of state machines is so superior to others. For a given machine, only one state is active. Only the conditionals of the IN-STATE transitions associated with that state run. The first conditional that is found to be "true" doesn't branch to the next condition, but executes the action portion of that transition.

So the very minimum possible amount of code is run per every scheduling of the chain.

3) What happens if your machines take longer than the interval to run?

It over runs the schedule. It tries to gracefully recover, but slips a time slot. The system variable TCFOVFLO is incremented.

4) Why does the prompt still appear after I burn the program in Flash and reboot? Doesn't this take time from the other machines running?

Sort of the opposite. The machines run to completion. All waste cycles are left with the foreground routine, which is the "prompt" as you call it. The interpreter only gets cycles the machines don't take.

5) How can I figure out the minimum cycles that my program can run in, in order to prevent 3) above.

FIrst clear the system variables TCFMIN TCFMAX and TCFAVG then exercise your machines, and then check them for results. You will learn the shortest run, the longest run, and the average run time of your machine chain.

panorama
05-28-03, 12:18 PM
More comments and questions:

I replaced pwm outputs with pa outputs, and that improved my performance dramatically. Then I went to direct I/O, and that did even more. I managed to tweek the program using TCFMAX reducing the cycles from 1350 to 496 -- so far. The main culprit was your PWM and GPIO classes which seem to eat a lot of time.

Now I want to use a table to make it even faster. I tried
CREATE TIM 10 ALLOT OK

but was then unable to access the storage.
22 TIM ! OK
TIM @ . -1 OK

Please show me how to do this.

Thanks.
Tim

nmitech
05-28-03, 06:02 PM
CREATE uses the program memory for storage instead,

CREATE TIM 10 PALLOT
2222 TIM P!
3333 TIM 1+ P!
4444 TIM 2+ P!
5555 TIM 3 + P! ( and so on

TIM P@ U. ( display cell # 0
TIM 10 PDUMP ( display all 16 cells

or,

CREATE TIM
AAAA P, ( cell 0
BBBB P, ( cell 1
CCCC P, ( cell 2
DDDD P, ( cell 3, etc...

TIM 3 + P@ U. ( display cell # 3
TIM 10 PDUMP ( display 16-byte

or array variable,
VARIABLE TIM 10 ALLOT
22 TIM !
TIM @ .

panorama
05-29-03, 08:31 PM
Thanks,
Your help is greatly appreciated.

One more thing (if you believe that, I have a bridge to sell you.)

I did this:
: T1 11 . ;
: T2 22 . ;
CREATE TIM ' T1 P, ' T2 P,

Fine, it's ok, and I test it as being correct like this:
' T1 . <cr> 32260 OK
TIM P@ . <cr> 32260 OK

So I see that the xt is correct, but when I type:
TIM P@ EXECUTE
The IsoPod hangs up.

How do I fix this? And can I put it into data space with VARIABLE TIM ' T1 , ' T2 , ?

Does it work just as well from program space or data space? Why the difference? (Well, I gave you fair warning.)

Thanks again,
Tim

RMDumse
05-29-03, 10:47 PM
Tim, we have a headerless structure to our Forth, so when you do ' <name> you get a pointer to the CFA not the actual CFA. Do a ' <name> CFA EXECUTE, and you should have better results.

panorama
07-22-03, 12:42 PM
Hi,
For convienience, I am using PWMA and PWMB as output lines. However, I have noticed a glitch in PWMB2.

I am using this line as a reset line, so it is very sensitive to any glitch. Probably all lines are the same, but the function of this line is critical.

I changed temporarily to TC0, and it works fine, but I would still like to find out about PWM lines.

It is possible that some kind of timer thing is going on that could cause the glitch, and what can I do about it?

By the way, I am using programmed i/o to modify the PWM data registers like this:

E23 @ 1 OR E23 !
E23 @ FFFE AND E23 !

Could that cause a glitch on the output of a nearby bit?

Any ideas?

Thanks,
Tim

RMDumse
07-22-03, 01:49 PM
I'm a bit confused. (Confused concept snipped)

Why aren't you using the PMOUT reg to control the pins?

panorama
07-22-03, 02:22 PM
Dave,
I guess I am even more confused than I thought.

When I look in the DSP programmers manual, I see that the base for PWMB is E20, and the offset for POUT is +3. What am I missing?

Tim

RMDumse
07-22-03, 02:41 PM
Oh, my bad. Not reading carefully enough.

Yes, so you are using the PMOUT register. Okay, do you know what the other bits in this register are? The OUTCTL bits have effect on adjacent bits. PWMB3 can be a complementary output to PWMB2, and so that setting could cause a glitch. Whether the bits are independent or complementary is controlled by the PMCFG register. Does that shed any useful light on the subject?

panorama
07-22-03, 08:52 PM
Dave,
I ran the program and checked the settings:
E23 @ U. 8704. This looks correct.
E2F @ . 6. This looks correct.

There are no pairs and everything is enabled. I didn't expect any problem, because I used your macros to set the PWMB2 bit, so I suppose that you must be properly enabling everything.

Tim

panorama
07-29-03, 04:49 PM
Dave,
Do you have any answer to my last post? Any more ideas about why it glitches? It is a pain because I can't put all my wires on one connector unless I can use the PWB. Idea: I will try the other PWB lines, maybe it is only this one that glitches.

Another problem.
I have a new board V0.6, and find that my old program does not work. I store the program in memory like this:
HEX 7C00 AUTOSTART START-UP
SAVE-RAM
But on power-up, it will not run START-UP. Otherwise the program is there, because I can just type START-UP on the keyboard, and it starts.

Any idea what could be wrong? It worked fine on the last board I had.
Tim

nmitech
07-29-03, 05:20 PM
I have a new board V0.6, and find that my old program does not work. I store the program in memory like this:
HEX 7C00 AUTOSTART START-UP
SAVE-RAM
But on power-up, it will not run START-UP. Otherwise the program is there, because I can just type START-UP on the keyboard, and it starts.


Sorry for the confusion. The Memory map of IsoMax V0.6 is changed and the new autostart address is also moved and the suggested address is HEX 3C00 instead HEX 7C00 on the V0.5. Please use this on V0.6,
HEX 3C00 AUTOSTART START-UP
SAVE-RAM
Be sure to download the latest IsoPod manual and other appnotes here,
http://www.newmicros.com/store/product_details/download.html


Do you have any answer to my last post? Any more ideas about why it glitches? It is a pain because I can't put all my wires on one connector unless I can use the PWB. Idea: I will try the other PWB lines, maybe it is only this one that glitches.


Is the Glitch is happened frequently? Do you use the same program Dave emailed you? Can you email me nmitech@newmicros.com the program that you are having problem with. I want to check it out

chris
------

panorama
07-29-03, 07:10 PM
Chris,
On the new board I changed the pin to PWMB4, and there does not seem to be a problem.

Yes, it occurs frequently. I keep initialize like this:
( INIT MOUSE BY TOGGLING NR WHILE XA IS LOW
PWMB4 ON ( NR NORMALLY HIGH
TC0 ON ( NR ALTERNATE
PB0 ON ( NR ALTERNATE
TA0 OFF ( XA MUST BE LOW TO START

( TOGGLE NR OFF, THEN ON AGAIN TO RESET AGILENT CHIP
PWMB4 OFF ( TOGGLE NR OFF
TC0 OFF ( ALTERNATE NR POSITION
PB0 OFF ( ALTERNATE NR POSITION

PWMB4 ON ( BACK TO NORMAL
TC0 ON ( ALTERNATE NR
PB0 ON ( ALTERNATE NR

And then I never touch the PWM again. As I said, it does not seem to happen now.

I also do this frequently:
( JUMP TABLE Z
: Z0+ ZREG @ 1 OR ZREG ! 1 STATEZ ! ; EEWORD
: Z1+ ZREG @ 2 OR ZREG ! 2 STATEZ ! ; EEWORD
: Z2+ ZREG @ FFFE AND ZREG ! 3 STATEZ ! ; EEWORD
: Z3+ ZREG @ FFFD AND ZREG ! 0 STATEZ ! ; EEWORD

: Z0- ZREG @ 2 OR ZREG ! 3 STATEZ ! ; EEWORD
: Z1- ZREG @ FFFE AND ZREG ! 0 STATEZ ! ; EEWORD
: Z2- ZREG @ FFFD AND ZREG ! 1 STATEZ ! ; EEWORD
: Z3- ZREG @ 1 OR ZREG ! 2 STATEZ ! ; EEWORD

CREATE JTZ+ ' Z0+ P, ' Z1+ P, ' Z2+ P, ' Z3+ P, EEWORD
CREATE JTZ- ' Z0- P, ' Z1- P, ' Z2- P, ' Z3- P, EEWORD

ZREG is E23, so I am toggling the low two bits of the PWMB register.

I guess two things could be happening (assuming that PWMB4 is indeed working now.) Either it was a problem with only that particular module, or it does not affect PWMB4.

Tim

panorama
10-11-03, 09:46 PM
Gentlemen,
I am using TCFMAX to determine the speed of my machines. I never had trouble before, but now it always gives 177 (hex.) I have two machines. I can run none or one or two, depending on input, and I know they are running or not by the output I get.

The funny thing is that there is no difference.
If I run no machines and type 0 TCFMAX ! TCFMAX ? I get 177.

If I then run one or both machines, I still get 177.

Previously I had a value of around 200 hex, with one machine running.

I just got a new Isopod, and it has V0.6, same as last time.

Got any explaination?

Tim

RMDumse
10-13-03, 05:08 PM
We're not sure what the problem might be. To verify, we tried it on an application we have running here:

UP

IsoMax V0.6
OK
OK
TCFMAX ? -32274 OK
0 TCFMAX ! OK
TCFMAX ? 31868 OK
TCFMAX ? 31868 OK

As you can see, we were able to clear it and then see the maximum cycles. The UP is from the autostart, which runs the application, then turns over control to IsoMax again.

Can you give us any more hints?