Page 1 of 1

I'm stumped on zvm 1.3 not running code that works for 1.2.0

Posted: 10 September 2006, 17:53 PM
by stevech
I'm developing a program that responds to a 300Hz waveform on INT0 and another waveform on INT1. I use waitforinterrupt() to detect the presence/absence of this frequency. My code using zvm 1.2.0 works correctly. If I install zvm 1.3 the code does not work correctly. I have flipped between the two zvm versions a few times and it's consistent.

I may be on the wrong track, but here goes...

I suspect but cannot yet prove that in 1.3 the
waitforinterrupt(zxPinRisingEdge, 0) in task A, and the
waitforinterrupt(zxPinRisingEdge, 1) in task B,
conflict within the 1.3 VM.

As I flip between VM versions, and I do not re-download my application code, I get correct operation in 1.2.0 but not 1.3. I also tried re-downloading my code after switching VM versions - no affect.

The symptoms using 1.3 are as if the INT1 routine is not being called after a few seconds. It starts out correctly. I put in a debug.print for each interrupt task and this (as Murphy says) causes the bug to go away (but the screen is flooded with printouts).

If I omit launching either task, the other works correctly. Each task has its own stack, of course. I've tried it with one reentrant sub() and with two non-reentrant subs without any locals.

I hope this is not cockpit trouble on my part; I tried to preclude this before posting.

Any ideas?

(PS: was there a 1.2.2 version? I didn't find old versions on the web site).

Here's the code as modified from the reentrant version (commented out) to be the non-reentrant version where I use two separate sub()'s for the two tasks. The INT1 code is the same, with WaitInt1 used.
Reentrant or not, the problem persists only in VM 1.3.

Note that each task accesses the same global variable array, but using index 0 for one task and index 1 for the other. The main() task also accesses this array (reading).


Code: Select all

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' INTERRUPT PROCESSOR
''' Task to catch interrupts INT0 and INT1, these being the IR sensor receiver pulses
'''   NOTE: There are two instances of this task, one per sensor
sub IRpulses_Task()
	dim num as byte
	
	'''num = IntNum    ' INT0 vs. INT1 is passed in this global set before CallTask()
	''' Loop forever 
	do
		call waitForInterrupt(zxPinRisingEdge, WaitInt0)	' wait for next pulse from IR sensor
		BeamIntCount(0) = BeamIntCount(0) + 1	' Count pulses received since tick time was zero'd
		'''debug.print cstr(num);
	loop
end sub

Re: I'm stumped on zvm 1.3 not running code that works for 1

Posted: 10 September 2006, 19:10 PM
by dkinzer
stevech wrote:Any ideas?
I assume that this is using the ZX-24, not the ZX-24a. Is that correct? It is possible that an error was introduced between the two versions that you mentioned. The code in that area was modified to support the pin change interrupts on the mega644-based devices so it is entirely possible that a previously undetected error was introduced.
stevech wrote:[W]as there a 1.2.2 version? I didn't find old versions on the web site.
Not all versions are publicly released. Generally, the rightmost number distinguishes builds that were regression tested. Sometimes, we go through several of these builds before we get to a point where we are ready to post the version to the website for public use. The current public release is v1.3.0. The next may be v1.3.1 or v1.3.3, etc. depending on many different factors.

Posted: 10 September 2006, 19:38 PM
by stevech
Yes, ZX24.
this started when I added a printout of ram size and got a notice that version 1.2.2 or later is needed. I have 1.20 and 1.3.

let me know if there's some tests I can do to help. Meanwhile, I fall-back to 1.2.

Cheers

Posted: 11 September 2006, 9:29 AM
by dkinzer
I believe that we have found the cause of the problem and have derived a solution. The required change is simple and very localized.

We will post an update when testing is completed.