C-52 Evaluation Board
Wichit Sirichote, kswichit@kmitl.ac.th

Build your own a low-cost learningboard C-52 EVB for studying Assembly and C language programing. The boardfeatures 89C52 with 8kB PAULMON2 monitor program, 32kB RAM, and two 8-bitports P1 and P3. PCB fileincluded.


Introduction

I have designed the C-52 EVB to be used as a learning tool in the class"Assembly and C programming for Microcontroller". This page provides materialsfor building the board. Students may build the board by themselves to practicelearning by doing. The C-52 EVB has a 89C52 with 8kB PAULMON2 monitor program,32kB SRAM, and two 8-bit ports P1 and P3. There is no 7-segment displayand hex key pad, entering hex code or intel HEX file to the test RAM thusneeds a PC running terminal emulation program TVI 920, say.

Hardware

A circuit diagram of the C-52 EVB is depicted in Figure 1. See at EA pinfirst, I put EA to Vcc configuring the 89C52 started internal code executionwhen reset. The first 8kB code space, 0000H-1FFFH is then be a monitorprogram, i.e., PAULMON2. A 32kB SRAM 62256 uses 15 lines address, A0-A14,while A15 of the 89C52 connects inverter gate, 74HC00, to CE pin. Thismakes the address space of the SRAM to be 8000H-FFFFH, i.e., A15 must be'1' to enable 62256. See OE pin, RD and PSEN are tied together with ANDgate made by two NAND gates. This makes the address space 8000H-FFFFH seenby 89C52 can be external code and data memory. Thus during in monitor modethat runs under PAULMON2, user may write hex code or download intel HEXfile to 62256. When jump from PAULMON2 to user program and run user program,this space is then be seen by 89C52 as a code space. Since P0 and P2 areused for connecting external RAM, left P1 and P3 for experimenting withreal world interfacing through input/output port. Nowadays there are manyperipheral chips that use serial protocol, say I2C, SPI. Thus only twoport is surely enough.

Figure 1: Circuit Diagram of C-52 EvaluationBoard

Constructing the Board

I have used a universal PCB for wiring the circuit. It took an hour, notso difficult. I have also asked my student using Protel to make PCB. Pleasewait the latest layout. I will put it here soon.

Here is the latest PCB file,c52evb.pcb(77,824 Bytes, open with Protel V2.73) and the picture shown below is acomponent placement layout. Be careful the polarity of electrolytic capacitorsand pin 1 of IC chips. A 20-pin socket is compatible with 2051/4051 I/Opins, useful for i/o pins emulation.


Figure 2: Component Placement Overlay
 
C-52 EVB Bill of Materials


Item     Reference     Value     Description       Remark
1          C1,C6         10uF/10V        electrolytic capacitor
2          C2,C3         30pF               ceramic capacitor
3          C4,C7         0.1uF              ceramic capacitor
4          C5              470uF/35V       electrolytic capacitor
5          R1              8.2k  resistor    ¼ Watts
6          R2              10k x8  R PACK 10kx8
7         U1               89C52  ATMEL Microcontroller
8         U2              74HCT373 Octal Latch   or 74HC573
9         U3               62256  32kB SRAM  or DS1235 NVRAM
10       U4              74HC00 Quad NAND gate
11       U5               DS275  RS232C Converter or  MAX232
12       U6               7805  +5V regulator
13       D1               DB102  small bridge diode
14       D2               LED  small dot LED
15       Y1              11.0592MHz Crystal
16       J1                Modular Connector  or DB9 connector
17       J2                DC Jack
18     PCB1            Printed Circuit Board (Universal PCB) or ready made PCB

Software

Since the external ram space is from 8000H-FFFFH, code spaceis from 0000H-1FFFH, my design uses on-chip code space, thus no longerneed external EPROM. Students need a chip writer, say Easy-DownloaderV2.0 for writing the hex file to the 89C52 chip.

PAULMON2document details how to use monitor command and useful information.
 

SOFTWARE UPDATING     18 August2542

Download Software

myPAULM2.hex is intel hex file of"myPAULM2.asm" and "myEXTRA.asm",modified version of PAULMON2 monitor program. The fancy editor was cutand the following functions were added;
 

1) return address to monitor by using 'JMP monitor'where monitor address was defined in myPAULM2.EQU and,

2) baud rate was fixed at 9600 8n1, this allows the useof C-52 EVB to be a dedicated controller by using Paul's concept of PROGRAMHEADER w/start-up method and a 32kB NVRAM. PAULMON2 Program Header describesfour types of user program. With hardware start-up type and fixed baudrate, user program will run when power up after some initialization.

3) I have put a subroutine that get integer number from terminal and return 16-bit integer in BA, i.e., B accumulator holds high byte, Afor low byte. Main program may use 'CALL getnum'. The absolute addressof getnum subroutine was defined in my latest myPAULM2.EQUfile.This subroutine will use in experimenting with assembly program.
 

ASM51.ZIP (157,660 bytes WinZip File) Assemblerand Terminal Emulation Program.
 

New feature:Displaying256 Bytes INTERNAL RAM for 52 core CPU.

The internal RAM for 52 core has 256 bytes. The address range between80H to FFH has the same logical address as the SFRs, however, we can accessthis range for RAM storage by using INDIRECT addressing. But for SFRs weuse DIRECT addressing instead.

Downloadnow: mypaulm3.hex   12October 2544
 

Testing the Board

Before putting all of the chips, plugs DC adapter, then check +5V supplyevery chips. If ok then pull the DC jack out then put all the chips tothe sockets. Now run terminal emulation program, press enter key, the promptwill show on screen. Type ? for help command, Figure 3 shows example ofdisassemble hex code via List command. Figure 4 shows downloading and runningdemo.hex, see return to monitor and printout of Accumulator & PSW.


Figure 3: Example of Disassemble Hex codevia List Command

Figure 4: Running demo.hex then return tomonitor

Figure 5: Running hello.hex ,the source file hello.c was compiled by C51 compiler.

C-52 EVB Links



 updated, 12 October 2544