Author Topic: PIC of the litter  (Read 869 times)

0 Members and 1 Guest are viewing this topic.


Re: PIC of the litter
« Reply #20 on: September 13, 2017, 04:28:15 PM »
Mikro has compilers for a bunch of different microprocessors in several different languages:

Just pick the one that you want to use and give it a try. Basic, Pascal, C? They have them all. They also have demo versions that can compile up to 2k, which is plenty for a lot of pedal projects.

One hint is that even if you know the language that you are going to use, I find that some knowledge of assembly, ports, registers and other basic stuff about the microprocessor is essential in getting the project to work.

regards, Jack

Mark Hammer

Re: PIC of the litter
« Reply #21 on: September 13, 2017, 04:44:26 PM »
Hootchie mama!!  Are you sure there's enough choice, there, Jack?  :icon_lol:

We covered all the ports, handshaking, registers, rising/falling edges in class back in 1982 (as a research psychologist, I had to learn about real-time control of lab equipment and data acquisition).  The clock speeds have changed significantly since then, but a lot of the basic stuff still holds, I gather.

Many thanks,


Re: PIC of the litter
« Reply #22 on: September 13, 2017, 04:49:04 PM »
The good thing about PICs is that there is a product for almost every need, depending on the project, and there is  a lot of information online.
On the other hand,  you really need a deep understanding of the hardware architecture of the device you are using, and this can be very time consuming.

This and this (my underlining).

I'm a PIC guy too. If you have some experience writing code in just about any language, then I don't think it will take long to pick up enough C to get a PIC to do something interesting and/or useful via the free microchip xc compilers.

As potul said, the major time suck is reading the data sheet. As an example, this is the datasheet for a fairly new 8-pin PIC, which I have used to generate LFOs, etc.
It is 397 pages long.
Of course, you won't have to read all of it, but you will have to read enough to work out how to make use of the very cool peripherals that take care of PWM, ADC, etc.
« Last Edit: September 13, 2017, 04:55:32 PM by samhay »
I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here:

Mark Hammer

Re: PIC of the litter
« Reply #23 on: September 13, 2017, 06:46:30 PM »
I think my mind got made up for me by happenstance.  When I got home from work, I dug out the Velleman PIC programmer I bought last year and discovered there was a 16F627A PIC sitting in foam that came with the programmer.  Seems to have enough in common with other MCUs that it's a reasonable place to start.  No shortage of support for it out there either.


Re: PIC of the litter
« Reply #24 on: September 13, 2017, 07:07:34 PM »
> Joel and Steve frequently use microcontrollers to manipulate

Then go with what they do. Even throw that decision in their lap. If say Joel is hep for the XYZ987, then he will show you how to wire and code, and will know right-off if a Hammer bright-idea doesn't quite suit the XYZ987 as good as a HAL9001.

As R.G. says, they are not partnering you for 40 years of bit-boffing experience, but your decades of listening and music-theorizing. At some point you *can* show them a breadboard smothered in jumper-cables, lengthy re-patching, and if it has the ZING factor they'll work the control interfacing.

A point that I used to think was important (maybe less today): User Interface. My Stamp project was one button and one LED (and a relay). You can "easily" interface a 40x2 text display and bang it like a teletype, but that was ho-hum 25 years ago. Still ample for some things, way behind-times for other things in this icon-mad world. There are small graphic displays but I could see wasting a lot of time making-nice. OTOH an rPi direct-connects TV and such for rich display with standard computer interface, but won't fit in a Hammond.

And there is a trend to off-load the whole GUI through boo-tooth to a cellphone. But this immediately begs iPhone+Android, and O/S drift 5 6 7 8..? revisions..... And security: punk in the crowd or the other band reprograms your gear?

Which leads back to a Stamp with prototype area. Any amount of analog patching/parameters can be set on-the-fly with a button or two. The rig covers a bench but consolidation is chimp-work compared to innovation. This type BASIC is nearly pseudo-code already, so any C or Python geek can easily extract the key actions and wrap it up pretty.

Mark Hammer

Re: PIC of the litter
« Reply #25 on: September 13, 2017, 07:45:58 PM »
I think that's all sage advice.  I think it behooves me to at least explore what is possible a bit, simply as a way of generating ideas I might not have thought of before.

One always needs to give serendipity a bit of a headstart, right?


Re: PIC of the litter
« Reply #26 on: September 14, 2017, 12:16:27 AM »
An interesting thing about the Mikroe compilers is that they generate assembly code that is saved in a file and then compiled into the hex for use in programming.

Once you get to looking at the asm code, one computer language is about the same as the others, so use what you are comfortable with. There is not going to be any difference between Basic or C or Pascal once the final code is generated.

regards, Jack


Re: PIC of the litter
« Reply #27 on: September 14, 2017, 03:18:23 PM »
I have a Velleman K8048 kit that programs 8, 14, 18 and 28 pin PIC controllers.  It needs a Pentium PC with Windows from 95 to XP, a CDROM and a serial RS232 port that cannot be a USB to RS232 cable.  This looks like it is going to be a pain - I have a Dell Inspiron laptop connected to the internet but it has no RS232 port.  I have an older XP tower that is not currently connected to the internet but it might have an RS232 port.  I am not too sure how to get the programming done here.  This looks like it is going to be a pain to use.  The RS232 cable needs pins 3, 4, 5, 7, 8 and 9.  The 15 VDC adapter is something I can get.

Once I get the hardware sorted out, I can download code to program stuff.  PIC code seems a bit off-putting - I can see what they are doing but it all seems so awkward.  So I have a programmer and access to devices but I have no idea whether I will ever get anything done with it.

Mark Hammer

Re: PIC of the litter
« Reply #28 on: September 14, 2017, 07:51:11 PM »
Exact same one I have.  I think we'll be PM-ing a bit in the future.


Re: PIC of the litter
« Reply #29 on: September 16, 2017, 06:32:29 AM »
Welcome aboard, Mark! Glad to have more people exploring this sort of stuff! It's an exciting place to be for effects, and the combination of analog processing with digital control offers a lot of possibilities without having to turn everything into just another DSP algorithm.

Since it looks like you're heading PICwards, I'll add a couple of things to what other people have said.

The newer "enhanced" PICs with numbers that start 12F1xxx or 16F1xxx are a big improvement over the earlier chips. They're faster, they have more powerful peripherals, and they add several extremely useful instructions to the instructions set which fill in the holes that the early chips had (add with carry, for example).

People have mentioned PWM as a way of doing analog output, and that works. However, the NCO peripheral (where available) can be set up to do a better job, using Pulse Density Modulation rather than Pulse Width Modulation.

The best way of all of doing an analog output is using a DAC! Several of the newer chips include either 5-bit or 10-bit DACs which are very easy to use.

Finally, trying to use a Velleman programmer connected to a serial port is going to get old fast. A USB programmer will do the job quicker. I use a PICKit3, which is good and not too expensive, but there are clones which are cheaper.


Digital Larry

Re: PIC of the litter
« Reply #30 on: September 16, 2017, 07:23:27 AM »
A point that I used to think was important (maybe less today): User Interface.

I don't think it's any less important today.  The ability to put text an graphical displays on pedals has made those units more flexible at the inevitable expense of usability.  There's a local guitar player I'm working with on some pedal ideas.  He currently owns a Z Vex thing a ma bob, which he told me "is totally tweakable, but I just always leave it on one setting".  So why not have that setting just be the one setting (for him and people who want to sound like him)?  I use the FV-1 a lot, and one of its inherent limitations is the number of knobs you can put on it to tweak parameters.  3 usually, 4 if you add some circuitry and code.  I can easily create patches that want MORE than that for full tweakability... but it can't be done.

so then I often do things like double controls on one pot, e.g. LFO width and scaled inversely, speed, for a chorus... but that means I have locked you out of super fast super wide (spaceship) sounds.  I'm sure it's the 5,000th time I've said it, but making these tradeoffs is IMO a way tougher decision than coming up with the sonic possibilities in the first place.  But since a simple FV-1 circuit (without a micro to drive it and save "presets") has these limitations that tilt it towards a performance rather than studio application, you have to make those tradeoffs.  There's no obvious formula to follow either, because my sensibilities about these things are personal and not guaranteed to match those of any other individual.  So that's one reason it's nice that DIY, where your target audience is just YOU, has come a long way since I was a kid.
Digital Larry
Holy City Audio - home of SpinCAD Designer


Re: PIC of the litter
« Reply #31 on: September 16, 2017, 10:25:29 AM »
Totally agree with Larry. Never underestimate the UI! Especially on digital stuff where it's even easier to screw it up completely and have some hideous thing with ten modes accessed by multiple button presses or hold-for-two-seconds-while-standing-on-one-leg or press-X-while-holding-down-Y and so on. ARGGH!! So wrong. Adding the sophistication of a LCD display and actual words doesn't always make it better either - just encourages people to add every single parameter as an editable option, whereupon you're in that tedious world of trying to paint the hallway through the letterbox.
As Larry says, the hard choices about what gets tweaked and what doesn't are a big part of making something useable. Sometimes having limitations that force you to make those choices makes for a better design in the end. That's one of the reasons I still use a lot of 8-bit PICs. I *like* the fact I can't just sling the kitchen sink in there. Forces me to make my mind up about what's important and what's not, and that's crucial.



Re: PIC of the litter
« Reply #32 on: September 16, 2017, 10:37:57 AM »
I'll add a third to that. Historically, the user interface is the most difficult part of most programing applications. Even when the only user interface is a switch and an LED, it's usually the most difficult part.

That's because what you're doing is NOT making the part flip bits. You are crawilng inside the unknown user's head and trying to figure out how they can MIS-understand what that blinky light means. More sophisticated UIs just add more ways for them to get it wrong.

You're really trying to get a desired result from an unknown user, not just get the thing to work. And the human mind is the most complicated object in the known universe to date.

Quick IQ Test: If anyone in a governmental position suspected that YOU had top-secret information on YOUR computer, how many minutes would you remain outside a jail cell?


Re: PIC of the litter
« Reply #33 on: Today at 09:01:52 AM »
Pic, PicKit, C, MPlab. Can't go wrong. Plus it's the most common sort of entry-level embedded programming you find in the industry (at least in UK). If you can program a PIC in C, someone will employ you.
« Last Edit: Today at 09:03:50 AM by merlinb »