User avatar
ab1jx
Posts: 868
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

I just got Piklab running

Sat Aug 27, 2016 9:31 pm

I've used Piklab (http://piklab.sourceforge.net/) on and off since 2008 or earlier. I'm not sure why it isn't mainstream Debian. A PIC (http://www.microchip.com/) is a really tiny, cheap single-chip computer. They're RISC, have their own instruction sets, there are various assemblers and compilers for them. I like the PIC12F683 as a minimum, it's an 8-pin IC, draws about 100 ua, has 2K of program memory, sells for about $1.50. Most have some A/D converter and PWM with configurable pins. I think that's what Arduinos use, never had one.

Piklab is an IDE which can drive some hardware programmers to write the program to the chip. Microchip has a Windows version called MPLAB which Piklab partially emulates under unix. The hardware programmers can run from simple circuits you can build to pre-built devices you plug into a USB port.
piklab_ss.gif
piklab_ss.gif (27.87 KiB) Viewed 1807 times
I'm running it in a VNC session to a Pi here. It isn't necessary to program in assembly, you can get at least C and BASIC. I'm looking at adding a solar-powered 433 MHz reporting method to an existing homebrew anemometer. Very simple, just count pulses and radio the result back to the house once a minute as maybe a 16 or 32 bit word with a check bit.

Heater
Posts: 13915
Joined: Tue Jul 17, 2012 3:02 pm

Re: I just got Piklab running

Sun Aug 28, 2016 5:29 am

Wow, when was that created. I gave up on PIC years ago because I could not find any tools to program them with from Linux. As in compile code and down load it to the chip. I did not need an IDE just a compiler/assembler and chip programmer.

The end result was that I used AVR as there was avr-gcc and Pony Prog.

Perhaps I should revisit the little PICs with this.

Is that actually running on a Pi? What compilers are you using with it?
Memory in C++ is a leaky abstraction .

User avatar
rpdom
Posts: 15592
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: I just got Piklab running

Sun Aug 28, 2016 5:54 am

Heater wrote:Is that actually running on a Pi? What compilers are you using with it?
I don't use a Pi for the little PIC work I do, but the assembler at least should work.

I use gpasm from the gputils package for the assembly, and picprog from the picprog package to write to the chips with a cheap JDM programmer. However, picprog only works with serial programmers, and I seem to recall it didn't work well with USB to Serial adaptors.

I guess it shouldn't be too hard to modify the code to work with a few GPIO pins and the Pi's UART. It might need a level shifter.

I seem to recall someone building a PIC programmer circuit that connected to the GPIOs... (quick search)

viewtopic.php?f=44&t=14689
viewtopic.php?f=41&t=19464

Heater
Posts: 13915
Joined: Tue Jul 17, 2012 3:02 pm

Re: I just got Piklab running

Sun Aug 28, 2016 6:42 am

rpdom,

What you are describing makes it sound like the situation has not improved much since I tried using PIC from Debian over a decade ago. Building a programming circuit and all that. Never worked well.

I'm not about to start programming PICs in assembler. It's pretty horrible and I have written enough assembler for 8 bit machines that I really don't want to do it anymore.

AVR went better. There were simple circuits to build to program it and avr-gcc.

Since then the Arduino came along with it's IDE. Might as well take an AVR, put the Arduino bootloader on it and use the Arduino IDE. Easy.

But I don't do that. I moved on to the Propeller MCU from Parallax Inc. 32 bits, 8 cores, 32 I/O pins, a bunch of counter/timers. Dev tools available for all platforms, including the Pi. Program in C, BASIC, Forth and others. Capable of driving VGA/NTSC/PAL screens. Easy to put multiple time critical tasks on it that don't interfere with each other. I even like to write assembler for it, its such a neat and simple architecture.
Memory in C++ is a leaky abstraction .

User avatar
ab1jx
Posts: 868
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: I just got Piklab running

Sun Aug 28, 2016 7:47 pm

Partly I'm looking to step through in the debugger and be able to watch what's happening. I think before I had the official Windows version too to use the programmer from. I did build a kit programmer from somewhere, should have bought USB but I bought parallel which is getting harder to find.

I'm not sure yet what's happening with Piklab, the tarball's dated 2012. I signed up for one of their mailing lists to post a question because last time I used it was under OpenBSD, the current version is looking for an HID header from a Linux (kernel I assume) directory. No mention of how to configure it without that, I may have to use an old version. That was at about 5 hours ago and nothing heard yet.

skspurling
Posts: 194
Joined: Fri Jul 27, 2012 1:44 pm
Location: US. Right in the middle...

Re: I just got Piklab running

Sun Aug 28, 2016 9:16 pm

rpdom wrote:
I use gpasm from the gputils package for the assembly, and picprog from the picprog package to write to the chips with a cheap JDM programmer. However, picprog only works with serial programmers, and I seem to recall it didn't work well with USB to Serial adaptors....
IIRC it was the power needed by the programmer to flash the chips. There were all kinds of strange custom USB and serial programmers out there, but the support and software were poor. You always ended up just short of $100 for a simple little programmer to get it to work, and normally it limited you to windows. I like the PIC's otherwise, but when the arduino hit the shelves, PIC's got to be less of a hobbyist thing. When Microchip bought AVR earlier this year, some tech articles came out talking about the advantages and disadvantages of each line. The conclusion was that it was a good combination and neither line was going any where, because both had strengths where the other had weaknesses. What I could not get over was that the one with the bigger PR presence got bought by the one that appeared to have gone into the background.

User avatar
ab1jx
Posts: 868
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: I just got Piklab running

Sat Sep 03, 2016 2:02 am

I have the Inchworm, an ICD2 clone from Blueroom Electronics which seems gone. It's described in this Instructables: http://www.instructables.com/id/Buildin ... r--Debugg/ I've also got a collection of saved web pages about building other programmers but the programming software has to be compatible with the hardware.

In principle I have everything I need as long as nothing goes wrong. I also haven't used it in 8 years or so.

But right now I only have Piklab running on the Pi, nothing with a serial port. I have an old Mplab, Microchip's Windows IDE, and I could boot something with a serial port into Windows and use that for the programming. I think I did that before, compile/assemble to HEX files then boot into Windows to run the programmer. I also have a few PICs around in some box of ICs.

I should rethink this. I'll probably look into AVR before I invest in a USB programmer for PICs.

Return to “General programming discussion”