PICs in general, PIC language questions, pic hardware questions

Translate This Thread From English to

Threaded View
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



Re: PICs in general, PIC language questions, pic hardware questions

On Sat, 10 Sep 2005 19:31:58 -0700, "blueeyedpop"

[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.

--
Rich Webb   Norfolk, VA

Re: PICs in general, PIC language questions, pic hardware questions

Yes,

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

Thanks,
Mike




Re: PICs in general, PIC language questions, pic hardware questions



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
http://www.picant.com/c2c/c.html
<http://sourceboost.ipbhost.com/index.php?s#ae3d15d76291d85d4881a3d2931c1a&showforum=1>

supported chips
http://sourceboost.ipbhost.com/index.php?s#ae3d15d76291d85d4881a3d2931c1a&showtopic –1

Jal is one of my favourites
http://jal.sourceforge.net/
http://groups.yahoo.com/group/jallist
http://www.voti.nl/jal/index.html

If you prefer forth there are a couple of choices

pic forth
http://www.rfc1149.net/devel/picforth    16f only
http://tutor.al-williams.com/picforth1.htm

http://pic18forth.sourceforge.net/     18f

python for pics for 16f
http://sourceforge.net/projects/pyastra/

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

clone sold by www.sparkfun.com  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
http://www.kitsrus.com/upuc.html
http://www.beam.to/diyforum          forum for the programmers
http://www.kitsrus.com/icsp.html

3. 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
<http://www.microchip.com/ParamChartSearch/chart.aspx?branchID 1&mid&lang=en&pageIdt>

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

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

I like the pic18f4550 PICdem Full speed usb board
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId 06&dDocName=en021940&part=DM163025

The  64/80-pin TQFP Demo Board
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId 06&dDocName=en021940&part=DM163025

also the www.edtp.com boards  if you are interested in ethernet or wireless
using a pic (also have boards for the new microchip spi to ethernet devices)
http://www.edtp.com/framethrower.htm

futurlec.com has some dirt cheap pic boards
http://www.futurlec.com/PICDevBoard.shtml
http://www.futurlec.com/PIC18F458Training.shtml

5. Don't forget  boost c  / picant  www.picant.com

forum at

and also FED C

Jal is one of my favourites
http://jal.sourceforge.net/
http://groups.yahoo.com/group/jallist
http://www.voti.nl/jal/index.html

If you prefer forth there are a couple of choices

pic forth
http://www.rfc1149.net/devel/picforth    16f only
http://tutor.al-williams.com/picforth1.htm

http://pic18forth.sourceforge.net/     18f

python for pics for 16f
http://sourceforge.net/projects/pyastra/

http://massmind.org/techref/microchip/languages.htm

links

mplab  7.20
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId 06&dDocName=en019469&part=SW007002

microchip C18  compiler (student version)
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId 06&dDocName=en010014&part=SW006011


Alex


18f pics
http://www.microchip.com/ParamChartSearch/chart.aspx?branchID 04&mid&lang=en&pageIdt



Re: PICs in general, PIC language questions, pic hardware questions

Thanks!

<http://sourceboost.ipbhost.com/index.php?s#ae3d15d76291d85d4881a3d2931c1a
&showforum=1>

http://sourceboost.ipbhost.com/index.php?s#ae3d15d76291d85d4881a3d2931c1a&showtopic –1

<http://www.microchip.com/ParamChartSearch/chart.aspx?branchID 1&mid&la

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId 06&dDocName=en021940&part=DM163025

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId 06&dDocName=en021940&part=DM163025

devices)

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId 06&dDocName=en019469&part=SW007002

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId 06&dDocName=en010014&part=SW006011

http://www.microchip.com/ParamChartSearch/chart.aspx?branchID 04&mid&lang=en&pageIdt



Re: PICs in general, PIC language questions, pic hardware questions



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



Re: PICs in general, PIC language questions, pic hardware questions

On Sat, 10 Sep 2005 19:31:58 -0700, "blueeyedpop"


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.

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

3. 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.

6. 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



Re: PICs in general, PIC language questions, pic hardware questions

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

THanks for the info

Mike
<Bennet Williams> wrote in message


Re: PICs in general, PIC language questions, pic hardware questions


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 <http://piclist.com/>  provides a vast resource of
information for PIC chips.

I look forward to your article,

-Wayne



Re: PICs in general, PIC language questions, pic hardware questions

Thanks!




Re: PICs in general, PIC language questions, pic hardware questions



On Sat, 10 Sep 2005, blueeyedpop wrote:


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 << (bit_id & 7))
    enproc

    proc inline ubyte test_bit(uint bit_id)

        return ((*(ubyte *)(bit_id >> 3) & (1 << (bit_id & 7))) != 0)
    enproc

    const RA6 = (&PORTA << 3) + 6
    const RB4 = (&PORTB << 3) + 4

    proc main()

        if test_bit(RA6) != 0 then

            set_bit(RB4)
        endif
    endproc

The generated executable is:

        btfss    5,6
        goto    lab1
        bsf    6,4
    lab1

I like the 16F88 and 16F876 myself. The 16F88 is a fantastic little 16
series PIC. It has 16 I/O pins, a built in 8MHz osc, a hardware USART,
ADC, PWM, I2C and SPI controllers, 368 bytes of RAM, 4K words of program
space. It is self programmable (it can download code into itself from a
serial link if you want it to). The 16F876 on the other hand has 22 I/O
pins, and 8K words of program space. Apart from the missing internal
oscillator it is much like a bigger version of the 16F88.

One of the biggest gripes I hear about the 16 series PICs is to do with
the RAM paging. Yes it complicates things a little but using a good
compiler or assembler quickly reduces this complication to insignificant
levels. It is laughable to see people advocating the 18 series because of
the simplified RAM layout, faster execution speed and larger memory space
and then see them throw it all away by using inefficient compilers or
writing inefficient assembler.

The one REALLY good thing about the 16 series PICs is that they are dirt
cheap and offer amazing bang for the buck. Instead of jumping through
hoops trying to make a big expensive MCU behave like several small MCUs it
is actually possible to use several of these PICs to produce a pretty
powerful low cost system. Many people will immediately scream about the
comms overheads between each MCU. But the reality is that comms can be as
simple as a didicated I/O line indicating start and stop or as complex as
a LAN. There are many techniques for reducing the comms burden on the
system.

One of the goals of XCSB is to simplify multitasking and multiprocessing.
As such it directly supports multitasking. This doesn't mean that it
simply has a library function that the programmer calls to perform task
switching, it means that it generates code depending on the way that
functions (and their local veriables) are used within the tasks.
Multiprocessing will be an extension to this and will use the multitasking
core to perform low priority background comms.

Regards
Sergio Masci

http://www.xcprod.com/titan/XCSB  - optimising PIC compiler
FREE for personal non-commercial use



.

Re: PICs in general, PIC language questions, pic hardware questions

On Mon, 12 Sep 2005 07:33:33 +0100, Sergio Masci


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?

--
RoRo

Re: PICs in general, PIC language questions, pic hardware questions



On Tue, 13 Sep 2005, Robert Roland wrote:


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

http://www.xcprod.com/titan/XCSB/edition_diff.html

Regards
Sergio Masci

http://www.xcprod.com/titan/XCSB  - optimising PIC compiler
FREE for personal non-commercial use




Re: PICs in general, PIC language questions, pic hardware questions

Hi Mike,

I really like the compiler tools from MikroElectronika
http://www.mikroelektronika.co.yu/

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.


Re: PICs in general, PIC language questions, pic hardware questions

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.


Re: PICs in general, PIC language questions, pic hardware questions


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

Re: PICs in general, PIC language questions, pic hardware questions

On Tue, 13 Sep 2005 11:28:12 +0200, Guillaume <"grsNOSPAM at


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

BRW


Re: PICs in general, PIC language questions, pic hardware questions

On Tue, 13 Sep 2005 20:42:07 -0400, the renowned Bennet Williams <>


Only 8 x 8 multiply, though.

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


Best regards,
Spehro Pefhany
--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

Re: PICs in general, PIC language questions, pic hardware questions



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
www.oricomtech.com
=======================


Re: PICs in general, PIC language questions, pic hardware questions

Thanks!


Site Timeline