LMM
Jay Kickliter
Posts: 446
Ale said...
Hei Jay,
I do the following for LMM code:
lmm_pc is the PC in the LMM kernel. Manipulating it directly allows for jumps to +64/-63 instructions.
lmm_jump
rdlong lmm_pc, lmm_pc ' access long just after call to lmm_jump
add lmm_pc, #16 ' adjust for real address
jmp #lmm_fetch
lmm_fetch
rdlong lmm_i, lmm_pc
add lmm_pc, #4 ' next inst
lmm_i
nop
jmp #lmm_fetch
...
somewhere your LMM code:
mov somevar, #500
jmp #lmm_jump
long @some_label
...
somelabel
mov somevar, #200
mov var_1, #500
...
sub lmm_pc, #($-somelabel-1)*4 ' This is a jump backwards to somelabel
someloop:
add lmm_pc, #(someotherlabel - 1 - $)*4 ' jump forwards
That kind of LMM does not need anything extra from the compiler and works very well!
The rest of the code that access variables and subroutines in COG do not need any change, because it will be run from COG RAM as any other instruction. Only jumps or calls to LMM code need to work around different address range. Two small routines can take care of that (lmm_jump, lmm_call).
I didn't want to continue this on the other thread, since it turns out I don't need any special compiler support. Ale, do you happen to have any working examples of this that you'd be willing to share?
Comments
All calls to LMM related routines... start with krnl_. Registers are krnl_r0 to krnl_r15. Another set of registers exist (k4_a to k4_g mapped to the other set).
Enjoy.
Ale
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
For quite some time I·have wanted to build·a test and measurement system with multiple props each generating /·measuring certain signals (DC, LF analog, HF analog, digital, protocol,·TV). Comparable to this·project ·http://www.heise.de/ct/projekte/machmit/ctlab/wiki. But being a propeller user with props of course. I can handle all the hardware detail, but as I am·less of a software person·I cannot decide on two important·software aspects:
- the GUI: how to control·generated·signals and control measurement result display? (Try to) use a PC application like in the mentioned project "NI Labview"? There is some·good software around (like Virtins Multi-instrument 3.1) that uses a PC soundcard as a measurement device. Use a prop with VGA and mouse·to display and alter parameters?·Use Viewport?·Use Femtobasic (text oriented, but with good automation possibilities)?
- how to display oscilloscope type·signals. I have·a number of FPGA4FUN Flashy modules available (100Mhz, 8 bit sampling) but how to display the results? Could a prop (or multiple props) handle 4 traces of (graphics) oscilloscope display? I can·use the·FPGA needed for·the Flashy modules to generate a VGA signal (have done some experiments already), but that is quite inflexible. Transport the data to a PC and display it there (viewport again?). · Hanno had a T&M application in the pipeline "dreamkit",·hoped this would come with general purpose·GUI software, but this seems to evolve into the "propscope".
Would appreciate any thoughts on·this.
Nico Hattink·
Just to display them at 60 Hz is not a problem, even 4 of them (some 200 or so samples). If you want something fancy like what real DSO do (aka digital phosphor or similar) forget it because you do not even have more than3 shades of the same color available!. The point here is the dead time you can tolerate.
FFT is not a problem, just see the article I wrote on propeller.wikispaces.com/FFT. I tested it with a real propeller too . It works.
My simple (very) GUI does not allow more than some simple widgets (numbers and radio buttons and text) with max/min values and increment prefixed (to be used with a rotary encoder). I can post the code of a simple oszi with FFT for VGA ready-to-use if you are still interested.
You will need an ADC (any will do) just modify the hardware accordingly to accept the data nd you are done.
If I find a picture of this I'll post it.
Have fun.
Ale, many thanks, just got it working (without a DAC). Just inserted the CNT value where you do the INA in the ADC routine.