Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

interface peripherals to 8086

Status
Not open for further replies.

mdanh2002

Member
Hi

I am doing a school project on a talking multimeter with keypad using 80C188. The current design already has the 80C188 microcontroller board with UART, 82C55 programmable peripheral interface with sample bootstrap code and prorgram. I am supposed to make changes to the codes and develop my program. But currently I am having difficulties working with the 8255. Just have a few questions.

(1) From the diagram, how to determine the address of the components and how to initialise each of them? The sample code assumes address 0h for the UART but I wonder why? I try using 80h for 8255 and it doesn't work at all.

(2) How do you add 1 extra EEPROM to the current design?

The diagram is attached. Thanks in advance for help.
 

Attachments

  • Part 1 schematics.pdf
    91.6 KB · Views: 410
how to determine the address of the components and how to initialise each of them?
Look closely at the diagram. When PCS1 goes low, then the 82C55 is addressable via the two lower address lines. Read up on the commands to initialize and access the 8255...
How do you add 1 extra EEPROM to the current design?
Look at how the existing chips are interfaced and expand on that.
 
According to the 8088 datasheet

"The processor can generate chip selects for up to seven peripheral devices These chip selects are active for seven contiguous blocks of 128 bytes above
a programmable base address The base address may be located in either memory or IO space Seven CS lines called PCS0–6 are generated by the
processor. PCS5 and PCS6 can also be programmed to provide latched address bits A1 and A2. If so programmed they cannot be used as peripher-
al selects. These outputs can be connected directly to the A0 and A1 pins used for selecting internal registers of 8-bit peripheral chips"

So that means each peripheral will take 128d bytes (=80h) in the memory space. So since UART is at PCS0, it will be at address 0. So 82C55 is at PCS1 and should be at address 128d=80h. I tried the following but it doesn't work at all

MOV AL, 10001001B ;port A, B for output, B for input
MOV DX, 86h ;since 82C55 is at 80h so config word is at 86h
OUT DX, AL
MOV AL, FFh ;output high on all pins of port A
MOV DX, 80h ;port A address
OUT DX, AL

After trying the code, there seems to be no effects on the 8255. All pins of port A are still 0.
 
hi,

MOV AL, 10001001B ;port A, B for output, B for input
MOV DX, 86h ;since 82C55 is at 80h so config word is at 86h
OUT DX, AL
MOV AL, FFh ;output high on all pins of port A
MOV DX, 80h ;port A address
OUT DX, AL


Why do you think the config address for the PIO is at 0x86 ?
If the base address is 0x80, when A1,A0 are either 0's or 1's

Eric
 
Last edited:
ericgibbs said:
hi,
Why do think the config address for the PIO is at 0x86 ?
If the base address is 0x80, when A1,A0 are either 0's or 1's

thanks for reminding me. I blindly followed some design on the Internet where PORTA is at 8000H, PORTB at 8002H, PORTC 8004H and config word at 8006H. So I assumed that config word is 6 bytes further from the base address. I did not know that it depends on A0 and A1.

I changed it to 83h and it works!

But I still wonder how you can add 1 more EEPROM, 27C2001 256MBytes x 8 bit, to the initial design? Any more details?
 
Last edited:
hi,
Check the 80188 datasheet for the maximum addressable locations.

You say you want to add 256megabytes???

Eric
 
Last edited:
This is just the sort of problem you run into when you blindly copy something without even making the slightest attempt at understand it.
 
Hi,

As you can see from your diagram, the lower 32K is RAM and the upper 32K is ROM, using addresses A0 thru A14 and LCS and UCS.

An idea would be to remove the existing ROM completely and replace it with the 27C2001,
use addresses A15 thru A17 and the UCS line. ie: allocate it as upper ROM

I assume you want to run programs written in standard 8086 commands structure, ie Segmenting etc.

Download a diagram for an earlier PC using an 8086, say an Amstrad 640K and look at the decoding required.

Eric
This info here: www.1000bit.net amstrad 640 circuits
 
Last edited:
Hi

Thanks for the suggestion. But my circuit is pre-manufactured and distributed to student so I am unable to remove the ROM totally and replace with an EEPROM. I am supposed to make extra connections (on another board using wire wrapping) to the circuit using jumpers J1..J5. So I guess I have to interface the EEPROM to the MCS (Memory Chip Select) lines and play around with the address lines ADx, which is pretty confusing.

In the current implementation, the 80C188 board will be connected to the computer via serial port. It will boot up automatically using the bootstrap code already burned in the ROM. After that, the 'program' (written and compiled in assembly language) will be transferred to its RAM via a terminal emulation tool, such as Hyper Terminal and run from there.

I have been playing around with the 'program' and currently it works with the 8255. But when it comes to the extra EEPROM, it seems as if the 80C188 doesn't see the EEPROM at all. Not sure if my codes or the connections are wrong. Wonder what is the rule to interface extra EEPROM?
 
hi
As its 'fixed' pcb layout and you have to interface to an external pcb, look at J4/5.

The address lines on J4 and the MCS0/3 lines on J5.

The datasheet will give you and idea regarding the mid range chip selects [MCSx]

Eric
 
Hi Eric

Sorry for this late follow up and thanks for your help.

I tried your suggestion of using MCS0/3 lines on J5 and it totally doesn't work. Not only that, it seems that the processor hangs while booting up. I am afraid that this approach has tampered with the current ROM where the bootloader is stored.

Wonder if it is possible to interface the EEPROM through the peripheral range, i.e. using PCSx? I have successfully interfaced another 82c55 to the board using PCS2 (as PCS0 is used for UART and PCS1 for the original 82c55), with all connections the same as the original 82c55 except for the chip select (CS) line.

If it's possible, then can I just copy all the connections from the original ROM and change the original E\ (enable) lines to connect to PCSx (instead of UCS)? Are there any other changes that need to be made?

I am using 27C2001 2Mbit (256KByte) EEPROM with datasheet attached.
 

Attachments

  • 27C2001 2 Mbit Eprom.pdf
    114.7 KB · Views: 262
Last edited:
hi,
Are you using the EEPROM for data storage or program instructions.

If data storage, I have used NRAM and EERAM as a peripheral device.

EDIT: Yes
 
Last edited:
hi,
Yes, you can address external EEPROM as a peripheral as you are using it for data storage.
Access maybe a little slower than memory mapping, but it should not be serious problem.

Use the next 'free' PCS select pin for the EEPROM, you can also use two other select pins to control the Vpp program voltage.
 
hi

i am trying it now. EEPROM 27C2001 (256Kbyte x 8bit) is connected to PCS3 with address 180h. However, the value read from it seems to be always FFh. There is 1 issue here, as the 80C188 only allocates 128 bytes of memory space for each peripheral (According to datasheet), I wonder how we can interface EEPROM of 256K as peripheral?
 
hi,
Do you have a drawing showing how its connected to the various bus lines?

If you havn't done a 'write' to the EEProm, most likely you will get FF's when you read it.
 
Hi

I don't have a drawing but the current connections is summarised as below. Refer to the original diagram I posted and the 27C2001 datasheet, the connections are:

27C2001 - 8088

VPP (pin 1) - GND
VSS (pin 16) - GND
VCC (pin 32) - 5V
P (pin 32) - 5V
G (pin 24) - RD of 8088
E (pin 22) - PSC3 of 8088
Q0..Q7 (data output) - AD0..AD7 on J4 (from 8088 bus)
A0..A7 - A0..A7 outputs from 74HC573, address lines (after demultiplexed)
A8..A17 - AD8..AD17 on J4 (from 8088 bus)

When doing a read from address 180h (for PSC3), result is always FFh. I have tried 181h, 182h, ... but it's still FFh. I have already written data into the EEPROM using the EEPROM programmer at my lab. However, there is something to prove that my code is working: if I remove the EEPROM VCC supply, the data read is 00h. :) Anything wrong with the connections?

If we succeed to interface the EEPROM as peripheral this way, how are we going to read the 256KBytes of data in the EEPROM, as 8088 only allocates 128bytes for each peripheral?
 
mdanh2002 said:
If we succeed to interface the EEPROM as peripheral this way, how are we going to read the 256KBytes of data in the EEPROM, as 8088 only allocates 128bytes for each peripheral?

You're not going to be able to, but why would you want to anyway? - it's not a peripheral, it's system memory.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top