ASM programming of 80C188

Discussion in 'Programmer's Corner' started by ecjohnny, Feb 29, 2012.

  1. ecjohnny

    Thread Starter Senior Member

    Jul 16, 2005
    142
    0
    http://desmond.imageshack.us/Himg217/scaled.php?server=217&filename=asmhelp.jpg&res=medium

    Can anyone help me with ASM programming of 80C188?

    I am not sure how i can program this 80C188 chip to "communicate" with 8255A. A part of the schematic is shown in the link above.
    But anyway, i just started learn ASM language but i am confuse on how to program the chip.
    How can i turn a particular pin eg.PCS1 to high/low(80C188). From what i have learnt and understand, i need to first find register controlling that pin then load address + offset of that pin?
    (asm program idea)
    LEA ax,___H ;some address which set PCS1 = high?
    OUT ax ; output it

    Maybe someone can give me an example or guide on this. A maybe a sample code of coding 80C188.

    Thanks
     
  2. nigelwright7557

    Senior Member

    May 10, 2008
    487
    71
    You need to find the datasheet for the 8255.
    It explains what each address does.
    There are data regsiters and control registers.
    The control registers set the ports up to in or out.
    You then send data to teh data registers to control what is on each port.
     
  3. ecjohnny

    Thread Starter Senior Member

    Jul 16, 2005
    142
    0
    START:

    ; Initialize MPCS to MAP peripheral to IO address
    MOV DX, MPCS ;0FFA0H
    MOV AX, 0083H
    OUT DX, AX

    ; PCSBA
    MOV DX, PCSBA ;0FFA4H
    MOV AX, 0003H
    OUT DX, AX

    ; Initialize LMCS
    MOV DX, LMCR ;0FFA8H
    MOV AX, 01C4H
    OUT DX, AX

    After this, can anyone help me out from the below code,what have i gone wrong?
    I am trying to activate PCS1(80C188) which activate my 8255A Chip Select. then send a data to configure mode 0 of 8255A to basic i/o then i need to OUT my data to PA which connect to my led. For some reason it doesnt work. Any help pls

    mov dx,PCSBA
    mov ax,128 // it say PBA +128 will activate PCS1 in datasheet?
    out dx,ax

    mov dx,PCSBA
    mov ax,1000 0000b // configure 8255 to mode 0;control word as in
    datasheet?
    out dx,ax

    mov dx,PCSBA
    mov ax,MYDATA
    out dx,ax


    Thanks advance!
     
  4. ecjohnny

    Thread Starter Senior Member

    Jul 16, 2005
    142
    0
    ok i think i got it after some in-dept of studying but i am confuse of this :

    mov dx,____
    mov ax,80H / set to mode 0 all ports as output
    out dx,ax
    .
    etc...

    what is my ____? some book mention the address is 8003H. port A = 8000H B = 8001 etc.. Then some example show 0FF--H. etc..
    Is that _____ my PCSBA 0FFA4H +3 ??? In theory i know it i the Control Register Address of 8055 but i cant find it in datasheet.

    Can someone help me on this?
     
Loading...