PICs in general, PIC language questions, pic hardware questions

Hi Group,

Saw some posts here on the PIC, and it got me thinking. I played around with them back when the 12c508 was the hot ticket. Used the UV eraseable ones, and I swear I nearly killed my wrists opening and closing my eraser, not to mention having 5 or 6 of them so I didn't have to wait for the eraser. Now they are in circuit programmable, which makes them a lot more appealing.

I also remember my CCS compiler, which did a servicable job most of the time, but more often than not, I resorted to writing everything in assembler, just to get the speed and control I needed, or to circumvent some pecularity of the software.

I thought I would revisit these things, and put the results in my N&V column.

1) Whats the "hot ticket" language/environment. 2) What is involved with in circuit programming, and does it also provide in circuit debugging? 3) What is the "workhorse" of the PIC world these days? 4) Does someone make an edu-board, that also doubles as a programmer? 5) Any comparisons between CCS, HTsoft, MicroElectronics? 6) Anything else I may have overlooked?

Thanks

Mike

Reply to
blueeyedpop
Loading thread data ...
[snip...snip...]

Other processors? The PICs still have a following, to be sure, but a lot of hobby development (and things like one-off lab setups where I just need a gizmo to do xxx) has moved to the Atmel AVR processors.

Biggest difference (to me) from the PICs is the much nicer register and memory layout: 32 general purpose registers and a flat 64K address space as compared to the somewhat uncomfortable W register and the PIC's memory banks and pages. The underlying architecture is somewhat hidden when programming in a high level language, to be sure, but assembly does have a place with the small devices.

Most AVRs (the 64/128/256K chips are the exception) also come in DIP format and have 5 V family members. Very handy for breadboarding.

The family reaches down to small 8-pin devices with internal RC oscillators (that can be optionally selected). Use as a smart replacement for a 555, perhaps.

A good (and free) assembler and device programmer interface is available from Atmel. There is an inexpensive in-circuit programmer interface (about $30) as well as larger, and correspondingly more expensive, in-circuit emulator pods and (on some devices) standard JTAG ports.

There's a good port of the GNU compiler for Windows-based development in the WinAVR project. Commercial C compilers I'm aware of are available from IAR, Imagecraft, and Codevision. I've been using Imagecraft's for a few years. In addition to its own IDE, it can hook to the Atmel development environment for source level debugging.

The 28-pin skinny DIP ATmega8 (8K ROM, 1K SRAM, 512 EEPROM) is a good jellybean part. There are also several configurations of 32K, 40-pin DIPs for larger projects.

Reply to
Rich Webb

Yes,

AVR, ARM, they are the vogue, but I really was thinking of revisiting the Pic.

Thanks, Mike

Reply to
blueeyedpop

No need for UV erasers any more.

  1. depends on what you like and what you are using For windows mplab or your favourite text editor

sourceboost c - works for 12/16 and 18f pics

formatting link

supported chips

formatting link
Jal is one of my favourites
formatting link
If you prefer forth there are a couple of choices

pic forth

formatting link
16f only
formatting link
formatting link
18f

python for pics for 16f

formatting link

  1. microchip icd2 (or clones) - windows only Can program and debug all flash pics from inside mplab

clone sold by

formatting link
made by olimex.com

Cheap programmer option (also work with linux , freebsd , mac) but not for debugging. The kitsrus.com usb programmers K150 or 182

formatting link
forum for the programmers
formatting link

  1. Depends on what level (hobbiest , commerical etc) and for what purpose and what size.

12f675 - 8 pdip

16f628 /16f628a - 18pdip 16f877 / 16f877a - 40 pdip 16f876 - 28pdip 18f1320 - 18pdip

18f242 / 252 / 442 / 448 / 452 now 18f 2420 / 2520 / 4420 / 4480 / 4520 (recent changes) 40 pdip

The new flash usb pics 18f4550 / 2550 etc run at 48MHz

If getting back into pics go with the 18f's there is a free c compiler (student version) from microchip

  1. Depends on what you want to pay and the features you want.

I like the pic18f4550 PICdem Full speed usb board

formatting link
The 64/80-pin TQFP Demo Board
formatting link
also the
formatting link
boards if you are interested in ethernet or wireless using a pic (also have boards for the new microchip spi to ethernet devices)
formatting link
futurlec.com has some dirt cheap pic boards
formatting link

  1. Don't forget boost c / picant
    formatting link

forum at

and also FED C

Jal is one of my favourites

formatting link
If you prefer forth there are a couple of choices

pic forth

formatting link
16f only
formatting link
formatting link
18f

python for pics for 16f

formatting link
formatting link
links

mplab 7.20

formatting link
microchip C18 compiler (student version)
formatting link

Alex

18f pics
formatting link
Reply to
Alex Gibson

Hi Mike,

All responses are IMHO, of course.

  1. The CCS C compiler. It integrates with the MPLAB environment which everyone uses. I chose CCS after some research. Assembler is still important for timing-critical software. A C compiler is a must for implementing communications like RS232 and I2C in a timely manner.

  1. The best PIC programmers (like the Olimex and others) provide ICSP connectors for in-circuit programming. ICE requires additional hardware.

  2. I think the 16F628, 16F873 and 16F877 for most apps. The 18F series is becoming more popular and is quite powerful, but I would have to buy a different CCS C compiler.

  1. I just can't stop gushing about the Olimex proto boards with RS232 or USB circuitry, a crystal, and ICSP connector, a reset button and an LED already wired. I do all of my projects on these things. They're dirt cheap at sparkfun.com.

Hope this helps.

Bennet Williams

Reply to
Bennet Williams

Most people in our robotics club (Home Brew Robotics Club -- Silicon Valley area) who use stand alone microcontrollers are using PIC microcontrollers. If they use a C compiler, they use the CCS compiler. I do not use the CCS compiler.

For assembler -- Microchip's MPLAB. For C -- CCS compiler. I think they have one compiler for the

14-bit instruction set and a different one for the 16-bit set.

You should do your own homework on that. There is not much involved -- add a header and a resistor. Depending upon the programmer, you may need an extra diode.

I still use sockets and physically move the chip between the programmer and circuit.

The higher end chips -- PIC16F87x and PIC16F7x7 do have some debugging support from the Microchip product line of programmers. I've never personally used it.

The old workhorse was the 16F84. It is largely replaced by the 16F628 (more memory and a UART to boot.) If you want A/D, the 16F688 has 8 channels in a 14-pin DIP. If you want more pins, the 16F689 comes in a 20-pin DIP and has 12 A/D channels. If you need even more pins, the PIC16F7x7 series chips comes in 28-pin DIP and 40-pin DIP. For the surface mount folks, all of the chips come in surface mount too. If you need larger programs than 8K or more than ~380 bytes of RAM, people upgrade to the 18Fxxx series. (I have not made that jump yet.)

I have never looked for one. I'm sure they exist.

I have never looked for such a comparison.

Microchip continues to support the DIP package. All their new chips come in DIP packages. This means you can plug them into a protoboard and go.

Make sure that you recommend a programmer. I use the Kits R Us K149 -- it works fine; it is inexpensive and supports both USB and serial ports. There are others.

The PICList provides a vast resource of information for PIC chips.

I look forward to your article,

-Wayne

Reply to
Wayne C. Gramlich

formatting link

formatting link

formatting link

formatting link

formatting link

formatting link

>
Reply to
blueeyedpop

I seem to be hearing a lot about the Olimex stuff.

THanks for the info

Reply to
blueeyedpop

Yes compilers and assemblers have come a long way since the 16F84 was the hobbyists and students main choice. There is now an assembler (XCASM) that automatically looks after RAM page and code bank management. It profiles the generated executable and inserts page and bank select instructions where necessary. It tracks multiple execution paths through all instructions to determin the best place to insert page and bank select instructions.

There is also a structured BASIC compiler (XCSB) that generates optimised executables which are on a par with the more expensive C compilers.

e.g. the follow 13 XCSB statements are compiled into just 3 machine code instructions

proc inline set_bit(uint bit_id)

*(ubyte *)(bit_id >> 3) |= (1 > 3) & (1
Reply to
Sergio Masci

Thanks!

Reply to
blueeyedpop

Forgot mention microchip is in the process of getting rid of plcc packages.

They just got rid of /stopped producing 18f's in plcc 44.

Will be interesting to see how long they keep producing the

16f's in plcc44, current boards that we use for teaching are all plcc based.

Atmel dumped plcc packages a couple of years ago for Avr's still produce some 8051's in plcc I think.

Alex

Reply to
Alex Gibson

Hi Mike,

I really like the compiler tools from MikroElectronika

formatting link
Here's what I like about them: - choice: C, Basic or Pascal - non-crippled: In the free version you get all the features and all the cpus (loads are supported from 12F... to 18F...). The only limit is

2k instructions. If you need to write bigger progs you need to buy the very affordable package. - tons of full featured libraries for serial, i2c, eeprom, lcds (4 or 8bit) and many more. - good documentation, lots of examples including schematics and code

Regarding devel boards, MikroElectronica has some cool (but pricey) boards. I'm using a combination of an Olimex programmer (which I love and it was *cheap*) a PicKit1 Flash starter kit (USB) and a breadboard.

Regarding CPUs, I've got three favs: small - 12f675 - a lot of features for such a small chip med - 16F88 - the big brother (on features, not size) of the popular

16f84. It is pin compatible and so far, most of the code I've tried on it worked with little change from the 16f84a. large - 16f877a - so many features its amazing.

Based on the N&V article by Robert Lang in the Aug 2005 article "The MIDI-nator" I'm evaluating the 18F2455/18f4550 which runs at up to

48MHz and supports USB. My first impression of this chip is that its quite different from the 16f877a and kind of a black sheep among even the 18f series due to the special requirements of USB support. But once I get this chip figured out I'm sure having USB capability will be immensly cool.
Reply to
Matt Nuzum

My opinions (newbie):

I *think* the 18F series is "mainstream". For example, the 18F2420 is an enhanced revision of their popular 18F242. It seems like popularity and third party support is tilting towards 18F parts.

The 18F part offers superior value over 16F parts (more memory, speed, and features). However, the increased complexity makes for a fatter manual (300+ vs 200 pages for 16F) & more setup code.

I don't need all those extra features so I'm sticking with the 16F for now.

==============

2) What is involved with in circuit programming, and does it also provide in circuit debugging?

------ There is serial ICP and low voltage programming (which is done in circuit).

I haven't done serial programming. For debugging you need an ICD connection from the PIC to the ICD hardware (olimex icd2) which loads software onto the PIC (from MPLAB). MPLAB controls the ICD harware & PIC target. You can serial program with ICD hardware too. Olimex ICD2 is something like $49.

LVP works on parts with "enhanced FLASH" like 16F8x 16F8xx, or most all

18F parts. It requires only 5v power, a simple hardware interface between the PC port (serial or parallel) and the target, LVP software which resides on the PC (like IC-Prog). LVP is more restrictive than serial programming wrt the configuration bits it can alter, and pin RB3 is dedicated to the LVP function. Typically the LVP system is used to load a bootloader (like Shane Tolmie's). Bootloaders use around 100-500 words of program space on the target chip. They are made for a set of PIC chips and use a companion loader program on the PC. You make a hardware serial connection from the PIC to the PC with a MAX chip. There's no debugging but after a brief moment of inactivity the bootloader reliquishes control to the user program on the PIC. Hyperterm can then be used to provide a channel to view and control the program. Most modern compilers have provisions to accomidate popular bootloaders schemes.

3) What is the "workhorse" of the PIC world these days? Hobbiest like the 16F8x, 16F8xx, 18F242, 252, and more.

Reply to
John

Worth mentioning that the PIC18 line has hardware multiplication. Multiplication in just one cycle, that's right. Pretty handy.

Reply to
Guillaume

Hi Mike. Mchp is comming out with dozens of new chips every year, so it's hard to keep up - [just try talking to the guys who sell chip-programmers]. The flash-programmable 28-pin 16F876[A] and 44-pin

16F877[A] are probably the workhorses of the 2nd-gen PICs. 8K programming space, 384 bytes RAM, and loads of peripherals, A/D, I2C, SPI, timers, PWM, etc - plus 8-stack levels, so you can easily code in modular programming [1st-gen chips only had 2 stack levels]. Good for tons of projects. OOPic and Basic Atom use the '877. Mchp also has the higher-end 18F' series, with eeprom over 24K and internal RAM to 2-3Kbytes.

For tiny projects, they have several 8-pin uC's with flash eeprom, A/D, etc. The 12F675 and new 12F683 are very powerful for a buck or two. They are a large step up from the 12C5xx series, just like the 2nd-gen chips are from the 1st-gen chips like 16C5x. Most inexpensive programmers, like the melabs EPIC will code everything from 12F67x through 16F87x and 18F' series.

- dan michaels

formatting link
=======================

Reply to
dan

The web page states that the "lite" version is free for personal non-commercial use. They also sell a "standard" and a "pro" version. I am, however, unable to find any information on what the differences between the versions are. Does anyone know?

Reply to
Robert Roland

This info has now been copied to a more prominant location. Here is a direct link for your convenience:

formatting link
Regards Sergio Masci

formatting link
- optimising PIC compiler FREE for personal non-commercial use

Reply to
sergio

I did not know that. SWEET. Thanks for the info.

BRW

Reply to
Bennet Williams

Only 8 x 8 multiply, though.

The dsPIC series has single-cycle 16 x 16 multiply and MAC.

Best regards, Spehro Pefhany

Reply to
Spehro Pefhany

Reply to
blueeyedpop

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.