yet another PIC-based programmer (for Linux)

Questions about programming (not codeing) PSoCs and Encore II as well as freeware programming hardware and software are discussed here. This is also the place to talk about production programming. Programming means loading a HEX file in to the Flash, not, writing your program.

Moderator: ericb

yet another PIC-based programmer (for Linux)

Postby werner on Tue Feb 14, 2006 9:06 am

The first version of my PIC-based programmer is starting to behave.
So this is a good moment to make a release:

http://www.almesberger.net/misc/cy8c2/cy8c2utils-0.tar.gz

It's designed to use a PIC16LF87 or 88, or, if your target runs at 4V
or more, a PIC16F87 or 88. It takes power from the target, only
supports reset mode, and doesn't sense power. It talks to the PC
vis RS-232C at 19200 bps, so it's slow as well. (Programming a
4k device takes about 15 seconds.)

The programmer software is designed to allow for easy addition of
drivers for other programmers. I ultimately want a very cheap and
simple bit-banging programmer, so the PIC one is just an
intermediate step.

This package contains the firmware (PIC assembler), the schematic
(gsched), and an example layout (PCB) in through-hole technology.

Since I run in a Linux-only environment, I don't have the Cypress
tools to compare things with, so there may be compatibility issues
in the handling of Intel HEX files. If you hit any problems, it would
be good if you could send me the file causing them.

- Werner
werner
The Big Cheese
The Big Cheese
 
Posts: 246
Joined: Fri Jan 20, 2006 10:20 am
Location: Buenos Aires, Argentina

update: fixes, cleanup, ROM files, security data, ...

Postby werner on Wed Feb 15, 2006 11:40 am

I've uploaded an update of my package:

http://www.almesberger.net/misc/cy8c2/cy8c2utils-1.tar.gz

Highlights: the programmer now supports ROM files and security data
(including checking the SSC return code). Besides that, there are some
bug fixes and a lot of cleanup. I've also added a simple disassembler.

- Werner
werner
The Big Cheese
The Big Cheese
 
Posts: 246
Joined: Fri Jan 20, 2006 10:20 am
Location: Buenos Aires, Argentina

update: silicon revision, skip blocks, assembler

Postby werner on Fri Feb 17, 2006 3:09 am

Yet another update:

http://www.almesberger.net/misc/cy8c2/cy8c2utils-2.tar.gz

The programmer now also retrieves the silicon revision. (With thanks
to dany for dropping the right hints :-) Note that this is highly
experimental, since I have no way of telling whether the revision makes
any sense.

For example, for a chip with the case marking
CY8C24223-24PI
0429 A 02 505989
I get 0x1112 (A is the high byte, X the low one).

The programmer now skips over read-protected blocks if the option
-z is set.

Last but not least, I've added a simple assembler.That one still needs a lot
of testing. There are also some questions I have about the language (the
manual is a bit vague at some points), see as/README.

- Werner
werner
The Big Cheese
The Big Cheese
 
Posts: 246
Joined: Fri Jan 20, 2006 10:20 am
Location: Buenos Aires, Argentina

various bug fixes, AREA

Postby werner on Fri Feb 17, 2006 10:18 pm

And now the bug fixes :(

http://www.almesberger.net/misc/cy8c2/cy8c2utils-3.tar.gz

Bit-banging mode was badly broken. Now it's much more reasonable.
I've also fixed a number of silly bugs in the assembler and added support
for AREA.

- Werner
werner
The Big Cheese
The Big Cheese
 
Posts: 246
Joined: Fri Jan 20, 2006 10:20 am
Location: Buenos Aires, Argentina

more bug fixes, more chips, great renaming

Postby werner on Mon Feb 20, 2006 1:13 am

More maintenance issues:

http://www.almesberger.net/misc/cy8c2/m8cutils-4.tar.gz

First, an important bug fix: when I looked up the registers in the
INITIALIZE_3 vectors, I mistook BDG_TR for ILO_TR. So 3V mode
was ending up with some 5V settings. Argh.

Then, I've renamed the package from cy8c2* to m8c*. The reasons for
this are that a) many of the tools are generic for m8c anyway, and b)
even other chips from the M8C family may use the same programming
protocol.

The programmer now also supports CY8C24x94 and CY8C29xxx
chips. Be warned that this is completely untested. (In fact, the only
chip I've tested so far is the CY8C24223.)

Then there are more changes to AREA, which should now approach
usefulness.

- Werner
werner
The Big Cheese
The Big Cheese
 
Posts: 246
Joined: Fri Jan 20, 2006 10:20 am
Location: Buenos Aires, Argentina

new programmer, maintenance again

Postby werner on Tue Feb 21, 2006 10:07 pm

Also the bit-banging (i.e., non-PIC) programmer is starting to
work:

http://www.almesberger.net/misc/cy8c2/m8cutils-5.tar.gz

This release features the bit-banging "watsp" programmer, which
connects to the serial port and has a component cost of about
USD 1. It doesn't yet work reliably at 3V, though.

Besides that, I've added protective resistors to the output of the
"waspic" programmer, and fixed a bug in the initial vector that's
sent to the target (it ended on 111 instead of 000 - strangely
enough, that didn't keep it from working).

- Werner
werner
The Big Cheese
The Big Cheese
 
Posts: 246
Joined: Fri Jan 20, 2006 10:20 am
Location: Buenos Aires, Argentina

reset when you leave, simulator sneak preview

Postby werner on Thu Feb 23, 2006 2:25 pm

Programmers now reset more often, and the DIY ICE is here:

http://www.almesberger.net/misc/cy8c2/m8cutils-6.tar.gz

We're not more careful about resetting the target. In particular,
the waspic programmer could loop happily without ever resetting
the target, usually permanently leaving it in programming mode.

Note: fixing this requires a PIC firmware upgrade.

The bulk of the changes is major reshuffling of the programmer
code to turn it into a backend for the simulator, making it a simple
do-it-yourself in-circuit-emulator.

Be warned that the simulator is almost completely untested, lacks
many essential features (such as interrupts, timers, ...), and some
parts of it will certainly undergo massive and user-visible changes.

What the simulator can do is execute all instructions, as long as
they're not an SSC, use the main CPU registers (CPU_F,
IDX_PP, etc.), and set GPIO (*DR and *DM[012]). If invoked in
ICE mode, it will propagate GPIO changes to the target.

A simple LED flashing loop executes internally at about 20 MIPS
on an Athlon64 3200+ (2 GHz). This drops to about 0.0015
MIPS if playing ICE through the admittedly glacially slow waspic
programmer. With a proper programmer, speeds of at least 0.1
MIPS should be possible if doing nothing but I/O.

- Werner
werner
The Big Cheese
The Big Cheese
 
Posts: 246
Joined: Fri Jan 20, 2006 10:20 am
Location: Buenos Aires, Argentina

simulator improvements

Postby werner on Tue Feb 28, 2006 3:56 pm

For once, mainly simulator work:

http://www.almesberger.net/misc/cy8c2/m8cutils-7.tar.gz

The simulator now also supports interrupts and GPIO interrupt
generation. I've also written the DIY ICE side of this, but haven't
tested it yet, so it probably doesn't work.

I've also fixed several nasty bugs in the simulator. I'm sure many
still remain. It's now also a little nicer to use interactively.

- Werner
werner
The Big Cheese
The Big Cheese
 
Posts: 246
Joined: Fri Jan 20, 2006 10:20 am
Location: Buenos Aires, Argentina


Return to Device Programmers

Who is online

Users browsing this forum: No registered users and 0 guests