Author Topic: FV-1 and Mac  (Read 1266 times)

patrick398

FV-1 and Mac
« on: April 06, 2020, 06:27:16 AM »
I spent all day yesterday trying to get my head round the fv-1 stuff and what i hardware and software i'll need to get the ball rolling. I've downloaded SpinCad Designer which looks like such a great tool for beginners...just need to work out how to use it.
When it comes to putting codes onto the EEPROM it seems like it can only be done on Windows, is this right? Or is there some kind of work-around for Mac users?


Thanks

EDIT: Also really surprised how expensive the FV-1 chip is, 18 is crazy! Is that standard price?
« Last Edit: April 06, 2020, 06:29:46 AM by patrick398 »

patrick398

Re: FV-1 and Mac
« Reply #1 on: April 06, 2020, 06:34:27 AM »
So this development board from PedalPCB says that it's Mac compatible just reading through the instructions on the pdf, looks like i'll have to download some more software

ElectricDruid

Re: FV-1 and Mac
« Reply #2 on: April 06, 2020, 10:13:07 AM »
Let us know how you get on. I've been trying to do this for ages too.

Digital Larry

Re: FV-1 and Mac
« Reply #3 on: April 06, 2020, 10:39:47 AM »
I never tried to program an EEPROM from Mac.  It's probably obvious but from SpinCAD, export your bank of 8 patches as HEX.  Then it's up to you to program the HEX file to the E-squared.
Digital Larry
DSP tinkerer and former transistor twister

patrick398

Re: FV-1 and Mac
« Reply #4 on: April 06, 2020, 10:52:49 AM »
Let us know how you get on. I've been trying to do this for ages too.

Ok so i have followed the instructions on the PedalPCB pdf, using terminal to download homebrew (i first had to install an old version of Xcode which is compatible with OS Mojave). You then use a couple more commands to install 'libusb' and 'srecord'...whatever they are.

I've also downloaded 'FV1Dev Bundle for macOS'. So i think i have the necessary things installed, though they don't seem to be in my applications folder, i assume they exist somewhere.

the remaining instructions are:

Read EEPROM data to .bin file
ch341eeprom -s 24c32 -r <filename.bin>

Write .bin file to EEPROM
ch341eeprom -s 24c32 -w <filename.bin>

Convert BIN to HEX
srec_cat <filename.bin> -binary -o <filename.hex> -intel

Convert HEX to BIN
srec_cat <filename.hex> -intel -o <filename.bin> -binary

I think i've hit the limit of my understanding now (actually i've been way past that for a while). The instructions for windows seem to say that you use a programme called 'AsProgrammer' to read/write the EEPROM, but no such program for the mac version, Do we read/write via Terminal?

I think those last few instructions i pasted are also command lines that take the code put out by SpinCad Designer, convert it from .Bin to .Hex and write it onto the EEPROM. So maybe it is done via terminal.
I'm using a lot of words i don't even understand here haha

patrick398

Re: FV-1 and Mac
« Reply #5 on: April 06, 2020, 11:06:22 AM »
The 'FV1Dev Bundle for macOS' extracts a file called ch341eeprom which opens in Terminal. I'm guessing it is from here that we would use those commands to convert and write the code to the EEPROM.

Tom are you also using Mac?

pruttelherrie

Re: FV-1 and Mac
« Reply #6 on: April 06, 2020, 12:03:51 PM »
I use a pickit2 to upload .hex files to the E-squared on a mac. they can be had pretty cheap. I have looked into other ways to flash EEPROMS, including 'littlewire' and other tools, but in the end I just accepted the state of the world and got on with my life.

There's a Mac commandline 'pk2cmd' from Microchip which I use to flash the EEPROM with a bank of 8 programs, exported from SpinCAD Designer:
./pk2cmd -P 24LC64 -A 3.3 -MP -F ../bank-filename.hex

It is possible to set up a Folder in Mac OS X, so that it executes a command (Automator script) when you drop a file in that folder. If you let this call the above command and you save the .hex there from within SpinCAD Designer, it's more-or-less automated.

That said, nowadays I'm mostly developing on Debian Linux so I haven't used this in a while.

pruttelherrie

Re: FV-1 and Mac
« Reply #7 on: April 06, 2020, 12:05:07 PM »
Oh by the way: Banzaimusic has the FV-1 for 13,45

patrick398

Re: FV-1 and Mac
« Reply #8 on: April 06, 2020, 12:38:27 PM »
Oh by the way: Banzaimusic has the FV-1 for 13,45

Sweet, thanks for that!

I use a pickit2 to upload .hex files to the E-squared on a mac. they can be had pretty cheap. I have looked into other ways to flash EEPROMS, including 'littlewire' and other tools, but in the end I just accepted the state of the world and got on with my life.

There's a Mac commandline 'pk2cmd' from Microchip which I use to flash the EEPROM with a bank of 8 programs, exported from SpinCAD Designer:
./pk2cmd -P 24LC64 -A 3.3 -MP -F ../bank-filename.hex

It is possible to set up a Folder in Mac OS X, so that it executes a command (Automator script) when you drop a file in that folder. If you let this call the above command and you save the .hex there from within SpinCAD Designer, it's more-or-less automated.

That said, nowadays I'm mostly developing on Debian Linux so I haven't used this in a while.

Thanks for the help, inevitably i have more questions. I'm trying to break this process down into a series of steps i can get my head around, but there are gaps. Also i don't have any of the hardware in front of me so it's purely theoretical at the moment. Sorry for the basic b**ch approach.

- When using SpinCad i can import a patch (or make one down the line)
- Export bank to HEX
- Write this to the EEPROM using pickit2, presumably this converts the .hex into a .bin file? and using pickit2 bypasses the need for the FV-1 developement board with onboard USB?
- Plug EEPROM into FV-1 circuit to see if works

That's where i'm at, i feel like a dunce haha. So using something like pickit2 means flashing the EEPROM is easier than trying to do it via terminal? But means i'd have to move the EEPROM between the pickit2 and an FV-1 circuit to see if it's working, rather than using the development board where i could flash the chip check it's function straight away?  I'm kinda just trying to organise my thoughts here, but is that basically correct?

Thanks :)


Digital Larry

Re: FV-1 and Mac
« Reply #9 on: April 06, 2020, 02:21:42 PM »
When I was using pk2cmd, I used it just with a HEX file.  No need to convert it to "bin".

Also, I was able to use my PICKit 2 clone to program the 24LC32 chip in circuit by connecting to the GND, SDA and SCK lines.

DL
« Last Edit: April 07, 2020, 09:34:05 AM by Digital Larry »
Digital Larry
DSP tinkerer and former transistor twister

vigilante397

Re: FV-1 and Mac
« Reply #10 on: April 06, 2020, 02:35:54 PM »
I use SMD EEPROMS so I wanted an on-board programming option. I found a cheap CH341 USB -> EEPROM dongle thing I got off Amazon for like $6. I stuck some breadboard leads on it and add headers for 3V3, GND, SCL and SDA so I can plug directly into my PCB. It's pretty handy :)

For prototyping I do actually have a PedalPCB "FV-1 Development Board" and it does the job, never tried it on mac though. It has a USB port with a CH341 as the driver, which means I can use the same settings as my regular programming dongle.
"I'm not sure what "serious design flaws" you see. Does it explode or poison your dog?" - PRR

www.sushiboxfx.com

patrick398

Re: FV-1 and Mac
« Reply #11 on: April 07, 2020, 07:23:33 AM »
I've bought a pickit2 thingy, or likely some knock off on the bay. Hopefully when it's in front of me i'll have a little bit more of an idea what i'm doing. I've got MPLAB installed so hopefully it'll all play nice

potul

Re: FV-1 and Mac
« Reply #12 on: April 07, 2020, 04:00:20 PM »
you don't need mplab to program the eeprom, just the pickit app

ElectricDruid

Re: FV-1 and Mac
« Reply #13 on: April 07, 2020, 07:04:36 PM »
Tom are you also using Mac?
Yes, I am. I've gone a different route to you so far. I've got the "ASFV1" Python-based Spin compiler up and running, so I've got a command line utility that can compile Spin ASM into .hex files. I just haven't had time to sit down and really play with it or get files uploaded onto an eeprom that the FV-1 could use.

I've bought a pickit2 thingy, or likely some knock off on the bay. Hopefully when it's in front of me i'll have a little bit more of an idea what i'm doing. I've got MPLAB installed so hopefully it'll all play nice

I can probably help with getting you sorted with the PICKit2. I use the PICKit3 all the time for programming processors, and I mostly do that in-circuit like vigilante suggested. It makes sense if you can (sometimes the application circuits don't make that simple).

you don't need mplab to program the eeprom, just the pickit app
 
What's "the pickit app" in this context? Do you mean the IPE not the IDE? (The much simpler "Integrated Programming Environment" instead of the full-blown "Integrated Development Environment"). Or is there something else I've missed? Also how would you do eight programs to different locations on the EEPROM?

Thanks!

pruttelherrie

Re: FV-1 and Mac
« Reply #14 on: April 08, 2020, 03:01:16 AM »
"The pickit app" for flashing is the pk2cmd commandline executable that you can find here: https://www.piccircuit.com/shop/pic-code/115-tutorial-17-pic-programming-mac-os-x.html

Then, to summarize all the above:

* You can program the EEPROM in-circuit, you only have to connect GND, SDA, SCL from Pickit2 to board
* Export .hex from SpinCAD Designer
* Run " ./pk2cmd -P 24LC64 -A 3.3 -MP -F ../bank-filename.hex " to flash, " ./pk2cmd -P 24LC64 -A 3.3 -MY -F ../bank-filename.hex " to verify.
* I'm not sure if the FV-1 reloads the program automatically after flashing, you might need to reset the FV-1 or switch the program back-and-forth?

potul

Re: FV-1 and Mac
« Reply #15 on: April 08, 2020, 04:49:47 AM »
What I was referring to as the "Pickit app" is this tool:

https://microchipdeveloper.com/pickit3:scripttool

There is a version for pickit 2 as well, that I use everyday. I see that the tool is quite old and not supported anymore by microchip, but still working for simple things like upload/download an hex file, or verify the memory contents.

But to be honest, I didn't check if this is windows only, or a Mac version exists.


ElectricDruid

Re: FV-1 and Mac
« Reply #16 on: April 21, 2020, 06:42:18 PM »
Ok, with a bit of experimenting, I've managed to get pk2cmd command line PICKit2 software running and made it program a chip (a 16F684, not an EEPROM, as it happens). So I'm one step away from having something that can put code into EEPROMs - but if it works with uPs, it'll do EEPROMs too, right? I'm pretty confident about that last step.

I've also got Digital Larry's SpinASM running on the Mac, since it's a Java app. Java was one of those good ideas that never quite seems to get it right. But in this case, it was dead easy and it runs fine.

Another step I haven't tried yet is putting a .spn assembly file through the Python compiler I downloaded. If I can get .hex files out of that, I can either modify stuff started in SpinASM or write code from scratch. Since I do a lot of assembly anyway, getting into the nitty-gritty of the FV-1 does appeal, although DigitalLarry's spinASM is a fantastic tool, really good fun.

Digital Larry

Re: FV-1 and Mac
« Reply #17 on: April 22, 2020, 10:22:36 AM »
The thing I wrote is called "SpinCAD Designer" and it will export a bank of 8 patches to a HEX file, so you shouldn't have to use any assembler if you don't want. 

Don't let me stop you learning Spin ASM though.  I'm not sure I ever want to look at it again.  It's probably not very much like any assembly language you ever used before.

DL
« Last Edit: April 22, 2020, 10:24:49 AM by Digital Larry »
Digital Larry
DSP tinkerer and former transistor twister

vigilante397

Re: FV-1 and Mac
« Reply #18 on: April 22, 2020, 01:16:28 PM »
SpinCad Designer makes way more sense to me than Spin ASM. I have a lot of respect for peopl that can sit down and write an effect in assembly, but SpinCad Designer is so much more intuitive and understandable as a musician.
"I'm not sure what "serious design flaws" you see. Does it explode or poison your dog?" - PRR

www.sushiboxfx.com

ElectricDruid

Re: FV-1 and Mac
« Reply #19 on: April 22, 2020, 01:27:44 PM »
Apologies, Larry - Yes, I meant 'SpinCAD designer'. I'm getting in a twist with so many different things kicking about. Anyway, it's a great bit of software, whatever it's called! Nice work.

I had a look at SpinASM. Looks ok to me. True, I've not seen an assembly language that uses floating point before, and the hardware peripherals are outside the norm, being specific for the job it was designed for. How hard can something with only 28 instructions be, anyway?!? lol :)