Header

PIC micros

[Front page] [BBC Mecca] [Links] [PIC micros] [Enviromyths] [The dump] [Email]

On this page


Designing PIC based systems with RISC OS

There are countless applications in which hardware needs to be made intelligent - often to save on having to build acres of circuitry using discrete 7400 series logic. Instead a PIC microcomputer can be employed. These versatile 8 bit microprocessors by Microchip became popular in the early 1990's and can be found embedded in many items from games consoles to washing machines.


Assembling the source code

Having designed the hardware to control whatever system you have in mind the subject of software must be addressed. Source code is normally written in assembler since PICs use a RISC architecture with as minimum of 35 instructions to learn!

The release of Microchip's assembler (MPASM) spawned an explosion of assemblers for use on IBM compatible PCs. However, few exist for use with RISC OS - !PICbasic is one of those.

It assembles from disc a tokenised BBC BASIC file containing mnemonics in exactly the same way as you would use them if writing ARM assembler or 6502 assembler on a BBC Micro. A side by side example is available for comparison of syntax.


Introducing the PICsuite package

The result of assembling the source code will be an object code file which is ready to be programmed into the PIC chip. Where possible use of a flash/EEPROM/UV-erasable based part is recommended for initial prototyping since these allow for itterations while the bugs are being ironed out of your software! The final revision can of course be put into a one time programmable (OTP) version.

For parts which have on board EEPROM data memory this can be pre initialised at the time of programming, for example with calibration constants or lookup tables that your code uses.

In addition to the assembler, a whole suite of software is available:


What does PICsuite include?

PICbasic - the assembler which allows you to write as you would in BASIC II or BASIC V but using PIC mnemonics instead targetting the 12/14/16 bit instruction set [Latest V1.40].
PICdis - the disassembler takes a binary file (for example one read off a chip) and outputs either on the screen, or saved into a textfile. The format of the disassembly listing is conveniently the exact format which the assembler uses permitting the listing to be reassembled then reprogrammed onto the chip [Latest V1.17].
PICtracer - a simulator designed to allow you to monitor how your latest piece of software will behave before even putting it on a chip [Latest V1.15].
PICprog - along with the PIC programmer board (included in the price) this commits your software to the device of your choice. The software includes program/verify/blank check/dump capability. Configuration bits, user id, EEPROM data memory, and of course code memory can all be read or programmed and saved in a variety of formats [Latest V1.55].
PIClaunch - this program avoids the need to leave the familiarity of the desktop when assembling/disassembling as you simply drop the file onto the iconbar. Also comes with some other handy programming aids such as binary comparision tools and template source files [Latest V1.30].


Availability

The PICsuite package contains the programming hardware, comprehensive printed manual, and software diskette. All software is suitable for running on any version of RISC OS from 3.10 to 5.xx inclusive, though PICprog will require access to a 25 pin parallel port:

Option: Price: Comments:
PICsuite
£99.99 inc postage
RISC OS version of the programmer/disassembler/assembler/ simulator/launcher
Power adapter 12V
£9.99 inc postage
UK style plug AC-AC adapter for the PICsuite programmer board
Centronics printer lead
£5.99 inc postage
For 25 pin D shaped parallel port

Note:


Devices supported by PICsuite

The assembler and disassembler understand all of the 12/14/16 bit variants. This includes the tiny 8 pin 12CXXX series which are often embedded into consumer devices such as games machines and satellite decoders, right up to the high end 18FXXX family with massive on board memory and integrated peripherals such as motor controllers.

In addition the programmer driver is capable of handling the micros listed in the following table (some need a simple passive adapter if physically too big to fit into the on board ZIF socket - full details are supplied on how to build these).

As PICsuite is driven by device 'templates' it is normally only necessary to add the desired device to the list of known PICs.

Low cost 6 pin PICs, with a single comparator and timer
10F200 10F202 10F204 10F206 10F220 10F222
Tiny 8 pin PICs, with or without non volatile EEPROM data memory
12C671 12C672 12CE673 12CE674 12F629 12F675
Tiny 8 pin PICs, which can also be run with an internal oscillator
12C508 12C508A 12CE518
12C509 12C509A 12CE51912CR509A
High speed CMOS PICs
16C554 16C556 16C558
High speed CMOS PICs with an assortment of peripherals
16C61 16C62 16C62A 16C62B 16C620 16C620A
16C621 16C621A 16C622 16C622A 16CE623 16CE624
16CE625 16C63 16C63A 16C64 16C64A 16C65
16C65A 16C66 16C67
Flash based PICs, operating down to 2.5V
16F627 16F627A 16F628 16F628A 16F648A
16LF627 16LF627A 16LF628 16LF628A
PICs with ADCs, from 8 to 12 bits resolution
16C71 16C710 16C711 16C712 16C716 16C717
16C72 16C72A 16C73 16C73A 16C73B 16C74
16C74A 16C74B 16C76 16C77 16C770 16C771
16C773 16C774 16F818 16F819
USB 1.1 PICs (special 24MHz versions)
16C745 16C765
18 pin PICs with EEPROM code memory
16C84 16CR83 16CR84
Low cost flash based PICs, with a wide array of peripherals
16F83 16F84 16F84A 16F870 16F871 16F872
16F873 16F873A 16F874 16F874A 16F876 16F876A
16F877 16F877A 16F73 16F74 16F76 16F77

PICsuite FAQs

Does PICbasic understand the pseudo mnemonic OPT?
Yes, however only certain bits of it are valid - for example offset assembly must ALWAYS be used as the assembler isn't running on the PIC itself.

Does PICbasic output to Intel hex object format files or similar?
No, the resulting file is a binary file ready to be programmed straight into the flash, EEPROM, EPROM or PROM memory inside the PIC chip.

Can I preprogram the EEPROM data memory within the PIC?
Yes, you simply drop the desired contents onto the 'Data Memory' box in the programming window before pressing 'Start'.

The motherboard doesn't have a parallel port, how do I connect the programmer?
The main requirement is the ParallelDeviceDriver module (which adds the 'Parallel' device to DeviceFS). This is present by default on the Risc PC and A7000 and A7000+. A PCI based parallel port can also be used, for example a combined serial/parallel card supported by Tank's driver.

What happens if the PIC I've chosen isn't supported?
As PIC suite is driven by device 'templates' it is normally only necessary to add the desired device to the list of known PICs. But check first with the author as it may already have been added.


©2013 SPROW [Updated 07-Sep-2013] | home
Valid HTML 4.01