dlscenix: a Scenix programmer for about $10

This is a programmer for Scenix microcontrollers, based on Ben Stragnell's "fluffy" programmer. This document and all the dlscenix code is distributed under the terms of the GNU General Public License.

The programmer connects to the PC via the serial port. I took the shortcut of connecting the pins directly instead of using something like a MAX232. This works fine for short RS232 connections with standard desktop PCs.

The PIC contains code to talk to the PC via RS232, and to program the Scenix via the OSC1 and OSC2 connections. It also contains a few simple diagnostics. One of the cool (IMHO) things about dlscenix is that it speaks a human-readable protocol on the serial connection; all you need is a terminal program on the PC to test out the programmer.


(A PDF of this schematic more suitable for printing is here.)

I took the three power connections (Vss, Vdd and 12V) from the PC power supply; PCs have a regulated 5V supply and an unregulated 12V supply. It's important when doing this to check the circuit for shorts before applying power; or you may damage the PCs power supply. On my PC, the supposedly 12V line is at 11.9V - this seems to be close enough for the programmer, though.

The circuit uses 2 transistors and 1 diode. Any general purpose parts should work, but for the record here's what I used (i.e. what was at the bottom of my parts bucket):
T1 (NPN) 2N3904
T2 (PNP) BC308
diode 1N4148

PIC Software

The PIC software is here. The source for PIC software is called dlscenix.asm; I've included dlscenix.hex in the tarball also.

dlscenix.asm assembles with gpasm, it might also build with MPASM, but I haven't tried it.


After you've powered up the PIC, it's time to connect to it from the PC. Run any terminal program, configuring it to talk on the serial port that the programmer is connected to. The communications parameters are:

I happen to use Kermit running on Linux with the programmer connected to the first serial port, so my .kermrc is:

set line /dev/ttyS0
set speed 38400
set carrier-watch off
set handshake none

After connection, apply power to the PIC. You should see this message:


dlscenix version 0.0.1, Copyright (C) 2000 James Bowman
dlscenix comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.

You should have received a copy of the GNU General Public License
along with this program.

Read Write Test Erase Fusex

If you see garbled characters instead, check the line speed setting in the PC communications software. If you see nothing at all, check that the PIC has power, and that the RB2 connection is good.

Hit the '?' key; and the welcome message should be repeated. Whenever the PIC receives the '?' character, it resets. If this doesn't happen, check the connection to RB1.

Next, press 'T' for "Test". This takes you to a menu:
0:0V 1:5V 2:12V 3:Detect 4:Exit

Hit '0' and check that OSC1 is at 0V. Then hit '1' - the voltage should be 5V. '2' should give roughly 12V. If you're missing any of these values, check through the connections to the transistors and the diode. This table shows how the menu selections affect voltages:
Menu option RB5 RB6 Voltage
0 Low Low 0v
1 Low High 5v
2 High Low about 12v

If all this is working, remove power from the PIC and connect the Scenix. A breadboard works well for this. The Scenix needs 4 connections: Vss, Vdd, OSC1, OSC2. Apply power to the whole circuit. Go into the "Test" menu again and hit '3' for "Detect". You should see something like this:
0:0V 1:5V 2:12V 3:Detect 4:Exit
0:0V 1:5V 2:12V 3:Detect 4:Exit

The first value (7B in this case, but this will vary) indicates that the PIC was able to put the Scenix into program mode. The number is actually a count of the number of edges on OSC2 over a short interval; a non-zero value indicates that a carrier was present.

The other three values are the Scenix's DEVICE, FUSEX and FUSE values respectively.

If things worked so far, the next step is to attempt to read from Scenix program memory.
0:0V 1:5V 2:12V 3:Detect 4:Exit
Read Write Test Erase Fusex
etcetera, etcetera, etcetera...

The last thing to try is to download some code to the Scenix. In the source code tarball is a file sxflash.asm, and a built version in sxflash.hex, which looks like:


Choose 'W' for "Write" from dlscenix's top-level menu. Then copy the whole line

into the terminal window, including the trailing newline. This makes the PIC program the values into the Scenix. A moment later, the PIC will show that it's done programming by echoing a blank line back. Do the same with the second and third lines of sxflash.hex. After the third line (which is really just an end marker), dlscenix will return to the top-level menu. The whole procedure looks like this:
Read Write Test Erase Fusex

Read Write Test Erase Fusex

It's important to wait for the newline echo before sending the next line; the PIC can't recieve serial data while it's programming the Scenix.

OK, now the Scenix has a tiny program that counts very fast on PORT B. If you tie the Scenix's MCLR line high with a resistor, it should run the program and you'll see activity on PORT B; hook a led up on RB7 and it should light up.

Host Software

There is some host software in dlscenix.c that uses the protocol described above to program the Scenix. Usage:

dlscenix -e                # erase the Scenix
dlscenix -r foo.hex        # read Scenix program store into foo.hex
dlscenix -w sxflash.hex    # write sxflash.hex into the Scenix
The utility is pretty short, and runs on Linux and FreeBSD. It shouldn't be at all hard to make other versions; in particular a Perl version that ran everywhere would be nice; my Perl isn't really up to the job, though. If anyone wants to contribute other versions, mail them to me, and I'll add them to the package.

Take heed

It's possible to use an old 16C84 instead of a 16F84. But because the 16C84 has less RAM than the 16F84, it can't handle hex records longer than 16 bytes. Check the hex file and make sure that each line begins with ":10" or less. gpasm does not write hex records longer than 16 bytes.

If you plan on using an external clock - such as a crystal oscillator - with the Scenix: as the Scenix FAQ explains, you need to somehow disconnect OSC1 during ISP:

Q - I am using an external clock source to drive the SX. How do I do ISP of the SX?

A - You need to have circuitry to disconnect the clock-source from OSC1 when the SX-Key or SX-ISD is plugged into your system. It should be noted that 12.5V is present on OSC1 during device programming. That circuitry could be as simple as a jumper terminal.