+ Reply to Thread
Page 1 of 2
1 2 Last
Results 1 to 15 of 29

Thread: interface peripherals to 8086

  1. #1
    mdanh2002 Okay
    Join Date
    Sep 2006
    Location
    Singapore
    Posts
    91

    Default interface peripherals to 8086

    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.
    Attached Files


  2. #2
    kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent
    Join Date
    Jul 2006
    Location
    Victoria BC, Canada
    Posts
    3,681

    Default

    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.
    Inside every little problem, is a big problem trying to get out.

  3. #3
    mdanh2002 Okay
    Join Date
    Sep 2006
    Location
    Singapore
    Posts
    91

    Default

    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.

  4. #4
    ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent
    Join Date
    Jan 2007
    Location
    Hampshire. England.
    Posts
    10,853
    Blog Entries
    13

    Default

    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 by ericgibbs; 24th March 2007 at 02:16 PM.

  5. #5
    mdanh2002 Okay
    Join Date
    Sep 2006
    Location
    Singapore
    Posts
    91

    Default

    Quote Originally Posted by ericgibbs
    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 by mdanh2002; 24th March 2007 at 09:21 AM.

  6. #6
    ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent
    Join Date
    Jan 2007
    Location
    Hampshire. England.
    Posts
    10,853
    Blog Entries
    13

    Default

    hi,
    Check the 80188 datasheet for the maximum addressable locations.

    You say you want to add 256megabytes???

    Eric
    Last edited by ericgibbs; 24th March 2007 at 02:17 PM.

  7. #7
    mdanh2002 Okay
    Join Date
    Sep 2006
    Location
    Singapore
    Posts
    91

    Default

    Quote Originally Posted by ericgibbs
    hi,
    Check the 8086 datasheet for the maximum addressable locations.

    You say you want to add 256megabytes???

    Eric
    Hi, it's 256KBytes. Sorry for the typo.

  8. #8
    Hero999 Excellent Hero999 Excellent Hero999 Excellent Hero999 Excellent Hero999 Excellent Hero999 Excellent Hero999 Excellent Hero999 Excellent Hero999 Excellent Hero999 Excellent
    Join Date
    Apr 2006
    Location
    England
    Posts
    13,173

    Default

    This is just the sort of problem you run into when you blindly copy something without even making the slightest attempt at understand it.

    I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong.

    Please ask on the open forum if you have a question and I'll be happy to help,
    if I know the answer.

  9. #9
    ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent
    Join Date
    Jan 2007
    Location
    Hampshire. England.
    Posts
    10,853
    Blog Entries
    13

    Default

    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 by ericgibbs; 24th March 2007 at 01:02 PM.

  10. #10
    mdanh2002 Okay
    Join Date
    Sep 2006
    Location
    Singapore
    Posts
    91

    Default

    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?

  11. #11
    ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent
    Join Date
    Jan 2007
    Location
    Hampshire. England.
    Posts
    10,853
    Blog Entries
    13

    Default

    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
    Eric " Good enough is Perfect "
    I will NOT answer PM's requesting technical help, please use the Forum
    PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/

    Link to my Articles: http://www.electro-tech-online.com/a...icgibbs-55450/

  12. #12
    mdanh2002 Okay
    Join Date
    Sep 2006
    Location
    Singapore
    Posts
    91

    Default

    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.
    Attached Files
    Last edited by mdanh2002; 29th March 2007 at 05:21 AM.

  13. #13
    ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent
    Join Date
    Jan 2007
    Location
    Hampshire. England.
    Posts
    10,853
    Blog Entries
    13

    Default

    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 by ericgibbs; 29th March 2007 at 03:08 PM.
    Eric " Good enough is Perfect "
    I will NOT answer PM's requesting technical help, please use the Forum
    PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/

    Link to my Articles: http://www.electro-tech-online.com/a...icgibbs-55450/

  14. #14
    mdanh2002 Okay
    Join Date
    Sep 2006
    Location
    Singapore
    Posts
    91

    Default

    I am using the EEPROM for data storage. Is it possible to interface it as a peripheral device?

  15. #15
    ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent
    Join Date
    Jan 2007
    Location
    Hampshire. England.
    Posts
    10,853
    Blog Entries
    13

    Default

    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.
    Eric " Good enough is Perfect "
    I will NOT answer PM's requesting technical help, please use the Forum
    PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/

    Link to my Articles: http://www.electro-tech-online.com/a...icgibbs-55450/

+ Reply to Thread
Page 1 of 2
1 2 Last

Similar Threads

  1. pc I/O interface card
    By raus in forum Electronic Projects Design/Ideas/Reviews
    Replies: 4
    Latest: 30th May 2006, 09:53 PM
  2. how to interface a mechanical part with C#
    By parthi2929 in forum Robotics Chat
    Replies: 3
    Latest: 14th April 2006, 11:11 PM
  3. Interface for Analog to Digital input of 16f877 micro?
    By jessey in forum Electronic Projects Design/Ideas/Reviews
    Replies: 0
    Latest: 5th April 2004, 06:14 AM
  4. IR computer interface
    By bogdanfirst in forum General Electronics Chat
    Replies: 3
    Latest: 24th January 2004, 09:03 PM
  5. computer printer port interface
    By bogdanfirst in forum Electronic Projects Design/Ideas/Reviews
    Replies: 10
    Latest: 26th September 2003, 07:27 AM

Tags for this Thread