<< Back

 

Cesky: , English:

PandaProg - universal programmer and tester for processors, memories and logic circuits

>>> The project is unfinished, only partially functional, intended only as inspiration! <<<

PandaProg was created when I got tired of the constant adaptation of programmers to different pin layouts or different interfaces of programmed circuits. Some operations required parallel programming, which conventional programmers cannot do. The basic idea was to be able to define pins (input, output, power, etc.) and to be able to program not only processors but also memories and also test logic circuits. Universal DIL socket 40 pins with possibility to insert adapters, voltage 3.3V, 5V, 12V. Gradually 3 variants were created. PandaProg0 was the first attempt when I solved pin switching with transistors. I ended up in the middle of soldering when I realized I was creating an unnecessarily complex monster. The second (now functional) version, PandaProg1, made do with just an ATmega169 processor, which has powerful enough outputs to power the components. Simplicity at the small tax that for 12V signals the user has to manually reconnect the DIL jumper. I've made programming the Atmel processors I had in the drawer, serial and parallel interface (5V and 12V). Then I ran out of processor memory, but instead of switching to ATmega32, I thought of reworking the processor firmware into an interpreter of user-definable scripts that will be loaded into RAM only when needed - PandaProg2. The interpreter is written in assembly language and I think it works very well and efficiently - 1 instruction about 1 us. I started defining scripts for SPI, but unfortunately I ended the project after that due to time constraints. I'm sorry to put such a promising project on hold, so I'll be very happy if someone can use some of it.

PandaProg0: I ended up with this version in the middle of flying, when I realized it was unnecessarily complicated, but maybe it could inspire someone, so at least briefly. A pair of transistors are used to switch the pin function, supplying either 5V or 12V to the pin, depending on the output of the shift register. The shift register has open-collector outputs, with a third output switching the pin to ground. The signal from the pin is fed to the input of the processor through a resistor and a diode that protects the processor when the 12V voltage is activated. By controlling the regulators it is possible to vary the voltage on the circuit. The programmer was 3-floor for ease of signal interconnection and because of the limitation of the board in Eagle freeware to 10x15 cm.

- -

- - -

- - -

- - -

PandaProg1: I thought of using directly the pins of the ATmega169 processor, which is capable of supplying 40 mA to the programmed circuits. The user has to rewire the jumper during 12V programming, but this is a small tax for simplicity and low price (the cost comes out to about 500 CZK, compared to many thousands for professional programmers using special custom circuits). The jumper can connect a circuit pin either directly to a processor pin or to a controlled 0V/5V/12V voltage. Alternatively, a cable can connect the pin to a 0V, 5V or 12V power connector (e.g. if the current from the control processor is not enough) or to an external clock source (the clock source is otherwise created in software). The SPI connector is used bidirectionally - it can be used to program firmware into the processor (Slave jumper position) or it can be used to program other processors (Master position). The programmer is powered from 5V USB connector (it does not require external power supply), 12V voltage is generated by switching converter. This version has already proven to be viable and well usable. The software has been made operational and debugged with AT89C51, AT89C52, AT89C55WD, AT89C2051, AT89S51, AT89S52, AT90S4414, ATmega8, ATmega162, ATtiny2313, as well as several logic circuits (TPIC6B595, 74HC04, etc.). I started to use Microchip processors, but I ran out of processor memory and then switched to version 2.

PandaProg1 construction and revival: The first errors in the design became apparent during soldering - the soldering pads of some SMDs are too small and so e.g. soldering the capacitor to the crystal took a lot of work. But I also had poor quality fabrication of the PCB (bad adhesion), more experienced designers will surely do better. When reviving, I recommend to try first a simple flashing with LED (can be pushed into the test socket) to verify that the processor is alive. Then revive the USB interface - connect the cable, the FT232RL circuit should be detected by the FTDI driver (no processor functionality is needed to detect the FT232RL). In order for the PandaProg software to be found by the programmer, you need to use the "FT Prog" utility (from the FTDI manufacturer - see also the driver package) and in the "Product Description" settings change the device name from "FT232R USB UART" to "PandaProg" (this changes the EEPROM of the FT232RL circuit, so it will be part of the board). It is also possible to disable the "Load D2XX Driver" option, as the COM port emulation is not used (the device is accessed via the DLL interface). I don't recommend changing the device ID "correctly" - it would require distributing drivers with custom INF definition, which means solving user problems with FTDI driver commissioning, ensuring the latest driver version is always available and the possibility of collision of different FTDI driver versions at the user (I often deal with this, it brings many problems). If only device name detection is used, standard FTDI drivers can be used and many problems are eliminated. Finally, load the firmware into the processor, after running the software and connecting the USB cable the programmer should detect correctly.

PandaProg1 software: The control software of the programmer is for Windows, the compiler is MS Visual Studio 2005. It uses Windows API with custom libraries. The program has 3 control pages: "Circuit" (displaying the circuit pins and controlling individual pins manually), "Program" (programming the circuit) and "Diagnostics" (running diagnostic programs in the processor under test, logic circuit diagnostics - this page is not yet fully functional). The "Connect" button detects the programmer via the USB interface and displays the hw and sw versions. In the left column you can select the programmed circuit (Detect and Test buttons are not functional, only DIP textool works from the interface). The ON button switches on the power supply of the circuit. The circuit definitions are read from the "devlib" directory from the *.ini files.

PandaProg2: With the software I did not like the necessity to create the programming interface of the circuits in the control software and in the firmware of the programmer (besides the problem with the lack of memory). The user does not have the possibility to define his own unknown circuits. Therefore, I redesigned the software into scripts. In the programmer there is a script language interpreter (similar to assembler). The script is loaded into RAM whenever needed. When using the ATmega169, the script execution buffer has a size of about 350 instructions, there are 18 8-bit registers (AL, AH,...) which can also be used as 16-bit register pairs. The program can perform all common register operations, conditions, jumps, subroutines. One instruction is executed in about 1 us. Any programming or testing protocol can be defined in this way. Similarly, it should be possible to define the user interface of control software using scripts. Unfortunately, due to time constraints, I interrupted the development at a stage where I had only defined some of the SPI script. But I feel quite sorry for the script interpreter, it seems to be well functional (of course there may be bugs, it hasn't been tested much), so I'll be glad if it finds a use somewhere else. The control software reads the scripts from the "script" directory. If the capacity of the execution buffer was not enough, I assumed the possibility of loading only the procedures needed for the operation - for example, no write functions are needed when reading. The clock source for the circuit is software generated with a selectable clock rate of 100/200/500 kHz or 1 MHz.

Shortcomings and improvements of PandaProg:

Downloads:

<< Back