KS0108 Busy Flag (ASM)

Gast #186426
Lesenswert?

Goodday All.....

Does anybody understand the Busy Flag problem on a GLCD with KS0108
chipset?
I can't get it operating, only with a small delay it works, but I need
speed.
Here is my ASM (for AVR micros) BF routine.


pollBF:  cbi  PORTC, E      ;E lo
  clr  temp
  out  DDRD, temp      ;PORTD all inputs
  sbi  PORTC, RW      ;R/W hi (read mode)
  cbi  PORTC, DI      ;D/I lo (intruction mode)
  nop          ;tAS > 140 ns
  nop
loopBF:  sbi  PORTC, E      ;E hi
  nop          ;tDDR > max. 320 ns
  nop
  in  temp, PIND      ;read pins PORTD
  ldi  temp, 0b00000000    ;only bit7
  cbi  PORTC, E      ;E lo
  nop
  nop
  cpi  temp, 0x00      ;if BF = 1,
  brne  loopBF        ; -> loop
  ser  temp        ;else ->
  out  DDRD, temp      ; PORTD all outputs
  ret

I can't see an error in the code, can you?

Thanks.
Gast #186427
Lesenswert?

I think I can...

You load PIND into temp and then you overwrite temp with 0b00000000.
What will be in temp? Allways 0!
I guess it would be right to write:

  in  temp, PIND      ;read pins PORTD
  andi  temp, 0b10000000    ;only bit7

Uwe

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren