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.
Nigel Goodwin said:
You're not going to be able to, but why would you want to anyway? - it's not a peripheral, it's system memory.

I am trying what Eric suggested, since he said it's possible. :) I am also trying to interface it as memory using MCS lines, but initialisation seems more complicated and that's why I wonder if it's possible to interface as peripheral.
 
I'm not familiar with the processor, but does the spec actually mean there are specific full address pages you can access as peripherals? - I suspect not?. As memory it should be dead simple to connect, just like your RAM and ROM, just allocate it address space - presumably you're only wanting to use it as ROM?.
 
I am now trying to interface the EEPROM as memory instead of peripheral. I interfaced it using MCS0 as chip select signal (connect to Enable pin of EEPROM). Other connections are the same. I set base address of 81FFFh and block size to be 256K following the 80188 datasheet. I read the EEPROM data by using

MOV CX, 8200h
MOV ES, CX
MOV BX, 0h
MOV AL, ES:[BX]

this will read value of position 0h (indicated by BX) in the EEPROM (located at memory segment 8200h, as each segment is 16 bytes). However, many of the values read out are FFh, though some of them may have other values. In the latter case of other values, they seem to be continuos values, i.e. 41h 42h 43h 44h 45h .... I monitor the processor's RD signal and MSC0 and it looks as if my codes have addressed the EEPROM correctly (RD and MSC0 goes low upon EEPROM being read and high otherwise). However, the values read out seems to be wrong. I wonder if my codes are correct and what other factors such as circuit connection may affect the values read?
 
Hi,
Quote:
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.

What have you now done thats different from my suggestion, to get it to work?

Can you post more code than the last fragment?.

When I said you could access the EEPROM as a peripheral.
It was the intention to use additional address and page latches with decoding, this is the method I have used in the past.
I did say, its a little slower to access.
 
Last edited:
My 80xx work is far far in the past but doesn't the reset IP point to some where at the top of the 1MB address space? The reason the board works is that the top 4 address lines don't point anywhere so the addresses are all mod 64K I think you will have to make sure your memory mapped peripheral doesn't respond to that address at boot up time (I'd have a latch that you have to throw to enable the memory). Also, there are some timing considerations that need to be addressed but I have, mercifully, forgotten all that stuff.

a logic analyzer would be a great use here.

edit: maybe there is an ICE188 lying around somewhere at your school... could be a big help in debugging the HW...
 
Last edited:
Hi

ericgibbs said:
What have you now done thats different from my suggestion, to get it to work?

Your suggestion of using the MCS0/3 lines was correct. The reason why the processor hanged was because I confused the address/data lines when interfacing the EEPROM as memory. When I reverted back to this approach, the EEPROM more or less seems to be working (see below).

ericgibbs said:
Can you post more code than the last fragment?

This is the code for EEPROM initialisation:
Code:
;configure EEPROM

;starting address 8000h (A19=1, A18..A13=0, refer to MCS control register in datasheet)

;32-bit port, output in 2 separate writes.
MOV     AX, 1000000000000100B
MOV     DX, 0FFA6H                   ;address of MCS control register
OUT     DX, AL

MOV     AL, AH
MOV     DX, 0FFA7H
OUT     DX, AL

;block size = 256KB accessible in 4 active ranges, each of 64KB.
MOV     AX, 0010000000000100B
MOV     DX, 0FFA8H                   ;address of MPCS control register
OUT     DX, AL

MOV     AL, AH
MOV     DX, 0FFA9H
OUT     DX, AL

This is the code to read data from the EEPROM
Code:
;test read from EEPROM
MOV BX, 0                        ;offset
readeprom:
  MOV DX, 08000h               ;base address
  MOV ES, DX
  MOV AL, ES:[BX]               ;physical address of EEPROM = ES*10 + BX
  CALL FAR PTR PRINT_2HEX  ;procedure to print the value read
  INC BX
  CMP BX, 0FFFFh
  JE finished
  loop readeprom

finished:
  ............................

This code access the first 64KB segment of the EEPROM. It was found out that all the values read were FFh. By changing the base address (in ES) to 09000h, 0A000h, 0B00h I could access the other three 64KB segments of the EEPROM and all the values read are FFh. This means that the entire 256KB EEPROM is empty. However, if I disconnect the EEPROM VCC suply, than values read are no longer 0FFh, proving that the code is more or less correct.

I am pretty sure I have programmed the EEPROM using the programmer at school. Is is possible that the data may be erased when I connect the EEPROM?

ericgibbs said:
When I said you could access the EEPROM as a peripheral.
It was the intention to use additional address and page latches with decoding, this is the method I have used in the past.
I did say, its a little slower to access.

Oh, now I get what you meant by 'interfacing as peripheral'. I was assuming that you can interface it directly to the data bus without any additional latches/decoding.
 
hi,
Sorry in getting back to you late, but I was finishing a project.

Quote:
This code access the first 64KB segment of the EEPROM. It was found out that all the values read were FFh. By changing the base address (in ES) to 09000h, 0A000h, 0B00h I could access the other three 64KB segments of the EEPROM and all the values read are FFh. This means that the entire 256KB EEPROM is empty. However, if I disconnect the EEPROM VCC suply, than values read are no longer 0FFh, proving that the code is more or less correct.

I am pretty sure I have programmed the EEPROM using the programmer at school. Is is possible that the data may be erased when I connect the EEPROM?


You say you programmed this at school, did you use a 12.75Vpgm voltage and then Verify the data that you programmed?.

The fact that the values are not FF when you have no Vcc, means nothing, if the 27C2001 is still connected to the cpu bus line, the data could be anything. Its a bad idea to have a ic connected to bus lines without its supply.

Why dont you write a short prog that writes data to the EEProm and reads it back??
Remember the 27C2001 requires a Vpgm of +12.75V,

Where are the /P, /E, /G and Vpp, Vcc connected to when the 27C2001 is wired to the main cpu board.?
 
Hi

Thanks for the reply. I got it working. The problem was that, I selected the wrong chip type when using the EEPROM programmer to write data (the programmer reported verify error but I did not notice) to the chip. When I burned the data to the EEPROM again and selected the appropriate EEPROM type, 27C2001, everything worked fine.

Thanks all for help!
 
hi

do u have assemble program for it, i'm thinking to use ur circuit to use as my school assignment. could you help
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top