Re: pic18F452使用8255扩展pin 的问题?
|
||||
---|---|---|---|---|
資深會員
|
對阿
我本來就沒什麼沒禮貌 不過看來你果然也是沒禮貌的 哈哈哈~
發表於: 2005/8/24 17:12
|
|||
|
Re: pic18F452使用8255扩展pin 的问题?
|
||||
---|---|---|---|---|
資深會員
|
還大蝦勒
沒禮貌.... 不鳥你
發表於: 2005/8/19 9:52
|
|||
|
pic18F452使用8255扩展pin 的问题?
|
||||
---|---|---|---|---|
新會員
|
我的程序需要很多pin, 所以,用8255来扩展, 但是只有
input 没有output, 不懂是什么原因, 请大虾帮忙看看我的部分程序, 给我一些指点. bcf CS ;chip select = 0 ;;Reset 8255 ;;NOTE : Active high for 8255 Reset bsf RESET_8255 ;RESET = 1,clr the control register n all ports (A,B,C) call DELAYL bcf RESET_8255 ;power on ;reset the 8255 using the RESET pin ;set the write pin (WR) high ;put the control word on the data bus (selects the Mode) ;set A0 and A1 pins high ;set the write pin (WR) low for a very short duration, keeping A0 & A1 high ;set the write pin (WR) high again bsf _WR movlw 0x00 movwf TRISD movlw b'10000000' ;MODE:MODE SEL:PORTA:PORTC(UPPER):MODE SEL:PORTB:PORTC(LOWER) movwf PORTD ;data from portD of PIC nop bsf A0 ;Control Word -> data bus , A0 =1 bsf A1 ;Control Word -> data bus , A1 =1 bcf _WR nop nop bsf _WR ;output movlw 0x00 movwf TRISD movlw 0xff movwf PORTD ;OUTPUT OPERATION to 8255, portA (WRITE) ;Data bus --> portA bcf A1 ; A1 A0 _RD _WR bcf A0 ; 0 0 1 0 nop bsf _RD bcf _WR NOP nop bsf _WR 在线等待,,,,,~~~~~~~ 谢谢
發表於: 2005/8/18 17:06
|
|||
|