Page 1 of 1

JAM

Posted: Mon Apr 20, 2020 4:13 am
by mweavers
I'm trying to figure out what value JAM makes the ramp LFO restart at (high or low), and if it differs between forward ramp to reverse ramp. I wrote the following code to test both ways using POT0 to set the ramp direction, but the ramp doesn't seem to "jam"...

skp RUN, START
wldr 1, 0, 4096

START:

ldax POT0
sof 1, -0.5 ;find halfway
skp NEG, REV

FWD:
sof 0, -0.05 ;slow fwd ramp
skp 0, DONE

REV:
sof 0, 0.05 ;slow rev ramp

DONE:
wrax RMP1_RATE, 0 ;set ramp direction (and speed)
jam RMP1 ;restart ramp
cho rdal, RMP1 ;read ramp (should be start of ramp each time)
sof 1.999, 0 ;scale 0.5 magnitude ramp to 1.0
wrax DACR, 0 ;output to test result

Re: JAM

Posted: Mon Apr 20, 2020 3:21 pm
by mweavers
Upon further investigation it seems that the compiler (at least my version of it: 1.0.1.2 - 13/11/2007) doesn't encode the JAM lfo number correctly. It encodes 53h for lfo 2 (RMP0) and encodes 73h for lfo 3 (RMP1), and it only accepts values 2 and 3 as valid. It should encode 2->93h and 3->D3h respectively according to the instruction coding in the instruction set. I was using RMP1 so I manually edited the hex file to replace 73h with D3h (and modified the record checksum to match) and sure enough JAM started working! I haven't found a newer version of the SpinAsm on the website... is there one?

Re: JAM

Posted: Tue Apr 21, 2020 5:20 am
by ice-nine
As far as I know the latest SinASM is 1.1.30.0 that may fix your compile issue.

Re: JAM

Posted: Tue Apr 21, 2020 9:53 am
by PhilHaw
The latest version of the assembler is on this page - scroll down to near the bottom http://www.spinsemi.com/products.html

Phil.

Re: JAM

Posted: Tue Apr 21, 2020 4:07 pm
by mweavers
Thank you gentlemen :)
The latest download SpinSetup_1_1_31.exe (Ver 1.1.31.0) works.