HELPFUL EXAMPLES & BATCH FILES

Sample 'C' code with in line assembly

#include <stdio.h> /* Standard C Functions */
#include <dos.h> /* DOS-related Functions */
#include <string.h> /* String-related Functions */
main()
{
    pokeb(0x1000,0x0000,0xaa);
    pokeb(0x1000,0x0001,0x55);
    asm xor bx,bx
    asm mov ax,1000h
    asm mov ds,ax
    asm mov [bx],0aah
    asm mov [bx+1],055h
}

Batch file to compile 'C' code.....The last part programs your code into the EconRomII emulators

del c:\locate\sieve.* //delete previous files
del c:\locate\*.bin
del c:\locate\makefile
del c:\tc\include\%1.h
copy %1.h c:\tc\include //used to copy user defined header to include directory
copy %1.c c:\locate\sieve.c //copies your 'C' file to locate directory
copy c:\test\sieve.cfg c:\locate\sieve.cfg //copies your .cfg, .lnk, & makefile to locate
copy c:\test\sieve.lnk c:\locate\sieve.lnk
copy c:\test\makefile c:\locate\makefile
cd\locate
pause
make //calls your makefile: creates ROMable code
pause
copy c:\locate\sieve.bin c:\test\%1.bin //copies bin file back to your directory, renames it to your file
cd\test

//The following will load emulators with your .bin file.

rem PAUSE
rem CD ER2
rem erase *.bin
rem COPY C:\test\%1.BIN C:\test\ER2
rem er2ld %1.bin /p3bc /w:16 /d0
rem CD..

*****************************************************************************************

 

BOARD LAYOUT & STORAGE HINTS

Board_Layout1.JPG
Board_Layout2.JPG
Storage.JPG

 

*****************************************************************************************

 

DESIGN HINTS

Schematics

Do not place too much on any one page of your schematics. Break schematics up into logical sections. Example: Microprocessor and clock chip, Decode logic (x373's and GAL's), Memory, Ports, Keypad/LCD, etc. One page for each.

Verify PWR and GND on Each Chip

Physically verify PWR and GND on each chip before placing chip in socket. This may seem obvious, but I've seen students troubleshoot problems for days just to find out they were missing PWR or GND. You may also have PWR and GND reversed.

Buffer control lines

While working on your project, you may find it helpful to consolidate GAL equations and other signals. I suggest that any (control) signal that goes to more than one pin on your project go through a buffer (74xx244) first. Refer to the following.
Design.JPG

Unused Input Pins

Just because you aren't directly using a pin, doesn't mean you don't have to do anything with it. ALWAYS tie unused inputs high or low. You need to figure out if it needs to be tied active or inactive to make the chip work correctly. A good example is pin18 of the 8086 (INTR). In the beginning of your project interrupts are not being used. You must tie this inactive or it can cause intermittent problems impossible to troubleshoot. (HLDA, HOLD, NMI, TEST, & MN on the 8086)

I don't care if it is the 1G & 2G pins on the 74xx244, VPP on the EPROMS, CTS & RTS on the UART, or DRQx pins on the DMA, you must tie them active or inactive.

High outputs of GAL's

The Programmable Logic Devices (PLD) or GAL's that you will be using provide more source current in the low state. I suggest programming all signals with a low output. If you need a high signal, put it through an inverter. This can prevent possible problems with your project and definitely with Dr. Sharif. (Hint he likes to see low outputs)

Programming

If 'C' is still being used for this course, invest in a good 'C' programming book.

You will spend a lot of time programming, make sure you comment everything.

When declaring variables for in 'C', use "unsigned char" for memory bytes being manipulated and "unsigned int" for 16 bit addresses. I can't explain why, but it works.

 

*****************************************************************************************