li cang

read BKGD signal

Discussion created by li cang on May 27, 2010
Latest reply on May 31, 2010 by li cang

Hi,Sir.

     The following function want to read byte from target in BKGD line.

But I find that the signal waveform is wrong from target.Please see it in the attachment.

Please give me support about it.

 

 

void bdmInByte()
{
  asm{
    sei
    ldab #8
    ldx #0
  Next_In:
    bset BKGD_Direction,1 
    lslx
    bclr BKGD_Name,1 //pull-down the BKGD pin ,4 target clock

    bset BKGD_Name,1 //4 cycle,out1         ,   4 target clock

    bclr BKGD_Direction,1//to input ,4 cycles  , 4 target clock
   
    ldaa BKGD_Name                            

    beq In0
    incx
  In0:
    decb
    bne Next_In
    bclr BKGD_Direction,1
     tfr x,a
    staa g_InData;
    cli     
  }

}

Outcomes