monitor progi - pic
Miko Imre
imre.miko at siemens.com
Thu Aug 7 10:28:05 CEST 2003
Hello,
Imre Torok wrote:
> Ki tudna valaki segiteni olyan kis progival pic-re, amely a pic egyik
> laban sorosan kuld kifele egy meghatarozott bajtot, amit a norton
> terminallal tudnek monitorozni?
> 12c509-re lesz felhasznalva, igy nem jo a megszakitaskezelos, vagy az,
> amelyik soros portra epul.
Itt egy moricka program 12c50x-re. 4MHz-re, es szintilleszto
nelkul, azaz MAX232-nelkul, mert az invertalja a jelet. Ha
azt is akarsz, akkor a megfelelo pontokon (*-al jelzett)
a bcf, bsf felcserelendo.
A terminalprogit 9600 baud, 8 bit, 1 stop, 0 parity-re allitsd.
; -----------------------------------------------------------------
; Trancive Byte (byte ->W)
; -----------------------------------------------------------------
SendByte clrwdt
movwf SendBuffer
movlw 0x8 ; 8 bit
movwf BitNumber ; ciklus változó
bsf GPIO,serial_out
loop1 movlw 0x1F ; \
movwf DelayTime ; \ Delay
delay1 decfsz DelayTime ; /
goto delay1 ; /
bcf STATUS,C ; 0 -> CARRY
rrf SendBuffer
btfsc STATUS,C
bcf GPIO,serial_out ; (*) clear
btfss STATUS,C
bsf GPIO,serial_out ; (*) vagy set RTS
nop
decfsz BitNumber ; amig mind a 8 bitet at nem vitte
goto loop1
movlw 0x1F ; delay
movwf DelayTime
delay2 decfsz DelayTime
goto delay2
bcf GPIO,serial_out
movwf DelayTime ; delay
delay3 decfsz DelayTime
goto delay3
movwf DelayTime ; delay
delay4 decfsz DelayTime
goto delay4
retlw 0x0
Udv
Imre
More information about the Elektro
mailing list