You are in home \ microcontroller \ my 8252 project   (back)  


Specs

The 32k x 8 external RAM chip provides more than ample room for both program memory and external RAM. Also plenty memory mapped I/O space.
Used for developing target code with plenty room for debug code too.
11.0592 MHz clock frequency, 12 clock cycles per machine cycle.
Rapid reprogram cycle.

(top of page) [specs] [parts] [interface] [using it] [emulation] [making your own] [pictures]


parts


(top of page) [specs] [parts] [interface] [using it] [emulation] [making your own] [pictures]


interface

The serial interface connects to the PC's com port through a MAX-232 providing RS-232 serial, providing convenient reprogramming of the external memory with the 8252's bootloader in internal flash memory using the downloaded Hex file. During execution of the target code, this serial port is free for full duplex operation under program control.

The general purpose interface provides 12 bits of digital I/O dedicated to the target system under development. Connection between the I/O interface board that defines the target hardware interface and the development board is by 2 x 8 PCB pin header and 16-way ribbon cable IDC connector.
This same interface can be connected to a cable for In-System Programming (ISP) of the 8252's 8k internal Flash memory via it's SPI (serial peripheral interface) to the parallel port (LPT) of the PC running the flash programming software.
This interface also allows the 8252 to conveniently emulate the x051 (2051/4051) microcontroller when developing code for it.

My design of the development board also provides 3 more 8-bit I/O ports. These are addressed as memory mapped I/O, and can be retained when the final target code is flashed to internal memory in the final product. These extra ports also more than compensate for the two ports lost to external memory addressing. Only a couple of cheap chips are needed to extend the number of these ports, and many more ports can be provided in this way.

(top of page) [specs] [parts] [interface] [using it] [emulation] [making your own] [pictures]


using it

When 'writing & trying' assembly code, the procedure I follow is this. I use a text editor for the assembly code, save it, click the icon that runs the ASEM-51 compiler, read the result in the console window to see if there were any assembly errors in creating the hex file. Then I switch the development board to internal memory mode and reset it to run the 8252's bootloader. I ASCII upload the hex file and the bootloader spits back it's checksum. Finally I switch to external memory mode, reset, and watch my program run.
So far I've been developing code in modules accessed by a menu that I use at the terminal screen. This process is very easy and quick, taking only about 10 seconds per save-assemble-upload-run development cycle, which is almost as good as it gets. I guess I could locate all my code above 8k and remap the interrupt vectors (which the bootloader code provides for) so I can do all in internal memory mode (possible because memory accesses above 8k are externally addressed, even in internal mode).

(top of page) [specs] [parts] [interface] [using it] [emulation] [making your own] [pictures]


Emulation

emulating x051

The 1051/2051/4051 micro can be emulated by the basic 8252 development board as-is. The main interface header provides a suitable number of pins for this. The unmarked pin in the interface connector (marked as EA on the internal-programming connector) can be used for the 2051's P 3.7.
Using this 8252 development board to develope code for the x051 means you no longer have to unplug and plug your micro twice each code-compile-burn-test cycle, the RS-232 link providing the re-programming interface. Since they are pretty much code=core-compatible, anything written for the x051 will work in the 8252. There are also many ways in which the extra resources available in the 8252 can be used during development as development aid reducing debugging time.

emulating 8252

To regain the ports lost to using 8252 in external mode, port 0 can be used to provide several multiplexed additional ports. This requires merely two chips, a 3-8 DeMux and a quad AND gate. These ports are internally represent the ports tied-up with external mode interface.
See the
extended schematic to see an example wire-up of extended ports.

emulating external ports

Further ports can be emulated in the same way as above, with the addition of another quad-AND gate. If another 3-8 DeMux was used, or replaced with a 4-16 DeMux, then up to a further 2 quad-AND gate chips could be used to provide up to a maximum of 16 ports. This port expansion method allows further similar extension.

(top of page) [specs] [parts] [interface] [using it] [emulation] [making your own] [pictures]


Applications Interface

micrio interface Here's the interface to the micro. So far I have my interface I/O circuitry for each project on its own board, connected by a 16-way ribbon cable with IDC connector to the development board's DIL header connector.

Note that this interface is useful for emulating a 4051 as well.

Further ports are implemented as 4 8-bit memory mapped I/O ports, each with a 12-way connector on the other side of the development board. These ports more than compensate for the two ports (port 0 & 2) used up by the external memory interface. The number of memory mapped I/O ports is easily extended as needed, and can be retained in the final target system using port 0 (in 8-bit addressing mode) alone, freeing up port 2.

(top of page) [specs] [parts] [interface] [using it] [emulation] [making your own] [pictures]


to build your own 8252 development board...

Check the list of 8252 links for all of the above...

(top of page) [specs] [parts] [interface] [using it] [emulation] [making your own] [pictures]


pictures


more pictures of my 8252 development board.

(top of page) [specs] [parts] [interface] [using it] [emulation] [making your own] [pictures]


You are in home \ microcontroller \ my 8252 project   (back)     [see also micro resources]


Further stuff on this page is the old version... will be deleted after I neaten up the above stuff.

(top of page)


8252 development board The development board has an 8252 micro with 32k onboard external memory. The 8252 has a bootloader in internal memory that accepts a hex file from the PC through the serial port and puts it into the external RAM chip. When reset in external mode, the program in external memory is executed, and the serial port is typically used then for debug information and control purposes.


There are several ways to run software in the 8252.

The easiest way is to use the ISP feature to program internal memory. This involves an ISP cable from the PC's parallel port to the 8252's SPI port, and the appropriate software running on the PC. (The software and cable plans are free and easily found). Unfortunately the 8252's internal flash memory can only be burnt about 1000 times or so, which I reckon can severely reduce the lifetime of a chip under the edit-compile-burn-run development cycle.

The common alternative to this is to use the 8252 in external program memory mode, and burn the program into an (E)EPROM, or an EPROM emulator. This would be tedious and incurrs extra costs (EPROMs, eraser, burner, or emulator).

Yet another method is to use a RAM chip for external memory. This can be rapidly reprogrammed with no wear-out, over and over, typically by a bootloader program in the 8252's internal memory, which accepts the code to run from the PC via serial port, and writes this to external RAM, which is then run. This is the method I used, and will be discussed further.


How I made my 8252 development system

Advantages of code in external RAM are relatively lower cost than EPROM method, faster than other methods, versatile...

The external RAM chip was obtained from an old 486 motherboard. These often have 8 socketed 32kx8 RAM chips used for cache. This provides more memory than is required, and can be allocated as you wish between target code under development, debug/monitor code for during development, and external RAM (in addition to the internal RAM already available), all from one chip. If desired, up to 4 of these chips can be implemented to provide the maximum of 64 KB of program memory, and 64KB of RAM, but generally a single 32KB chip is more than ample.

The development code can be placed above 8 k, and the bootloader run the development code in internal memory mode, or the development code can be located conventionally at 0000h, and the micro reset in external mode to run it.

External I/O addressing is easily implemented to provide more ports as desired. Since using the 8252 in external memory mode uses up 2 ports, these can be 'reclaimed' (or emulated) easily. I have used 2 cheap logic chips (3-8 decoder, quad NAND) to provide 4 8-bit ports as memory addressed I/O. With a 2nd NAND gate, a further 4 ports are possible.
I have mapped these I/O ports to just above 32k, and all these ports are still available in the final target system at the cost of just one of the 8252's ports, as it can perform 8-bit external addressing (as well as the usual 16-bit adressing).


(top of page)


Begun this page 14-Sep-2001, and will be adding much to this page to bring it up to date to my project's progress. Updated 24-Sep-01.