Jump to content

Recommended Posts

Does anyone here program PIC microcontrollers?

 

 I'm sketching out a design for some layout control hardware using them, having done a bit of work some time ago with PICs.

 

However the programming tools I used then (a Vellmann board from Maplin) worked fine on Windows XP with a now long gone laptop with a real RS232 port (this was 15 years ago), but I've not managed to get the board to work on more modern hardware.

 

What do people use these days as a low-cost software and hardware development environment for a Windows 8.1 or Windows 10 laptop equipped with just USB ports?

 

In the past I used purely assembly code, but it would be nice to have C as an option as well.

Share this post


Link to post
Share on other sites
 

There are still people doing PIC stuff, particularly in MERG.   Microchip, the makers of PIC devices, have programmers (at a price, though sometimes there are special offers), and there are cheaper clone devices which work most of the time.

 

But, probably the most common small scale DIY stuff is now in Arduino, or the numerous clone Arduino devices.    The Arduino development environment is well supported, decent number of libraries, language is C,  etc..   It's a very quick way to get things working.    

 

Unless your hobby interest is "building my own designs", have a look around what others have done before.  There may well be systems which do what you need available, either as commercial products, or as DIY kits, or as published designs you can adapt.

 

- Nigel

Share this post


Link to post
Share on other sites

Why not just get a USB (A, B or C dependant upon PC) adaptor to RS232 9Pin and do it they way you used to? They can be purchased for a few pounds from many sources.

Share this post


Link to post
Share on other sites

You can get hold of PIC KIT 2 and PIC KIT 3 programmers fairly easily. These are ISP devices so you can program the chip in situ if you wire a header on the board. You can still easily get USB to DB9 RS232 adaptors as mentioned above. The problem with a lot of kit boards is they get left behind when PIC's move on and pinouts get altered. I have used PICSTART Plus in the past but the problem there is you need to purchase upgrade kits for firmware periodically. Dave on EEVBlog did slate Microchip over their PIC Kit 3 however: 

 

 Microchip did a fairly amusing response:

More on the PICKIt 3:

 

Share this post


Link to post
Share on other sites

We do a lot of production work with things based on PICs.

We use ICD3 programmer / debugger units, which are rather more expensive but much more powerful.

 

The PiCKIT3 (or I believe there may be an PICKIT4?) should do mostly the same things, though a bit slower. 

Just watch out for fakes on ebay..

 

All the present devices are in-circuit programmable and most have in-circuit debug capability as well, where you can set a breakpoint in the source in MPLab and single-step the program in the device, monitoring variables or registers etc. as the program changes them. 

Just add a pin header or RJ12 socket on your board to connect the device.

 

I'd also highly recommend the dspic32 series for any new designs, they are available with up 48K RAM, 512K flash & 60 - 70MHz instruction clock & numerous internal peripherals - for less than a fiver..

 

We use the CCS C compiler, which has facilities for all the standard peripherals so you don't need to mess about with low-level drivers if you don't want to.

 

 

Edited by RobjUK
  • Thanks 1

Share this post


Link to post
Share on other sites

MikroElektronika do a fantastic range of very high quality development boards and software suites or a multitude of architectures from 8051 to AVR and PIC. They do MikroC and MikroBASIC compilers too aswell as add-on boards for CAN, RS485, I2C, SPI etc.

 

 

 

 https://www.mikroe.com/shop

  • Thanks 1

Share this post


Link to post
Share on other sites

Buy a genuine PICKit4 and download MPLABX. I've seen too many issues reported with clone programmers to recommend them.

 

The latest XC8 compiler enables greater optimization in the free version and does a very good job if you want to program the 8-bit PICs in C. MPLABX includes tools to autogenerate configuration and driver code, although I don't use them myself.

 

As hinted in RobjUKs post, there are PICs, and there are PICs :) Even the 8 bit devices are a world away from what you would have been using 15 years ago. Microchip bought Atmel so their tools also support Atmel microcontrollers giving a whole new set of options including ARM cores (Microchip themselves chose to license the MIPS core).

 

Arduino strikes me as OK if you don't need to go too far under the hood.

 

Consider joining MERG, lots of PIC users there.

 

 

  • Agree 1
  • Thanks 1

Share this post


Link to post
Share on other sites
5 hours ago, sharris said:

Does anyone here program PIC microcontrollers?

 

 I'm sketching out a design for some layout control hardware using them, having done a bit of work some time ago with PICs.

 

However the programming tools I used then (a Vellmann board from Maplin) worked fine on Windows XP with a now long gone laptop with a real RS232 port (this was 15 years ago), but I've not managed to get the board to work on more modern hardware.

 

What do people use these days as a low-cost software and hardware development environment for a Windows 8.1 or Windows 10 laptop equipped with just USB ports?

 

In the past I used purely assembly code, but it would be nice to have C as an option as well.

The current Velleman board (avaiable from Rapidonline) has a USB port

They're only selling them in packs of 20!

 

However Farnell will do them singly (a different version)

 

 

Edited by melmerby
  • Thanks 1

Share this post


Link to post
Share on other sites

I use pickit4 and MLABX IPE , but really the pic 8 bit architecture is an awful architecture especially for C . There are no good free C compilers either 

 

best look at arm microcontrolkers , as cheap , better IO , great free development tool chains  

Edited by Junctionmad

Share this post


Link to post
Share on other sites

I use a PICkit3 and MPLAB-X to load hex files into PIC chips. I don’t do the hex coding just load the provided files to update the DCC kit firmware.

 

I looked at a PICkit4 but at the time it wasn’t as well supported as the v3. It may be now. Mine came as a bundle with various extra proto-boards, which I have never used. I did have to make up my own ‘patch’ cable twixt the divice and the kit I was loading along with providing suitable headers.

Share this post


Link to post
Share on other sites
13 hours ago, Junctionmad said:

 

best look at arm microcontrolkers , as cheap , better IO , great free development tool chains  

 

The principle reasons for choosing PIC then (and why my thoughts turned back to it now) was one of packaging.

 

The 18-pin DIP (power + 16 IO lines) was just the right amount of IO and fitted easily onto standard 0.1" pitch prototyping board and didn't cost much more than £1.

 

As far as I know there isn't an ARM MCU in a DIP anymore (I read that the 8-pin DIP version was now discontinued). There are a few ATMega DIPs which I might consider as an alternative but the smallest I found was 28-pin.

 

My previous project, nothing to do with model railways, was just a couple of chips (a DTMF decoder and PIC MCU), a couple of DIP packaged power FETs and a very small number of analogue components - I think  with a PIC I can achieve a similar economy of hardware design without having to strain my aging eyes on surface mount.

Edited by sharris
All the right letters... not necessarily in the right order
  • Agree 1

Share this post


Link to post
Share on other sites
12 hours ago, Baby Deltic said:

Dave on EEVBlog did slate Microchip over their PIC Kit 3 however: 

 

 Microchip did a fairly amusing response:

More on the PICKIt 3:

 

 

That is some great ranting!

 

Kudos to Microchip for their response too.

Share this post


Link to post
Share on other sites
8 hours ago, sharris said:

I think  with a PIC I can achieve a similar economy of hardware design without having to strain my aging eyes on surface mount.

Indeed, that's why I like them, no surface mount needed!

 

You can even get a 16MHz PIC16 in a eight pin package now, eg. PIC16F18313.

I've been messing about with those to make an absolute minimal accessory decoder, but not finished yet due to other higher priority stuff.

 

The debugging status LEDs and connector for ICD3 take most of the space on my test rig board:

 

IMG_9814a.jpg

  • Like 1

Share this post


Link to post
Share on other sites
40 minutes ago, RobjUK said:

Indeed, that's why I like them, no surface mount needed!

 

You can even get a 16MHz PIC16 in a eight pin package now, eg. PIC16F18313.

I've been messing about with those to make an absolute minimal accessory decoder, but not finished yet due to other higher priority stuff.

 

 

 

Fine if developing such devices is your hobby. But if just wanting a working device, Paul Harman published a minimal vero-board DIY design accessory decoder, using a PIC, a decade ago.   There is firmware for both accessory decoder and function decoder.

http://dccdiy.org.uk/

 

 

- Nigel

 

 

 

Share this post


Link to post
Share on other sites
Just now, Nigelcliffe said:

Paul Harman published a minimal vero-board DIY design accessory decoder, using a PIC, a decade ago

 

Interesting - I'd not seen that one, only the MERG stuff and other that did not support 8 pin PICs. I'll give that a try, thanks. 

 

(Though designing and programming electronics is both my main hobby and profession).

Share this post


Link to post
Share on other sites
15 hours ago, Junctionmad said:

I use pickit4 and MLABX IPE , but really the pic 8 bit architecture is an awful architecture especially for C . There are no good free C compilers either 

 

best look at arm microcontrolkers , as cheap , better IO , great free development tool chains  

 

The Beaglebone Black is quite a useful ARM based Arduino sized project board. Seeed do a Beaglebone Green kit with 'Cape's which are like Arduino shields to add on.

 

Share this post


Link to post
Share on other sites

People seem to fear SMD. the fact is with minimal gear , it’s actually a lot easier , faster and simpler to construct then thru hole 

 

the LPC dip arm chip is still available afaik 

 

always throw  processor power at a solution , it’s never a bad decision !

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.