DSP What is a program? (& Linux IDE?)

Software questions and issues with the FV-1

Moderator: frank

Post Reply
jwhitmore
Posts: 19
Joined: Tue Mar 10, 2020 6:37 am

DSP What is a program? (& Linux IDE?)

Post by jwhitmore »

Sorry new to DSP, but reading through the documentation this all seems pretty straight forward. One question however concerns what is a DSP Program. I'm coming from an embedded C background and a program running on a bare metal system will have an infinite process loop. If I didn't have that structure in the code, 'C' or assembly then the program counter would simply increment through the flash and overflow to 0x00000, in the fullness of time. (Yes I have made those kind of mistakes, and thought that's taking longer then I'd thought ;) I'm making a few assumptions there but you know what I mean. Obviously if you're running on an OS the program would terminate.

From what I've read the FV-1 has a very limited RAM memory section for a 'program', think I read 128 Bytes, (can that be right?). The example source code in the application notes simply ends the source code/program with a comment! So for example the first code example in AN-0001 ends the 'program' with:

; That's it

Obviously I recognise what's intended, but what does the FV-1 do? Does it always simply execute ALL of the loaded instructions in RAM even if there's instructions there or not, (NOP)? There is no branching, I'm not even sure you can 'Skip' backwards to 'Start' so I can only assume you have a limited number of instructions in a program, (possibly 128), use them, or don't, they'll still be executed. Does the architecture rely on the Program Counter over flowing to 0x0000? I guess if I only used 28 bytes of a program I could possibly skip forward 100 bytes to speed things up and reduce latency?

Linux: - And finally I'm not much of an IDE user, if there was a command line assembler and emacs I'd be happy. The assembler is probably written in a high level language, so it can execute on Linux, but the IDE's GUI isn't going to be that simple. Not sure about the programming of EEPROM via USB. USB is 'Universal' so I guess a simple command line program could be used to communicate the Hex file to the dev board. 'spin_flash my_effect.hex'.

So I guess my work flow would be:
$ emacs my_effect.src
$ spin_asm my_effect.src -o my_effect.hex
$ spin_flash my_effect.hex

Whilst none of that is rocket science, I guess there's not a lot of demand for that type of programming, so they don't exist. I'm sure I have a laptop with a windows partition so I'll get stuck into bad code presently.
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Re: DSP What is a program? (& Linux IDE?)

Post by frank »

As you come from an embedded world look at it this way:

FV-1 is an interrupt driven machine, it always starts at instruction 0 on a new sample period.

It will always execute 128 instructions, just make unused ones nop. No need to think about program counters, etc., it is all managed in the chip. Just write up to 128 instructions.

No need to skip unused instructions, it will not decrease latency since the program will not restart any sooner. It always restarts on a new sample period and skips do not add an offset to the program counter, they simply step through the instructions and treat them as nops.

Correct, cannot skip backwards.

No linux tools but some people have had success running SpinAsm under wine.
Frank Thomson
Experimental Noize
jwhitmore
Posts: 19
Joined: Tue Mar 10, 2020 6:37 am

Re: DSP What is a program? (& Linux IDE?)

Post by jwhitmore »

Thanks Frank,

Interrupt driven makes sense to me ;) I just have to write a short ISR.

Never thought of Wine, I never do, for some reason it forget about it. I'll give it a swing...

Thanks again

John
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Re: DSP What is a program? (& Linux IDE?)

Post by frank »

It really isn't interrupt driven but it is the easy way to think of it. All the other things are going on in parallel (LFOs, ramps, reading/writing ADC and DAC, etc.) in the chip.
Frank Thomson
Experimental Noize
Digital Larry
Posts: 338
Joined: Mon Nov 12, 2012 1:12 pm
Contact:

Re: DSP What is a program? (& Linux IDE?)

Post by Digital Larry »

I tried SpinASM with Wine a few years back. As I recall it will not work directly with the USB port to program the FV-1 dev board. But you might be able to use a PICKit 2 clone and pk2cmd. Then just use the Spin IDE to generate a hex file for pk2cmd to use.
Sweetalk
Posts: 141
Joined: Thu Oct 15, 2009 5:13 am

Re: DSP What is a program? (& Linux IDE?)

Post by Sweetalk »

Digital Larry wrote: Wed Mar 11, 2020 2:52 pm I tried SpinASM with Wine a few years back. As I recall it will not work directly with the USB port to program the FV-1 dev board. But you might be able to use a PICKit 2 clone and pk2cmd. Then just use the Spin IDE to generate a hex file for pk2cmd to use.
Or also th CH340 eeprom programmers works really well. They're also really cheap
DrAlx
Posts: 25
Joined: Wed Feb 20, 2019 11:01 am
Location: Surrey, UK

Re: DSP What is a program? (& Linux IDE?)

Post by DrAlx »

If you are on Linux (or mac) there is a Python based assembler on github.

http://www.spinsemi.com/forum/viewtopic.php?t=680#p3606

You just need to make sure you use the spin compatibility flag (-s) command line option.
Post Reply