Compare commits

...

10 Commits

Author SHA1 Message Date
David Gálvez
a4eaf871e8 Make tag for last stable PIC asm code 2016-02-14 18:13:42 +00:00
Vincent Rivière
cf20b7d05f Copied the linker script into the project. 2012-03-08 22:31:36 +00:00
Vincent Rivière
44ad502df6 Removed the temporary .mcs file. 2012-03-08 22:21:35 +00:00
Vincent Rivière
fbabb1f2d0 Updated the ignore list. 2012-03-08 22:08:30 +00:00
Vincent Rivière
da9ae54a45 Use the Configuration Bits window. 2012-03-08 21:58:52 +00:00
Vincent Rivière
c7f8b4bd7f Clean-up the workspace. 2012-03-08 21:39:21 +00:00
Vincent Rivière
8cd3212e48 Upgraded to Fredi's sources from 2012/01/15. 2012-03-08 21:16:57 +00:00
Vincent Rivière
788a4d1174 Removed unused PS/2 files. 2012-03-08 20:58:58 +00:00
Vincent Rivière
08e80f2d47 Removed intermediate files. 2012-03-08 20:49:55 +00:00
David Gálvez
22aacf8358 Moved source_fa into trunk 2011-01-03 08:10:50 +00:00
17 changed files with 361 additions and 3338 deletions

View File

@@ -1,19 +0,0 @@
# MPLAB IDE generated this makefile for use with GNU make.
# Project: firebee1.mcp
# Date: Sun Oct 04 21:22:09 2009
AS = mpasmwin.exe
CC = mcc18.exe
LD = mplink.exe
AR = mplib.exe
RM = rm
firebee1.cof : firebee1.o
$(LD) "..\MPASM Suite\LKR\18f4520i.lkr" "firebee1.o" /z__MPLAB_BUILD=1 /o"firebee1.cof" /M"firebee1.map" /W
firebee1.o : firebee1.asm ../../../Programme/Microchip/MPASM\ Suite/P18f4520.inc
"C:\Programme\Microchip\MPASM Suite\MPASMWIN.exe" /q /p18F4520 "firebee1.asm" /l"firebee1.lst" /e"firebee1.err" /o"firebee1.o"
clean :
$(RM) "firebee1.o" "firebee1.ERR" "firebee1.lst" "firebee1.cof" "firebee1.hex"

View File

@@ -1,19 +0,0 @@
# MPLAB IDE generated this makefile for use with Microsoft `nmake'.
# Project: firebee1.mcp
# Date: Sun Oct 04 21:22:09 2009
AS = mpasmwin.exe
CC = mcc18.exe
LD = mplink.exe
AR = mplib.exe
RM = del
"firebee1.cof" : "firebee1.o"
$(LD) "..\MPASM Suite\LKR\18f4520i.lkr" "firebee1.o" /z__MPLAB_BUILD=1 /o"firebee1.cof" /M"firebee1.map" /W
"firebee1.o" : "firebee1.asm" "..\..\..\Programme\Microchip\MPASM Suite\P18f4520.inc"
"C:\Programme\Microchip\MPASM Suite\MPASMWIN.exe" /q /p18F4520 "firebee1.asm" /l"firebee1.lst" /e"firebee1.err" /o"firebee1.o"
"clean" :
$(RM) "firebee1.o" "firebee1.ERR" "firebee1.lst" "firebee1.cof" "firebee1.hex"

View File

@@ -1,619 +0,0 @@
;*****************************************************************************
; PS2Atari_v1_4.asm *
; PS2 PC mouse to Atari / Amiga mouse converter by Tom Kirk March 2010 *
; Version 1.3 *
;*****************************************************************************
; *
; Enables a PS2 PC mouse to be used with Atari / Amiga computers using *
; the circuit in circuit.bmp with a PIC16F84(A)/C84 micrcontroller. *
; *
; Assembled using Microchip MPLAB and MPASM. *
; Disable case sensitivity under build options. *
; *
;*****************************************************************************
; Version 1.4 July 2010 *
; Unused Pin RA4 now correctly set as an imput. *
; (Pin is tied to +5V on PCB for easier PCB routing.) *
; My oversight when transfering from prototype to PCB. *
; Thanks to Luciano for informing me. *
; *
; Version 1.3 March 2010 *
; Corrected a bug in button routine preventing both buttons being active *
; together under certain conditions. *
; Thanks to Oliver Fleischmann for informing me. *
; (Can't believe it taken 6 Years for this bug to show itself!!) *
; *
; Version 1.2 June 07 *
; Changed left/right button outputs to fake open collector. *
; Needed to stop conflits when using a joystick pluged into other port. *
; *
; Version 1.1 August 04 *
; Added support for Amiga. *
; *
;*****************************************************************************
; list directive to define processor
list p=16F84A
; processor specific variable definitions
#include <p16F84A.inc>
; define config bits
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC
;4 MHz Clock
;************************ Input output usage ********************
; RA0 Atari / Amiga select i/p
; RA1 PS2 mouse data
; RA2 PS2 mouse clock
; RA3 Not used
; RA4 Not used
; RB0 Atari XA / Amiga XA o/p
; RB1 Atari XB / Amiga YB o/p
; RB2 Atari YA / Amiga YA o/p
; RB3 Atari YB / Amiga XB o/p
; RB4 Left button o/p
; RB5 Right button o/p
; RB6 Not used
; RB7 Not used
;*******************************************************************
;********** I/O port equates **************
ps2data equ 1 ;ps2 mouse data signal
ps2clk equ 2 ;ps2 mouse clock signal
;********** User register equates *********
temp equ 0ch ;Temporary storage
byte1 equ 0dh ;Byte 1 store
byte2 equ 0eh ;Byte 2 store
byte3 equ 0fh ;Byte 3 store
xinc equ 010h ;last x increment read
yinc equ 011h ;last y increment read
xlow equ 012h ;low byte of 16 bit x counter
xhigh equ 013h ;high byte of 16 bit x counter
ylow equ 014h ;low byte of 16 bit y counter
yhigh equ 015h ;high byte of 16 bit y counter
xpat equ 016h ;x pattern position
ypat equ 017h ;y pattern position
bcnt equ 018h ;bit counter
brec equ 019h ;byte received
timer equ 01ah ;timer counter
parity equ 01bh ;parity store
flag equ 01ch ;flag bits (bit 0 = ack error flag)
; (bit 1 = parity error flag)
; (bit 2 = middle button pressed flag)
; (bit 3 = middle state flag)
; (bit 4 = left button flag)
;*****************************************************************************************
;***** initialise program *******
reset clrwdt
bcf status,rp0 ;set page0
clrf intcon ;disable interupts
bsf status,rp0
movlw 084h ;set tmr0 to int clk,prescale/32
movwf option_reg
bcf status,rp0
clrf porta ;all porta outputs will be low when enabled
movlw 0h ;set mouse buttons and x y start levels
movwf portb
bsf status,rp0
movlw 017h ;set porta bit 3 as an unused output
movwf trisa
movlw 030h ;set portb bit 4 and 5 as inputs (left/right button o/ps open collector)
movwf trisb
bcf status,rp0
clrf byte1 ;set start up values
clrf byte2
clrf byte3
clrf xinc
clrf yinc
clrf xlow
clrf xhigh
clrf ylow
clrf yhigh
clrf xpat
clrf ypat
clrf flag
;***************** set up ps2 mouse *********************
start call ps2read ;read power up self test report
btfsc flag,1 ;parity error?
goto restart ;yes so jump
movlw 0aah ;correct ?
subwf brec,w
btfss status,z
goto restart ;no so jump
call ps2read ;read power up pc mouse id
btfsc flag,1 ;parity error?
goto restart ;yes so jump
movlw 0h ;correct ?
subwf brec,w
btfss status,z
goto restart ;no so jump
restart movlw 0ffh ;send reset pc mouse command
call ps2wri
btfsc flag,0 ;ack bit?
goto restart ;no so jump
call ps2read ;ack returned
btfsc flag,1 ;parity error?
goto restart ;yes so jump
movlw 0fah ;correct ?
subwf brec,w
btfss status,z
goto restart ;no so jump
call ps2read ;read self test report
btfsc flag,1 ;parity error?
goto restart ;yes so jump
movlw 0aah ;correct ?
subwf brec,w
btfss status,z
goto restart ;no so jump
call ps2read ;read pc mouse id
btfsc flag,1 ;parity error?
goto restart ;yes so jump
movlw 0h ;correct ?
subwf brec,w
btfss status,z
goto restart ;no so jump
movlw 0f4h ;send enable reporting command
call ps2wri
btfsc flag,0 ;ack bit?
goto restart ;no so jump
call ps2read ;ack returned
btfsc flag,1 ;parity error?
goto restart ;yes so jump
movlw 0fah ;correct ?
subwf brec,w
btfss status,z
goto restart
movlw 0f3h ;send set sample rate command
call ps2wri
btfsc flag,0 ;ack bit?
goto restart ;no so jump
call ps2read ;ack returned
btfsc flag,1 ;parity error?
goto restart ;yes so jump
movlw 0fah ;correct ?
subwf brec,w
btfss status,z
goto restart
movlw 028h ;send sample rate (40)
call ps2wri
btfsc flag,0 ;ack bit?
goto restart ;no so jump
call ps2read ;ack returned
btfsc flag,1 ;parity error?
goto restart ;yes so jump
movlw 0fah ;correct ?
subwf brec,w
btfss status,z
goto restart
;******************* Main program loop ****************************
main call ps2read ;read 3 byte pc mouse packet
btfsc flag,1 ;parity error?
goto restart ;yes so jump
movf brec,w
movwf byte1
call ps2read
btfsc flag,1 ;parity error?
goto restart ;yes so jump
movf brec,w
movwf byte2
call ps2read
btfsc flag,1 ;parity error?
goto restart ;yes so jump
movf brec,w
movwf byte3
;adjust the 16 bit x counter
clrf temp ;use temp as high byte
btfsc byte1,4 ;extend sign bit into high byte
decf temp,f
movf byte2,w ;add low bytes
addwf xlow,f
btfsc status,c ;add carry to high
incf xhigh,f
movf temp,w ;add high bytes
addwf xhigh,f
;adjust the 16 bit y counter
clrf temp ;use temp as high byte
btfsc byte1,5 ;extend sign bit into high byte
decf temp,f
movf byte3,w ;add low bytes
addwf ylow,f
btfsc status,c ;add carry to high
incf yhigh,f
movf temp,w ;add high bytes
addwf yhigh,f
;left button
btfss byte1,0 ;is the left pc mouse button pressed
goto lbutt ;no so jump
bsf flag,4 ;set left button flag
goto nbutt
lbutt bcf flag,4 ;reset left button flag
;right button
nbutt btfss byte1,1 ;is the right pc mouse button pressed
goto rbutt ;no so jump
bcf portb,5 ;set right button as pressed
bsf status,rp0 ;by setting pin as a low output
bcf trisb,5
bcf status,rp0
goto mbut
rbutt bsf status,rp0 ;set right button as not pressed
bsf trisb,5 ;by setting pin as an input
bcf status,rp0
;middle button
mbut btfss byte1,2 ;check if middle button pressed
goto mbutt ;jump if not
btfsc flag,2 ;check middle button pressed flag
goto mbex ;set so jump
movlw 08h ;toggle middle state flag
xorwf flag,f
bsf flag,2 ;set middle button pressed flag
goto mbex
mbutt btfss flag,2
goto mbex
bcf flag,2 ;reset middle button pressed flag
mbex
btfsc flag,3 ;check middle state flag
goto setlb ;jump if set
btfsc flag,4 ;check left button flag
goto setlb ;jump if set
bsf status,rp0 ;no flags set so set left buuton not pressed
bsf trisb,4 ;by setting pin as an input
bcf status,rp0
goto main
setlb bcf portb,4 ;set left button pressed
bsf status,rp0 ;by setting pin as a low output
bcf trisb,4
bcf status,rp0
goto main
;***************************** Subs *****************************************
;***** Read a byte from the ps2 mouse ******
ps2read btfss porta,ps2data ;data low ?
goto ps2r1 ;yes so start reading data
call trans ;no so do emulated mouse move
clrf tmr0 ;clear rtcc before delay
oned btfss porta,ps2data ;data low ?
goto ps2r1 ;yes so start reading data
movlw 0dh ;delay between emulated mouse moves
subwf tmr0,w
btfss status,z
goto oned ;not done so jump
goto ps2read ;check again
ps2r1 call wlow ;wait until clock goes low for start bit
call whigh ;wait until clock is high
movlw 08h ;read 8 data bits
movwf bcnt
clrf parity ;clear parity counter
ps2r2 call wlow ;wait until clock is low
bcf status,c ;clear carry flag
btfss porta,ps2data ;data bit set ?
goto ps2r3 ;no so jump
incf parity,f ;yes so inc the parity counter
bsf status,c ;set carry bit
ps2r3 rrf brec,f ;shift carry into destination
call whigh ;wait until clock is high
decfsz bcnt,f ;finished the 8 bits?
goto ps2r2 ;no so do again
call wlow ;for the parity bit
btfsc porta,ps2data ;parity bit set?
incf parity,f ;yes so inc the parity counter
bcf flag,1 ;clear flag (no error)
btfss parity,0 ;check calculated parity
bsf flag,1 ;set flag (parity error!)
call whigh
call wlow ;for the stop bit
call whigh
return ;and exit
;***** Write a byte to the ps2 mouse ******
ps2wri movwf brec ;speed not important at this point so
movwf temp ;calculate parity seperate for sake of
movlw 08h ;clarity
movwf bcnt
clrf parity
ps2w1 rrf temp,f ;shift bit into carry
movlw 01h ;preset for bit set
btfss status,c ;test carry
clrw ;bit zero so no addition
addwf parity,f ;update parity
decfsz bcnt,f ;any more bits to do?
goto ps2w1 ;yes so jump
comf parity,f ;only intrested in bit 0.
;parity bit is complement of bit 0
movlw 08h ;bit count to 8
movwf bcnt
call clkl ;set clock low
movlw 021h ;wait 100 uS
movwf temp
ps2ww decfsz temp,f
goto ps2ww
call datl ;set data low
nop ;wait 5 uS
nop
nop
nop
nop
call clkh ;set clock high
ps2w2 call wlow ;wait for clock to go low
rrf brec,f ;rotate bit into carry for testing
btfss status,c
goto ps2w3 ;jump if bit is low
call dath ;set data high
goto ps2w4
ps2w3 call datl ;set data low
ps2w4 call whigh ;wait for clock to go high
decfsz bcnt,f ;any more bits to send?
goto ps2w2 ;yes so jump
call wlow ;wait for clock to go low
btfss parity,0 ;send parity bit
goto ps2w5
call dath
goto ps2w6
ps2w5 call datl
ps2w6 call whigh
call wlow ;send stop bit
call dath
call whigh
call wlow ;read ack from mouse
bcf flag,0
btfsc porta,ps2data
bsf flag,0
call whigh
return
;******* wait for ps2 clock to go low **********
wlow btfsc porta,ps2clk
goto wlow
return
;******* wait for ps2 clock to go high **********
whigh btfss porta,ps2clk
goto whigh
return
;******* set ps2 clock low *********************
clkl bsf status,rp0
bcf trisa,ps2clk
bcf status,rp0
return
;******* set ps2 clock high ********************
clkh bsf status,rp0
bsf trisa,ps2clk
bcf status,rp0
return
;******* set ps2 data low *********************
datl bsf status,rp0
bcf trisa,ps2data
bcf status,rp0
return
;******* set ps2 data high *********************
dath bsf status,rp0
bsf trisa,ps2data
bcf status,rp0
return
;********* emulate mouse move ***************************
;move the emulated mouse by one step in the x direction if needed
trans movf xlow,w ;is the x counter zero?
iorwf xhigh,w
btfsc status,z
goto ymove ;no so jump to y direction
btfsc xhigh,7 ;is the x counter positive or negative?
goto xneg ;jump if negative
incf xpat,f ;increment the pattern list position
movlw 04h ;test if end of pattern list
subwf xpat,w
btfsc status,z
clrf xpat ;end of pattern list so reset
movlw 0ffh ;subtract 1 from the 16 bit counter by adding ffffh
addwf xlow,f
btfsc status,c ;add carry to high byte
incf xhigh,f
addwf xhigh,f
goto ymove ;exit to y direction
xneg decf xpat,f ;decrement the pattern list position
movlw 0ffh ;test if end of pattern list
subwf xpat,w
btfss status,z
goto xno
movlw 03h ;end of pattern list so reset
movwf xpat
xno movlw 01h ;add 1 to the 16 bit counter
addwf xlow,f
btfsc status,c ;add carry to high byte
incf xhigh,f
;move the emulated mouse by one step in the y direction if needed
ymove movf ylow,w ;is the y counter zero?
iorwf yhigh,w
btfsc status,z
goto out ;no so jump to output pattern
btfsc yhigh,7 ;is the y counter positive or negative?
goto yneg ;jump if negative
incf ypat,f ;increment the pattern list position
movlw 04h ;test if end of pattern list
subwf ypat,w
btfsc status,z
clrf ypat ;end of pattern list so reset
movlw 0ffh ;subtract 1 from the 16 bit counter by adding ffffh
addwf ylow,f
btfsc status,c ;add carry to high byte
incf yhigh,f
addwf yhigh,f
goto out ;exit to output pattern
yneg decf ypat,f ;decrement the pattern list position
movlw 0ffh ;test if end of pattern list
subwf ypat,w
btfss status,z
goto yno
movlw 03h ;end of pattern list so reset
movwf ypat
yno movlw 01h ;add 1 to the 16 bit counter
addwf ylow,f
btfsc status,c ;add carry to high byte
incf yhigh,f
;output new x and y patterns
out btfsc porta,0 ;test if set for atari
goto amiga
movf xpat,w ;get the x pattern bits
bsf pclath,1 ;set page 2
call pattx
movwf temp ;store the pattern in temp
movf ypat,w ;get the y pattern bits
call patty
clrf pclath ;set page 0
iorwf temp,f ;store the pattern in temp
goto outpat
amiga movf xpat,w ;get the x pattern bits
bsf pclath,1 ;set page 2
call apatx
movwf temp ;store the pattern in temp
movf ypat,w ;get the y pattern bits
call apaty
clrf pclath ;set page 0
iorwf temp,f ;store the pattern in temp
outpat movf temp,w ;get patterns
andlw 0fh ;ensure high nibble stays zero
movwf portb ;ouput patterns
return
;*************** pattern lists **************
org 0200h
;atari patterns
pattx addwf pcl,f
retlw 0
retlw 1
retlw 3
retlw 2
patty addwf pcl,f
retlw 0
retlw 4
retlw 0ch
retlw 8
;amiga patterns
apatx addwf pcl,f
retlw 0
retlw 1
retlw 9
retlw 8
apaty addwf pcl,f
retlw 0
retlw 4
retlw 6
retlw 2
;*******************************************************************************
END

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -52,7 +52,7 @@ OFF_TIME EQU .20 ;2.5 SEC (EINHEIT IST EIN TICK = 128MS
ON_TIME EQU .2 ;0.25 SEC (EINHEIT IST EIN TICK = 128MS
TIMER_HB EQU .240 ;256- (32768Hz PRO 1/8SEC = 4096TICKS/256) => 256-16=240 (resp 256-16/4 (wenn osco) = 252)
TIME_MAX EQU .160 ;MAXIMALTIME
U_ERR_PW_AUS EQU .5 ;5 SEC
U_ERR_PW_AUS EQU .40 ;5 SEC
;SERIEL
SYNC1 EQU 0FFh
SYNC1_DATA EQU 'A';
@@ -69,6 +69,7 @@ RTCD_FROM_MCF EQU 82h ;RTC AND NVRAM DATEN HEADER UND STATUS
U_MIN_TO_MCF EQU 03h ;UNTERSPANNUNGSMITTEILUNG AN PROCESSOR
EXT_SUB_GO EQU 04h ;SERIELL CODE UM SUBROUTINEN/INTERRUPTS ZU AKTIVIEREN
EXT_SUB_STOP EQU 05h ;SERIELL CODE UM SUBROUTINEN/INTERRUPTS ZU STOPPEN
CMD_FROM_MCF EQU 0Ch ;3 BYT COMMANDOS FROM MCF = TOTAL 4 BYT
CLK_SLEEP EQU B'00010010' ;125kHz intern, SLEEP MODE
CLK_ACTIV EQU B'01110010' ;inTernal CLK=8MHz, SLEEP MODE, SLEEP MODE
EXT_CODE EQU 0xFB ;CODE F<>R EXTERNE SUBROUTINEN/INTERRUPTS AUSF<53>HREN (FireBee!)
@@ -78,8 +79,9 @@ EXTERN_SUB_ADR EQU 0x2010 ;HIER MUSS 0xFB STEHEN WENN EXTERNE SUBROUTINES AUS
EXTERN_SUBROUTINES EQU 0x2012 ;STARTPUNKT EXTERNE SUBROUTINES
REQ_BLOCK EQU 0xA0 ;BLOCK DATEN LESEN -> CODE UND 3 BYTS ADRESSE = TOTAL 4 BYTES
READ_BLOCK EQU 0xA1 ;PROGRAMM BLOCK PIC->MCF -> CODE, 3 BYTS ADRESSE UND 64 BYTS DATEN = TOTAL 68 BYTES
WRITE_BLOCK EQU 0xA2 ;PROGRAMM BLOCK MCF->PIC -> CODE, 3 BYTS ADRESSE UND 64 BYTS DATEN = TOTAL 68 BYTES
PRG_OK_PIC EQU 0x22 ;PROGRAMMIERUNG BLOCK FERTIG
WRITE_BLOCK EQU 0xA2 ;PROGRAMM BLOCK MCF->PIC -> CODE, 3 BYTS ADRESSE UND 64 BYTS DATEN UND 1 BYT CHECKSUM = TOTAL 69 BYTES
PRG_OK EQU 0x00 ;PROGRAMMIERUNG BLOCK FERTIG
CHECKSUM_ERROR EQU 0xFE
;**********************************************************************************************"""""""""""""
; Start at the reset vector
Reset_Vector code 0x000
@@ -130,9 +132,70 @@ INT_HANDLER
CPFSEQ GO_INT ;SKIP WENN JA
RETFIE
GOTO EXTERN_INTERRUPTS ;REGISTER SICHERN UND STARTEN
;BLOCK PROGRAMMIEREN **********************************************************************************************"""""""""""""
PB CODE 0x0080
PROGRAMM_BLOCK
LFSR 1,RX_BUFFER ;BYT COUNTER AUF RX BUFFER
MOVFF POSTINC1,TBLPTRU ;TABLE POINTER SETZEN
MOVFF POSTINC1,TBLPTRH ;TABLE POINTER SETZEN
MOVFF POSTINC1,TBLPTRL ;TABLE POINTER SETZEN
;EREASE BLOCK
BCF INTCON,GIE ; DISABLE INTTERUPT
BSF EECON1,EEPGD ; point to Flash program memory
BCF EECON1,CFGS ; access Flash program memory
BSF EECON1,WREN ; enable write to memory
BSF EECON1,FREE ; enable Row Erase operation
MOVLW 55h
MOVWF EECON2 ; write 55h
MOVLW 0AAh ; write 0AAh
MOVWF EECON2
BSF EECON1,WR ; start erase (CPU stall)
BSF INTCON,GIE ; ENABLE INTERRUPT
TBLRD*- ; POINTER DUMMY DECREMENT
; BLOCK WRITE 1.H<>LFTE
MOVLW 23h ; 67 BYT 3 BYT ADR + 64 BYT DATEN
WRITE_WORD_TO_HREG1
MOVFF POSTINC1,TABLAT ; get byte of buffer data
TBLWT+* ; write data, perform a short write to internal TBLWT holding register.
CPFSEQ FSR1L ; SCHON BEI 32 BYTES?
BRA WRITE_WORD_TO_HREG1 ;NEIN->LOOP
; PROGRAMM BLOCK
BSF EECON1,EEPGD ; point to Flash program memory
BCF EECON1,CFGS ; access Flash program memory
BSF EECON1,WREN ; enable write to memory
BCF INTCON,GIE ; DISABLE INTTERUPT
MOVLW 55h
MOVWF EECON2 ; write 55h
MOVLW 0AAh
MOVWF EECON2 ; write 0AAh
BSF EECON1,WR ; start program (CPU stall)
BCF EECON1,WREN ; disable write to memory
; BLOCK WRITE 2. H<>LFTE
MOVLW 43h ; 67 BYT 3 BYT ADR + 64 BYT DATEN
WRITE_WORD_TO_HREG2
MOVFF POSTINC1,TABLAT ; get byte of buffer data
TBLWT+* ; write data, perform a short write to internal TBLWT holding register.
CPFSEQ FSR1L ; SCHON BEI 64 BYTES?
BRA WRITE_WORD_TO_HREG2 ;NEIN->LOOP
; PROGRAMM BLOCK
BSF EECON1,EEPGD ; point to Flash program memory
BCF EECON1,CFGS ; access Flash program memory
BSF EECON1,WREN ; enable write to memory
MOVLW 55h
MOVWF EECON2 ; write 55h
MOVLW 0AAh
MOVWF EECON2 ; write 0AAh
BSF EECON1,WR ; start program (CPU stall)
BCF EECON1,WREN ; disable write to memory
BSF INTCON,GIE ; ENABLE INTERRUPT
MOVLW PRG_OK ; OK senden
MOVWF TXREG
CLRF RX_STATUS ; FERTIG
RETFIE
;**********************************************************************************************"""""""""""""
; Start application beyond vector area
CODE 0x0100
STD CODE 0x0100
KALT_START
;RESET MODE
CLRF BSR ;BANK 0
@@ -154,8 +217,9 @@ KALT_START
MOVWF OSCCON
; div init
;SET PORT A: **7:#master/0.409*5V0 **6:PIC_AMKB_RX **5:PIC_SWTICH **4:HIGH_CHARGE_CURRENT **3:2V5 *2:3V3/2 **1:1V25 **0:POWER_IN/11
CLRF PORTA ;#master(7)=0, REST=0
MOVLW B'11111111' ;DIRECTION: alles auf Input
MOVLW B'01000000' ;RA6 auf high
MOVWF PORTA ;#master(7)=0, REST=0
MOVLW B'11111111' ;alles auf Input
MOVWF TRISA
;SET PORT B: **7:PGD **6:PGC **5:PGM **4:PIN_INT,1V5 **3:GAME PORT PIN10 **2:GAME PORT PIN11 **1:GAME PORT PIN6 **0: GAME PORT PIN5
CLRF PORTB ;ALLES AUF 0
@@ -168,9 +232,9 @@ KALT_START
CLRF PORTD ;ALLES AUF 0
MOVWF TRISD ;ALLES AUF INPUT
;SET PORT E: **3:#MCLR **2:#PCI_RESET **1:PCI 3V3 **0:PIC LED (0=ON)
MOVLW B'00000001' ;LED OFF
CLRF PORTE ;ALLES AUF 0
MOVWF TRISE ;ALLES AUF INPUT
MOVLW B'00000111' ;tri: PCI RESET; PCI3V3; LED
MOVWF TRISE ;direction setzen
;--------------------------
; set OVERvoltage detekt
MOVLW B'10011011' ;INT WENN <20>BER 3.9V
@@ -201,9 +265,17 @@ KALT_START
MOVWF MONTHS
MOVLW .42
MOVWF YEARS ;MONTAG 19.7.2010 12:00:00 (JAHR-1968)
MOVLW 0x27 ;32kHz TEILER=64
MOVWF REGA
MOVLW B'00000011' ;24H, SOMMERZEIT
MOVWF REGB
CLRF REGC
CLRF REGD
CLRF TASTE_ON_TIME
CLRF TASTE_OFF_TIME
CLRF POWER_ON_TIME
CLRF RX_STATUS
CLRF TX_STATUS
BSF PIE1,TMR1IE ;Enable Timer1 interrupt
;AD WANDLER INITIALISIEREN
CLRF AD_KANAL ;BEI 0 BEGINNEN
@@ -263,12 +335,14 @@ POWER_EIN
BCF TRISD,RD7 ;#RSTI AKTIVIEREN = LOW
BCF TRISB,RB4 ;PIC_INT AKTIVIEREN
BCF TRISD,RD0 ;POWER ON
BCF TRISA,RA6 ;PIC_AMKB_RX auf output
BRA LS_ON_POWER ;LADESTROM EINSTELLEN
POWER_AUS
;CLOCK
MOVLW CLK_SLEEP
MOVWF OSCCON
BSF TRISA,RA6 ;PIC_AMKB_RX auf input
BSF TRISD,RD0 ;POWER OFF
BSF TRISD,RD7 ;#RSTI DEAKTIVIEREN
BSF TRISB,RB4 ;PIC INT DEAKTIVIEREN
@@ -360,8 +434,8 @@ TG_END
INCF TASTE_ON_TIME ;ERH<52>HEN
RETURN
RESETEN
BCF TRISD,RD7 ;NEIN-> #RSTI AKTIVIEREN =LOW -->>>RESET
CALL SERIAL_OFF ;SERIELL DEAKTIVIEREN
BCF TRISD,RD7 ;NEIN-> #RSTI AKTIVIEREN =LOW -->>>RESET
BRA TG_ON_POWER3
;**********************************************************************************************"""""""""""""
;----------------------------------------- INTERRUPTS
@@ -388,7 +462,7 @@ TX_ISR1
BRA TX_ISR2 ;NEIN->
MOVFF POSTINC0,TXREG ;BYT SENDEN
MOVLW 0xC3 ;SCHON LETZTES BYTS?
CPFSGT FSR0L ;SKIP WENN FERTIG
CPFSEQ FSR0L ;SKIP WENN FERTIG
RETFIE ;NEIN WEITERE SENDEN
TX_ISR2
BRA TX_ISR_FERTIG
@@ -400,28 +474,33 @@ RX_ISR ; BYT RECEIVED
MOVLW SYNC4 ;IM SYNC STATUS?
CPFSLT RX_STATUS ;SKIP WENN NEIN
BRA RX_SYNC_START ;JA -> ZUERST SYNC EMPFANGEN
;---------------
;RTC DATEN EMPFANGEN? -----------------------------------------------------------------------------------
MOVLW RTCD_FROM_MCF ; DATEN VOM MCF CODE 0x82?
CPFSEQ RX_STATUS ; WENN JA-> SKIP
BRA RX_ISR1 ; NEIN->
;64 BYT EMPFANGEN -------------------------------------
MOVFF RX_B,POSTINC1 ;HOLEN -> (CNT+)
MOVLW 0x3F ;64 BYT <20>BERTRAGEN?
MOVLW 0x40 ;64 BYT <20>BERTRAGEN?
CPFSLT FSR1L ;NEIN ->SKIP
CLRF RX_STATUS ;JA FERTIG
RETFIE
;-------------------------------------------------------------------------------------
; SETZEN? ---------------------------------------------------
RX_ISR1
TSTFSZ RX_STATUS ;TASK H<>NGIG?
BRA RX_ISR2 ;JA ->
CPFSEQ RX_B ;BLOCK HEADER 0X82?
BRA RX_ISR2 ;NEIN->
MOVWF RX_STATUS ;STATUS SETZEN = EMPFANGENES BYT
LFSR 1,.0 ;BYT COUNTER AUF O
RETFIE
; RTC DATEN SENDEN? -------------------------------------------------------------------------------------
RX_ISR2
MOVLW REQ_RTCD_FROM_PIC ;DATEN SENDEN?
TSTFSZ RX_STATUS ;TASK H<>NGIG?
BRA RX_ISR3 ;JA ->
CPFSEQ RX_B ;SKIP WENN JA
BRA RX_ISR3 ;SONST NEXT
;BLOCK HEADER UND 64 BYT SENDEN -----------------------------------------
;BLOCK HEADER UND 64 BYT SENDEN -----------
LFSR 0,.0
BCF PIR1,TXIF ;INTERRUPT FLAG L<>SCHEN
BSF PIE1,TXIE ;Enable interrupt
@@ -430,9 +509,11 @@ RX_ISR2
MOVWF TXREG ;BLOCK HEADER = 0X81
CLRF RX_STATUS ;STATUS R<>CKSETZEN
RETFIE ;UND WEG
;-------------------------------------------------------------------------------------
;EXT SUB INT STARTEN?-------------------------------------------------------------------------------------
RX_ISR3
MOVLW EXT_SUB_GO ;EXT SUB FREIGEBEN?
TSTFSZ RX_STATUS ;TASK H<>NGIG?
BRA RX_ISR4 ;JA ->
CPFSEQ RX_B
BRA RX_ISR4 ;NEIN->
;EXT SUBS FREIGEBEN --------------------------------------------------------------
@@ -454,9 +535,11 @@ RX_ISR3
MOVFF TABLAT,GO_SUB ;EXTERNE SUBROUTINES AKTIVIEREN WENN OK
CLRF RX_STATUS ;STATUS R<>CKSETZEN
RETFIE ;UND WEG
;-------------------------------------------------------------------------------------
;EXT SUB INT STOPPEN? -------------------------------------------------------------------------------------
RX_ISR4
MOVLW EXT_SUB_STOP ;EXT SUB STOPPEN?
TSTFSZ RX_STATUS ;TASK H<>NGIG?
BRA RX_ISR5 ;JA ->
CPFSEQ RX_B
BRA RX_ISR5 ;NEIN->
;EXT SUBS STOPPEN --------------------------------------------------------------
@@ -464,36 +547,36 @@ RX_ISR4
CLRF GO_SUB ;STOPPEN
CLRF RX_STATUS ;STATUS R<>CKSETZEN
RETFIE ;UND WEG
;-------------------------------------------------------------------------------------
;REQ BLOCK? -------------------------------------------------------------------------------------
RX_ISR5
MOVLW REQ_BLOCK ;REQ BLOCK?
TSTFSZ RX_STATUS ;TASK H<>NGIG? SKIP NON
BRA RX_ISR6 ;JA ->
CPFSEQ RX_B
BRA RX_ISR6 ;NEIN->
;REQ BLOCK ----------------------------------------------------------------
;REQ BLOCK SETZEN
MOVWF RX_STATUS ;STATUS SETZEN = EMPFANGENES BYT
LFSR 1,TX_BUFFER ;BYT COUNTER AUF TX_BUFFER -> GLEICH EINTRAGEN
RETFIE
RX_ISR6
CPFSEQ RX_STATUS ;REQ BLOCK ADRESSE EMPFANGFEN?
BRA RX_ISR7 ;NEIN->
;3 BYT EMPFANGEN -------------------------------------
;3 BYT EMPFANGEN ---------------------------
MOVFF RX_B,POSTINC1 ;HOLEN -> (CNT+)
MOVLW 0x82 ;3 BYT <20>BERTRAGEN? (BUFFER BEGINNT BEI 0x180
CPFSLT FSR1L ;NEIN ->SKIP
BRA RX_RB3BOK
RETFIE
RX_RB3BOK
MOVLW 0x83 ;3 BYT <20>BERTRAGEN? (BUFFER BEGINNT BEI 0x180
CPFSEQ FSR1L ;NEIN ->SKIP
RETFIE ;NEXT ->
LFSR 1,TX_BUFFER ;BYT RX COUNTER AUF TX_BUFFER
MOVFF POSTINC1,TBLPTRU ;ADRESSE EINTRAGEN
MOVFF POSTINC1,TBLPTRH
MOVFF POSTINC1,TBLPTRL
MOVLW 0xC2 ;67 BYT <20>BERTRAGEN? (BUFFER BEGINNT BEI 0x180
MOVLW 0xC3 ;67 BYT <20>BERTRAGEN? (BUFFER BEGINNT BEI 0x180
RX_RB3B2
TBLRD *+ ;LESEN UND NEXT
MOVFF TABLAT,POSTINC1 ;UND EINTRAGEN
CPFSEQ FSR1L ;WENN FERTIG ->SKIP
BRA RX_RB3B2 ;SONST LOOP
;BLOCK HEADER 3 BYTS ADRESSE UND 64 BYT SENDEN STARTEN -----------------------------------------
;BLOCK HEADER 3 BYTS ADRESSE UND 64 BYT SENDEN STARTEN
LFSR 0,TX_BUFFER ;TX COUNTER AUF TX_BUFFER
BCF PIR1,TXIF ;INTERRUPT FLAG L<>SCHEN
BSF PIE1,TXIE ;Enable interrupt
@@ -502,66 +585,129 @@ RX_RB3B2
MOVWF TXREG ;BLOCK HEADER = 0XA1
CLRF RX_STATUS ;STATUS R<>CKSETZEN
RETFIE ;UND WEG
;-------------------------------------------------------------------------------------
;PROGRAMM BLOCK? -------------------------------------------------------------------------------------
RX_ISR7
MOVLW WRITE_BLOCK ;WRITE BLOCK 0xA2 BYT EMPFANGEN?
CPFSEQ RX_STATUS ;WENN JA-> SKIP
BRA RX_ISR8 ;NEIN->
;WRITE BLOCK ----------------------------------------------------------------------------
;67 BYT EMPFANGEN -------------------------------------
;WRITE BLOCK ------------------------
;68 BYT EMPFANGEN: 3 BYT ADRESSE; 64 BYT DATEN; 1 BYT CHECKSUM -------------------
MOVFF RX_B,POSTINC1 ;HOLEN -> (CNT+)
MOVLW 0x42 ;67 BYT <20>BERTRAGEN?
CPFSLT FSR1L ;WENN FERTIG ->SKIP
MOVLW 0x44 ;68 BYT <20>BERTRAGEN?
CPFSEQ FSR1L ;WENN FERTIG ->SKIP
RETFIE
; ADRESSE UND DATEN SIND DA -> PROGRAMMING FLASH
; ADRESSE UND DATEN und CHECKSUM SIND DA -> PROGRAMMING FLASH
; TEST CHECKSUM
LFSR 1,RX_BUFFER ;BYT COUNTER AUF RX BUFFER
MOVFF POSTINC1,TBLPTRU ;TABLE POINTER SETZEN
MOVLW (EXTERN_INT_ADR & 0xFF0000)>>16
CPFSLT TBLPTRU ;TEST OB WENIGER ALS ERLAUBT
BRA NO_PROG ;JA->
MOVFF POSTINC1,TBLPTRH ;TABLE POINTER SETZEN
MOVLW (EXTERN_INT_ADR & 0x00FF00)>>8
CPFSLT TBLPTRU ;TEST OB WENIGER ALS ERLAUBT
BRA NO_PROG ;JA->
MOVFF POSTINC1,TBLPTRL ;TABLE POINTER SETZEN
;EREASE BLOCK
BSF EECON1,EEPGD ; point to Flash program memory
BCF EECON1,CFGS ; access Flash program memory
BSF EECON1,WREN ; enable write to memory
BSF EECON1,FREE ; enable Row Erase operation
MOVLW 55h
MOVWF EECON2 ; write 55h
MOVLW 0AAh ; write 0AAh
MOVWF EECON2
BSF EECON1,WR ; start erase (CPU stall)
MOVLW 0x42 ;67 BYT
WRITE_WORD_TO_HREGS
MOVFF POSTINC1,TABLAT ; get byte of buffer data
TBLWT+* ; write data, perform a short write to internal TBLWT holding register.
CPFSLT FSR1L ;SCHON BEI 67 BYTES?
BRA WRITE_WORD_TO_HREGS ;NEIN->LOOP
PROGRAM_MEMORY
BSF EECON1,EEPGD ; point to Flash program memory
BCF EECON1,CFGS ; access Flash program memory
BSF EECON1,WREN ; enable write to memory
MOVLW 55h
MOVWF EECON2 ; write 55h
MOVLW 0AAh
MOVWF EECON2 ; write 0AAh
BSF EECON1,WR ; start program (CPU stall)
BCF EECON1,WREN ; disable write to memory
NO_PROG
CLRF RX_STATUS ;AUF NORMLA SCHALTEN
RETFIE ;UND FERTIG
MOVLW 43h ;67 BYTES
MOVWF RX_B ;COUNTER
MOVLW 0h ;SUM CLEAR
LOOP_TEST_CHECKSUM
ADDWF POSTINC1,0 ;ADD TO WREG
DECFSZ RX_B ;-1 SKIP WENN 0
BRA LOOP_TEST_CHECKSUM
CPFSEQ POSTINC1 ;SUM = CHECKESUM? SKIP JA
BRA CHK_ERR ;NEIN CHECKSUM ERROR
BRA PROGRAMM_BLOCK ; OK-> PROGRAMMIEREN
CHK_ERR
MOVLW CHECKSUM_ERROR ; ERROR senden
MOVWF TXREG;
CLRF RX_STATUS ; FERTIG
RETFIE
;WRITE BLOCK SETZEN?
RX_ISR8
TSTFSZ RX_STATUS ;TASK H<>NGIG?
BRA RX_ISR9 ;JA ->
CPFSEQ RX_B ;BLOCK HEADER COMMANDOE 0XA2?
BRA RX_ISR9 ;NEIN->
MOVWF RX_STATUS ;STATUS SETZEN = EMPFANGENES BYT
LFSR 1,RX_BUFFER ;BYT COUNTER AUF RX BUFFER
RETFIE
;-------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------
RX_ISR9
MOVLW CMD_FROM_MCF ;CMD HEADER 0x0C EMPFANGEN?
CPFSEQ RX_STATUS ;WENN JA-> SKIP
BRA RX_ISR15 ;NEIN->
;COMMAND BYT EMPFANGEN
;3 BYT EMPFANGEN -------------------------------------
MOVFF RX_B,POSTINC1 ;HOLEN -> (CNT+)
MOVLW 0x3 ;3 BYT <20>BERTRAGEN?
CPFSEQ FSR1L ;NEIN ->SKIP
RETFIE
CMD_AUSWERTEN
;RESET?
LFSR 1,RX_BUFFER ;ZEIGER AUF RX BUFFER
MOVLW 'R'
CPFSEQ POSTINC1 ;=? SIKP JA
BRA LC2 ;NEIN->
MOVLW 'S'
CPFSEQ POSTINC1 ;=? SIKP JA
BRA LC2 ;NEIN->
MOVLW 'T'
CPFSEQ POSTINC1 ;=? SIKP JA
BRA LC2 ;NEIN->
;RESET MCF
CALL SERIAL_OFF ;SERIELL DEAKTIVIEREN
BCF TRISD,RD7 ;NEIN-> #RSTI AKTIVIEREN =LOW -->>>RESET
MOVLW 0FFh
LC1_WAIT
NOP
NOP
NOP
DECFSZ WREG
BRA LC1_WAIT
BSF TRISD,RD7 ;JA -> #RSTI DEAKTIVIEREN =HIGH
CALL SERIAL_ON ;SERIELL EINSCHALTEN
CLRF RX_STATUS ;JA FERTIG
RETFIE
LC2:
;POWER AUS?
LFSR 1,RX_BUFFER ;ZEIGER AUF RX BUFFER
MOVLW 'O'
CPFSEQ POSTINC1 ;=? SIKP JA
BRA LC4 ;NEIN->
MOVLW 'F'
CPFSEQ POSTINC1 ;=? SIKP JA
BRA LC4 ;NEIN->
MOVLW 'F'
CPFSEQ POSTINC1 ;=? SIKP JA
BRA LC4 ;NEIN->
;POWER OFF
CALL POWER_AUS
CLRF RX_STATUS ;JA FERTIG
RETFIE
LC4:
;RESET PIC?
LFSR 1,RX_BUFFER ;ZEIGER AUF RX BUFFER
MOVLW 'R'
CPFSEQ POSTINC1 ;=? SIKP JA
BRA LC6 ;NEIN->
MOVLW 'P'
CPFSEQ POSTINC1 ;=? SIKP JA
BRA LC6 ;NEIN->
MOVLW 'I'
CPFSEQ POSTINC1 ;=? SIKP JA
BRA LC6 ;NEIN->
;RESET PIC
RESET
;HIER SOLLTE ER NICHT HINKOMMEN
BRA KALT_START
LC6
;NO REAL CMA
CLRF RX_STATUS ;JA FERTIG
RETFIE
;END CDM AUSWERTEN
RX_ISR15
TSTFSZ RX_STATUS ;TASK H<>NGIG?
BRA RX_ISR20 ;JA ->
CPFSEQ RX_B ;CMD?
BRA RX_ISR20 ;NEIN->
;CMD SETZEN
MOVWF RX_STATUS ;STATUS SETZEN = EMPFANGENES BYT
LFSR 1,RX_BUFFER ;ZEIGER AUF RX BUFFER
RETFIE
RX_ISR20
RX_ISR_END
CLRF RX_STATUS
RETFIE
;-------------------------------------------------------------------------------------
@@ -612,24 +758,24 @@ RX_WAIT1
BTFSS TXSTA,TRMT
BRA RX_WAIT1
MOVLW 'O' ;SENDE OK!
MOVWF TXREG;
MOVWF TXREG
RX_WAIT2
BTFSS TXSTA,TRMT
BRA RX_WAIT2
MOVLW 'K' ;SENDE OK!
MOVWF TXREG;
MOVWF TXREG
RX_WAIT3
BTFSS TXSTA,TRMT
BRA RX_WAIT3
MOVLW '!'
MOVWF TXREG;
MOVWF TXREG
CLRF RX_STATUS ;OK START NORMAL
RETFIE
;**********************************************************************************************"""""""""""""
;SPANNUNGS<47>BERWACHUNGS INTERRUPT
HLVD_ISR
BTFSS U_ERR,1 ;WARTEN AUF GELADEN?
BRA HLVD_LE ;NEIN UNTERSPANNUNG DETEKT->
BRA HLVD_LE ;NEIN UNTERSPANNUNG DETEKT->
BCF U_ERR,0 ;SPANNUNGSFEHLER AUS
BCF U_ERR,1 ;WARTEN AUF GELADEN=AUS
MOVLW U_ERR_PW_AUS+2 ;POWER AUS <20>BERSPRINGEN
@@ -682,15 +828,15 @@ POWER_OFF_I
BNZ PINGS ;NICHT MODULO4 ->
MOVLW .7
CPFSEQ TICKS ;7. TICK?
BRA POWER_OFF_I2 ;NEIN->
BRA POWER_OFF_I2 ;NEIN->
BCF TRISE,RE0 ;JA->LED=ON
POWER_OFF_I2
MOVLW .30 ; WENIGER ALS 30 SEC SEIT LETZTEM SPANNUNGSFEHLER?
CPFSLT U_ERR_TIME
BRA PINGS ;NEIN->
BRA PINGS ;NEIN->
MOVLW .5
CPFSEQ TICKS ;5. TICK?
BRA PINGS ;NEIN->
BRA PINGS ;NEIN->
BCF TRISE,RE0 ;JA->LED=ON
PINGS
CALL TASTE ;UP TASTE
@@ -763,6 +909,20 @@ SEK_3
SEK_4
CLRF TICKS
INCF SECS ; Increment seconds
;?????????????????????????????????????????????????????
;test pic ps2 keyboard
; MOVLW 0f9h ;2
; CALL send
; nop
; nop
; MOVLW .10
; CALL send
; nop
; nop
; MOVLW .10
; CALL send
;--------------------------------------------------------------
MOVLW .59 ; 60 seconds elapsed?
CPFSGT SECS
RETFIE ;RETURN
@@ -840,6 +1000,61 @@ NOT_SEP
; ENDE MAIN
;**********************************************************************************************"""""""""""""
;**********************************************************************************************"""""""""""""
; EXTERN_SUBOUTINES FOGEN AB 0x1000 DIE SP<53>TER EINPROGRAMMIERT WERDEN
; EXTERN_SUBOUTINES FOGEN AB 0x2000 DIE SP<53>TER EINPROGRAMMIERT WERDEN
;**********************************************************************************************"""""""""""""
EXT_INT CODE 0x2000
EXT_INT_MAGIC DB 0
EXT_INT_START
EXT_SUB CODE 0x2010
EXT_SUB_MAGIC DB 0
EXT_SUT_START
clockrate equ .8000000 ;Xtal value (8Mhz in this case)
fclk equ clockrate/4
;baudrate equ ((fclk/.7812.5)/3-2) ;7812.5 is the baud rate
baudrate equ .83 ;7812.5 is the baud rate
txreg equ 10
delay equ 11
count equ 12
txchar equ 13
send
movwf txreg
movlw baudrate
movwf delay
movlw .9
movwf count
bcf PORTA,6 ;send start bit
nop ;even out bit times
next
decfsz delay,f
goto next
movlw baudrate ;rest of program is 9 instructions
movwf delay
decfsz count,f
goto sendnextbit
bcf PORTA,6 ;send stop bit
movlw baudrate ;Delay for line to settle
movwf delay ;Delay for line to settle
p1
decfsz delay,f ;Delay for line to settle
goto p1 ;Delay for line to settle
bsf PORTA,6
p2
decfsz delay,f
goto p2
return
sendnextbit
rrcf txreg,F
btfss STATUS,C ;check next bit to tx
goto setlo
bsf PORTA,6 ;send a high bit
goto next
setlo
bcf PORTA,6 ;send a low bit
goto next
end

Binary file not shown.

View File

View File

@@ -1,82 +0,0 @@
:020000040000FA
:020000007FD0AF
:020002000000FC
:040008000CEF00F009
:08001800E06A9DCF4EF09E50FE
:100020004E174EB115D24EBD11D24EB918D14EBB9E
:100030002BD1A0CF4FF0A1504F174FB5F3D11000E7
:100040009DCF4EF09E504E174E67E6D7A0CF4FF093
:10005000A1504F174F67E0D7FB0E4D63100001EF23
:0200600010F09E
:10010000E06AF26AD06A9D6AA06A9E6AA16A9F6AE2
:10011000A26A9B6A720ED36E806AFF0E926E816A2B
:10012000936E826A946E836A956E010E846A966EEF
:100130009B0ED26E030E466F140E476FA084E9EC3F
:1001400000F0F00ECF6ECE6A0F0ECD6E416B006BDD
:10015000026B0C0E046F010E066F010E076F080E86
:10016000086F2A0E096F426B436B446B9D80456B91
:10017000C26A090EC16E000EC06E486BB06A100EE6
:10018000AF6E040EAC6E900EAB6E080EB86E4C6B7C
:10019000F06AF00EF16EC00EF26E120ED36EFB0E10
:1001A0004C6302D0D7ED00F095B00300F8D709EC0E
:1001B00010F01300720ED36E929E959E93989590B8
:1001C0000AD0120ED36E9580958E9388928E446BD2
:1001D00004D095B002D09298120092881200AC9A86
:1001E0009D9A9E9A9D989E981200ACBA1200AC8A75
:1001F000FF0E4A6F4B6BAECF49F0AECF49F09E98E1
:100200009E9A9D8A0000120083A20BD0426BA00E22
:100210004365432B040E44651200958EF5EC00F007
:100220001200150E4261120095B00ED0020E42630C
:1002300003D0020EAD6E0CD0020E42610CD0140E33
:100240004261E1EC00F004D0020E4261DAEC00F011
:10025000436B422B1200959EEFEC00F0F0D7810E1D
:100260004B6309D0EECFADFF3F0EE96410004B6B3E
:100270009D989E981000A10E4B6305D0EECFADFF68
:10028000C30EE9641000F3D7AECF49F0FC0E4A610B
:1002900097D0820E4A6306D049C0E6FF3F0EE16068
:1002A0004A6B1000496304D04A6F10EE00F0100052
:1002B000010E496309D000EE00F09E989D88810EE2
:1002C0004B6FAD6E4A6B1000040E496314D0000EE4
:1002D000F86E200EF76E000EF66E0800F5CF4DF0AA
:1002E000000EF86E200EF76E100EF66E0800F5CFB9
:1002F0004CF04A6B1000050E496304D04D6B4C6BFB
:100300004A6B1000A00E496304D04A6F11EE80F0D2
:1003100010004A631DD049C0E6FF820EE16001D0A3
:10032000100011EE80F0E6CFF8FFE6CFF7FFE6CF42
:10033000F6FFC20E0900F5CFE6FFE162FBD701EE42
:1003400080F09E989D88A10E4B6FAD6E4A6B100099
:10035000A20E4A632DD049C0E6FF420EE1601000B4
:1003600011EE00F0E6CFF8FF000EF8601FD0E6CFE8
:10037000F7FF200EF8601AD0E6CFF6FFA68EA69CF7
:10038000A684A688550EA76EAA0EA76EA682420E58
:10039000E6CFF5FF0F00E160FBD7A68EA69CA684F2
:1003A000550EA76EAA0EA76EA682A6944A6B1000E1
:1003B000496304D04A6F11EE00F010004A6B100040
:1003C000FF0E4A6309D0410E496303D0FE0E4A6F07
:1003D0001000FF0E4A6F1000FE0E4A6306D0430E57
:1003E0004963F7D7FD0E4A6F1000FD0E4A6306D031
:1003F000500E4963EED7FC0E4A6F1000FC0E4A63A4
:10040000E8D7460E4963E5D7ACA2FED74F0EAD6ED6
:10041000ACA2FED74B0EAD6EACA2FED7210EAD6ED8
:100420004A6B100046A30AD046914693070E476FC9
:10043000170ED26ED2AAFED7A19410004681468331
:10044000476B030EAD6E9A0ED26EF4D79E9C1000D1
:10045000F00ECF6E9E9081889680819895B005D0E1
:1004600095BE11D041B196900ED0030E00150BE150
:10047000070E416301D096901E0E476104D0050E11
:10048000416301D0969004EC01F0040E436504D062
:10049000958E95A0F5EC00F0412B95A006D0200E8E
:1004A000486103D0A00E47619680070E4165100099
:1004B00095A09690A00E4765472B050E476302D086
:1004C000E1EC00F0010EC26EC282C2B2FED7C4CF10
:1004D00048F095B00DD00D0EC26EC282C2B2FED7EA
:1004E000C80EC46005D046A103D0A00E47654707DB
:1004F000416B002B3B0E00651000006B022B3B0E86
:1005000002651000026B042B170E04651000046BCB
:10051000070E0661066B062B072B1C0E07651000E5
:10052000020E086310D0030E091503E11D0E0765C6
:100530001000010E076F082B120E08651000010E47
:10054000086F092B10001E0E07651000040E0863CB
:1005500001D0EFD7060E086301D0EBD7090E086370
:0C05600001D0E7D70B0E08631000E3D7B2
:00000001FF

66
firebee1/firebee1.lkr Executable file
View File

@@ -0,0 +1,66 @@
// File: 18f4520_g.lkr
// Generic linker script for the PIC18F4520 processor
#DEFINE _CODEEND _DEBUGCODESTART - 1
#DEFINE _CEND _CODEEND + _DEBUGCODELEN
#DEFINE _DATAEND _DEBUGDATASTART - 1
#DEFINE _DEND _DATAEND + _DEBUGDATALEN
LIBPATH .
#IFDEF _CRUNTIME
#IFDEF _EXTENDEDMODE
FILES c018i_e.o
FILES clib_e.lib
FILES p18f4520_e.lib
#ELSE
FILES c018i.o
FILES clib.lib
FILES p18f4520.lib
#FI
#FI
#IFDEF _DEBUGCODESTART
CODEPAGE NAME=page START=0x0 END=_CODEEND
CODEPAGE NAME=debug START=_DEBUGCODESTART END=_CEND PROTECTED
#ELSE
CODEPAGE NAME=page START=0x0 END=0x7FFF
#FI
CODEPAGE NAME=idlocs START=0x200000 END=0x200007 PROTECTED
CODEPAGE NAME=config START=0x300000 END=0x30000D PROTECTED
CODEPAGE NAME=devid START=0x3FFFFE END=0x3FFFFF PROTECTED
CODEPAGE NAME=eedata START=0xF00000 END=0xF000FF PROTECTED
#IFDEF _EXTENDEDMODE
DATABANK NAME=gpre START=0x0 END=0x5F
ACCESSBANK NAME=accessram START=0x60 END=0x7F
#ELSE
ACCESSBANK NAME=accessram START=0x0 END=0x7F
#FI
DATABANK NAME=gpr0 START=0x80 END=0xFF
DATABANK NAME=gpr1 START=0x100 END=0x1FF
DATABANK NAME=gpr2 START=0x200 END=0x2FF
DATABANK NAME=gpr3 START=0x300 END=0x3FF
DATABANK NAME=gpr4 START=0x400 END=0x4FF
#IFDEF _DEBUGDATASTART
DATABANK NAME=gpr5 START=0x500 END=_DATAEND
DATABANK NAME=dbgspr START=_DEBUGDATASTART END=_DEND PROTECTED
#ELSE //no debug
DATABANK NAME=gpr5 START=0x500 END=0x5FF
#FI
ACCESSBANK NAME=accesssfr START=0xF80 END=0xFFF PROTECTED
#IFDEF _CRUNTIME
SECTION NAME=CONFIG ROM=config
#IFDEF _DEBUGDATASTART
STACK SIZE=0x100 RAM=gpr4
#ELSE
STACK SIZE=0x100 RAM=gpr5
#FI
#FI

File diff suppressed because it is too large Load Diff

View File

@@ -1,188 +0,0 @@
MPLINK 4.35, Linker
Linker Map File - Created Fri Oct 01 13:06:43 2010
Section Info
Section Type Address Location Size(Bytes)
--------- --------- --------- --------- ---------
Reset_Vector code 0x000000 program 0x000002
.cinit romdata 0x000002 program 0x000002
HIGH_INT_VEC code 0x000008 program 0x000004
LOW_INT_VEC code 0x000018 program 0x00004a
.code code 0x000100 program 0x00046c
Program Memory Usage
Start End
--------- ---------
0x000000 0x000003
0x000008 0x00000b
0x000018 0x000061
0x000100 0x00056b
1214 out of 33048 program addresses used, program memory utilization is 3%
Symbols - Sorted by Name
Name Address Location Storage File
--------- --------- --------- --------- ---------
AD_ISR 0x00044c program static C:\FireBee\MLAB\firebee1\firebee1.asm
FEB 0x000526 program static C:\FireBee\MLAB\firebee1\firebee1.asm
HLVD_ISR 0x000424 program static C:\FireBee\MLAB\firebee1\firebee1.asm
HLVD_LE 0x00043c program static C:\FireBee\MLAB\firebee1\firebee1.asm
INT_HANDLER 0x000018 program static C:\FireBee\MLAB\firebee1\firebee1.asm
KALT_START 0x000100 program static C:\FireBee\MLAB\firebee1\firebee1.asm
LADESTROM 0x0001d2 program static C:\FireBee\MLAB\firebee1\firebee1.asm
LS_OFF_POWER 0x0001da program static C:\FireBee\MLAB\firebee1\firebee1.asm
LS_ON_POWER 0x0001d6 program static C:\FireBee\MLAB\firebee1\firebee1.asm
MAIN 0x00019e program static C:\FireBee\MLAB\firebee1\firebee1.asm
MAIN2 0x0001ae program static C:\FireBee\MLAB\firebee1\firebee1.asm
MEHR_ALS_28_TAGE 0x000520 program static C:\FireBee\MLAB\firebee1\firebee1.asm
MEHR_ALS_30_TAGE 0x00054c program static C:\FireBee\MLAB\firebee1\firebee1.asm
MINUTEN 0x0004fa program static C:\FireBee\MLAB\firebee1\firebee1.asm
NEXT_MONTH 0x000532 program static C:\FireBee\MLAB\firebee1\firebee1.asm
NON_SYNC 0x0003d2 program static C:\FireBee\MLAB\firebee1\firebee1.asm
NOT_APRIL 0x000554 program static C:\FireBee\MLAB\firebee1\firebee1.asm
NOT_FEB 0x000546 program static C:\FireBee\MLAB\firebee1\firebee1.asm
NOT_JUNI 0x00055c program static C:\FireBee\MLAB\firebee1\firebee1.asm
NOT_SEP 0x000564 program static C:\FireBee\MLAB\firebee1\firebee1.asm
NO_PROG 0x0003ac program static C:\FireBee\MLAB\firebee1\firebee1.asm
PINGS 0x000486 program static C:\FireBee\MLAB\firebee1\firebee1.asm
PINGS2 0x0004aa program static C:\FireBee\MLAB\firebee1\firebee1.asm
PINGW 0x000498 program static C:\FireBee\MLAB\firebee1\firebee1.asm
POWER_AUS 0x0001c2 program static C:\FireBee\MLAB\firebee1\firebee1.asm
POWER_EIN 0x0001b4 program static C:\FireBee\MLAB\firebee1\firebee1.asm
POWER_OFF_I 0x00046a program static C:\FireBee\MLAB\firebee1\firebee1.asm
POWER_OFF_I2 0x000478 program static C:\FireBee\MLAB\firebee1\firebee1.asm
PROGRAM_MEMORY 0x00039a program static C:\FireBee\MLAB\firebee1\firebee1.asm
RESETEN 0x000256 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RTC_ISR 0x000450 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR 0x000288 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR1 0x0002a4 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR2 0x0002b0 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR3 0x0002c8 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR4 0x0002f6 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR5 0x000304 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR6 0x000312 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR7 0x000350 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR8 0x0003b0 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR9 0x0003bc program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_RB3B2 0x000334 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_RB3BOK 0x000322 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_SYNC2 0x0003d8 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_SYNC3 0x0003ea program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_SYNC4 0x0003fc program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_SYNC_START 0x0003c0 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_WAIT1 0x000408 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_WAIT2 0x000410 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_WAIT3 0x000418 program static C:\FireBee\MLAB\firebee1\firebee1.asm
SCHALTJAHR 0x00052c program static C:\FireBee\MLAB\firebee1\firebee1.asm
SEKUNDEN 0x0004b0 program static C:\FireBee\MLAB\firebee1\firebee1.asm
SEK_2 0x0004ca program static C:\FireBee\MLAB\firebee1\firebee1.asm
SEK_3 0x0004dc program static C:\FireBee\MLAB\firebee1\firebee1.asm
SEK_4 0x0004f0 program static C:\FireBee\MLAB\firebee1\firebee1.asm
SEK_NPA 0x0004c4 program static C:\FireBee\MLAB\firebee1\firebee1.asm
SEND_RTC_REG 0x000232 program static C:\FireBee\MLAB\firebee1\firebee1.asm
SERIAL_OFF 0x0001de program static C:\FireBee\MLAB\firebee1\firebee1.asm
SERIAL_ON 0x0001ea program static C:\FireBee\MLAB\firebee1\firebee1.asm
STUNDEN 0x000504 program static C:\FireBee\MLAB\firebee1\firebee1.asm
TAGE_UND_TAG_DER_WOCHE 0x00050e program static C:\FireBee\MLAB\firebee1\firebee1.asm
TASTE 0x000208 program static C:\FireBee\MLAB\firebee1\firebee1.asm
TG_END 0x000250 program static C:\FireBee\MLAB\firebee1\firebee1.asm
TG_JA 0x000222 program static C:\FireBee\MLAB\firebee1\firebee1.asm
TG_OFF_POWER 0x000248 program static C:\FireBee\MLAB\firebee1\firebee1.asm
TG_ON_POWER 0x00022c program static C:\FireBee\MLAB\firebee1\firebee1.asm
TG_ON_POWER2 0x000238 program static C:\FireBee\MLAB\firebee1\firebee1.asm
TG_ON_POWER3 0x00023e program static C:\FireBee\MLAB\firebee1\firebee1.asm
TX_ISR 0x00025e program static C:\FireBee\MLAB\firebee1\firebee1.asm
TX_ISR1 0x000276 program static C:\FireBee\MLAB\firebee1\firebee1.asm
TX_ISR2 0x000286 program static C:\FireBee\MLAB\firebee1\firebee1.asm
TX_ISR_FERTIG 0x00026e program static C:\FireBee\MLAB\firebee1\firebee1.asm
WAIT_LVDOK 0x000434 program static C:\FireBee\MLAB\firebee1\firebee1.asm
WARTEN 0x0001a8 program static C:\FireBee\MLAB\firebee1\firebee1.asm
WRITE_WORD_TO_HREGS 0x000390 program static C:\FireBee\MLAB\firebee1\firebee1.asm
YEAR 0x00053e program static C:\FireBee\MLAB\firebee1\firebee1.asm
Symbols - Sorted by Address
Name Address Location Storage File
--------- --------- --------- --------- ---------
INT_HANDLER 0x000018 program static C:\FireBee\MLAB\firebee1\firebee1.asm
KALT_START 0x000100 program static C:\FireBee\MLAB\firebee1\firebee1.asm
MAIN 0x00019e program static C:\FireBee\MLAB\firebee1\firebee1.asm
WARTEN 0x0001a8 program static C:\FireBee\MLAB\firebee1\firebee1.asm
MAIN2 0x0001ae program static C:\FireBee\MLAB\firebee1\firebee1.asm
POWER_EIN 0x0001b4 program static C:\FireBee\MLAB\firebee1\firebee1.asm
POWER_AUS 0x0001c2 program static C:\FireBee\MLAB\firebee1\firebee1.asm
LADESTROM 0x0001d2 program static C:\FireBee\MLAB\firebee1\firebee1.asm
LS_ON_POWER 0x0001d6 program static C:\FireBee\MLAB\firebee1\firebee1.asm
LS_OFF_POWER 0x0001da program static C:\FireBee\MLAB\firebee1\firebee1.asm
SERIAL_OFF 0x0001de program static C:\FireBee\MLAB\firebee1\firebee1.asm
SERIAL_ON 0x0001ea program static C:\FireBee\MLAB\firebee1\firebee1.asm
TASTE 0x000208 program static C:\FireBee\MLAB\firebee1\firebee1.asm
TG_JA 0x000222 program static C:\FireBee\MLAB\firebee1\firebee1.asm
TG_ON_POWER 0x00022c program static C:\FireBee\MLAB\firebee1\firebee1.asm
SEND_RTC_REG 0x000232 program static C:\FireBee\MLAB\firebee1\firebee1.asm
TG_ON_POWER2 0x000238 program static C:\FireBee\MLAB\firebee1\firebee1.asm
TG_ON_POWER3 0x00023e program static C:\FireBee\MLAB\firebee1\firebee1.asm
TG_OFF_POWER 0x000248 program static C:\FireBee\MLAB\firebee1\firebee1.asm
TG_END 0x000250 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RESETEN 0x000256 program static C:\FireBee\MLAB\firebee1\firebee1.asm
TX_ISR 0x00025e program static C:\FireBee\MLAB\firebee1\firebee1.asm
TX_ISR_FERTIG 0x00026e program static C:\FireBee\MLAB\firebee1\firebee1.asm
TX_ISR1 0x000276 program static C:\FireBee\MLAB\firebee1\firebee1.asm
TX_ISR2 0x000286 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR 0x000288 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR1 0x0002a4 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR2 0x0002b0 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR3 0x0002c8 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR4 0x0002f6 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR5 0x000304 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR6 0x000312 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_RB3BOK 0x000322 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_RB3B2 0x000334 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR7 0x000350 program static C:\FireBee\MLAB\firebee1\firebee1.asm
WRITE_WORD_TO_HREGS 0x000390 program static C:\FireBee\MLAB\firebee1\firebee1.asm
PROGRAM_MEMORY 0x00039a program static C:\FireBee\MLAB\firebee1\firebee1.asm
NO_PROG 0x0003ac program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR8 0x0003b0 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_ISR9 0x0003bc program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_SYNC_START 0x0003c0 program static C:\FireBee\MLAB\firebee1\firebee1.asm
NON_SYNC 0x0003d2 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_SYNC2 0x0003d8 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_SYNC3 0x0003ea program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_SYNC4 0x0003fc program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_WAIT1 0x000408 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_WAIT2 0x000410 program static C:\FireBee\MLAB\firebee1\firebee1.asm
RX_WAIT3 0x000418 program static C:\FireBee\MLAB\firebee1\firebee1.asm
HLVD_ISR 0x000424 program static C:\FireBee\MLAB\firebee1\firebee1.asm
WAIT_LVDOK 0x000434 program static C:\FireBee\MLAB\firebee1\firebee1.asm
HLVD_LE 0x00043c program static C:\FireBee\MLAB\firebee1\firebee1.asm
AD_ISR 0x00044c program static C:\FireBee\MLAB\firebee1\firebee1.asm
RTC_ISR 0x000450 program static C:\FireBee\MLAB\firebee1\firebee1.asm
POWER_OFF_I 0x00046a program static C:\FireBee\MLAB\firebee1\firebee1.asm
POWER_OFF_I2 0x000478 program static C:\FireBee\MLAB\firebee1\firebee1.asm
PINGS 0x000486 program static C:\FireBee\MLAB\firebee1\firebee1.asm
PINGW 0x000498 program static C:\FireBee\MLAB\firebee1\firebee1.asm
PINGS2 0x0004aa program static C:\FireBee\MLAB\firebee1\firebee1.asm
SEKUNDEN 0x0004b0 program static C:\FireBee\MLAB\firebee1\firebee1.asm
SEK_NPA 0x0004c4 program static C:\FireBee\MLAB\firebee1\firebee1.asm
SEK_2 0x0004ca program static C:\FireBee\MLAB\firebee1\firebee1.asm
SEK_3 0x0004dc program static C:\FireBee\MLAB\firebee1\firebee1.asm
SEK_4 0x0004f0 program static C:\FireBee\MLAB\firebee1\firebee1.asm
MINUTEN 0x0004fa program static C:\FireBee\MLAB\firebee1\firebee1.asm
STUNDEN 0x000504 program static C:\FireBee\MLAB\firebee1\firebee1.asm
TAGE_UND_TAG_DER_WOCHE 0x00050e program static C:\FireBee\MLAB\firebee1\firebee1.asm
MEHR_ALS_28_TAGE 0x000520 program static C:\FireBee\MLAB\firebee1\firebee1.asm
FEB 0x000526 program static C:\FireBee\MLAB\firebee1\firebee1.asm
SCHALTJAHR 0x00052c program static C:\FireBee\MLAB\firebee1\firebee1.asm
NEXT_MONTH 0x000532 program static C:\FireBee\MLAB\firebee1\firebee1.asm
YEAR 0x00053e program static C:\FireBee\MLAB\firebee1\firebee1.asm
NOT_FEB 0x000546 program static C:\FireBee\MLAB\firebee1\firebee1.asm
MEHR_ALS_30_TAGE 0x00054c program static C:\FireBee\MLAB\firebee1\firebee1.asm
NOT_APRIL 0x000554 program static C:\FireBee\MLAB\firebee1\firebee1.asm
NOT_JUNI 0x00055c program static C:\FireBee\MLAB\firebee1\firebee1.asm
NOT_SEP 0x000564 program static C:\FireBee\MLAB\firebee1\firebee1.asm

View File

@@ -34,7 +34,7 @@ file_000=no
file_001=no
[FILE_INFO]
file_000=firebee1.asm
file_001=C:\Program Files (x86)\Microchip\MPASM Suite\LKR\18f4520_g.lkr
file_001=firebee1.lkr
[SUITE_INFO]
suite_guid={6B3DAA78-59C1-46DD-B6AA-DBDAE4E06484}
suite_state=

View File

@@ -1,71 +0,0 @@
[Header]
MagicCookie={0b13fe8c-dfe0-40eb-8900-6712719559a7}
Version=1.0
[File000]
Location=C:\FireBee\MLAB\firebee1\firebee1.o
Folder=Intermediary
DeviceName=PIC18F4520
LanguageToolSuiteID={6B3DAA78-59C1-46DD-B6AA-DBDAE4E06484}
LanguageToolID={49D3CA3F-D9A3-4518-9943-226A347E8CC7}
LanguageToolLocation=C:\Program Files (x86)\Microchip\MPASM Suite\MPASMWIN.exe
PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)||$(INCDIR)||$(LIBDIR)||$(LKRDIR)||
SOLK=<src>|firebee1.asm||<obj>||<lib>||<lkr>|C:\Program Files (x86)\Microchip\MPASM Suite\LKR\18f4520_g.lkr||
SuiteArgsString=
ToolArgsString=
TraceCmdString=
DebugOptions=
[File001]
Location=C:\FireBee\MLAB\firebee1\firebee1.err
Folder=Intermediary
DeviceName=PIC18F4520
LanguageToolSuiteID={6B3DAA78-59C1-46DD-B6AA-DBDAE4E06484}
LanguageToolID={49D3CA3F-D9A3-4518-9943-226A347E8CC7}
LanguageToolLocation=C:\Program Files (x86)\Microchip\MPASM Suite\MPASMWIN.exe
PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)||$(INCDIR)||$(LIBDIR)||$(LKRDIR)||
SOLK=<src>|firebee1.asm||<obj>||<lib>||<lkr>|C:\Program Files (x86)\Microchip\MPASM Suite\LKR\18f4520_g.lkr||
SuiteArgsString=
ToolArgsString=
TraceCmdString=
DebugOptions=
[File002]
Location=C:\FireBee\MLAB\firebee1\firebee1.lst
Folder=Output
DeviceName=PIC18F4520
LanguageToolSuiteID={6B3DAA78-59C1-46DD-B6AA-DBDAE4E06484}
LanguageToolID={49D3CA3F-D9A3-4518-9943-226A347E8CC7}
LanguageToolLocation=C:\Program Files (x86)\Microchip\MPASM Suite\MPASMWIN.exe
PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)||$(INCDIR)||$(LIBDIR)||$(LKRDIR)||
SOLK=<src>|firebee1.asm||<obj>||<lib>||<lkr>|C:\Program Files (x86)\Microchip\MPASM Suite\LKR\18f4520_g.lkr||
SuiteArgsString=
ToolArgsString=
TraceCmdString=
DebugOptions=
[File003]
Location=C:\FireBee\MLAB\firebee1\firebee1.cof
Folder=Output
DeviceName=PIC18F4520
LanguageToolSuiteID={6B3DAA78-59C1-46DD-B6AA-DBDAE4E06484}
LanguageToolID={96C98149-AA1B-4CF9-B967-FAE79CAB663C}
LanguageToolLocation=C:\Program Files (x86)\Microchip\MPASM Suite\mplink.exe
PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)||$(INCDIR)||$(LIBDIR)||$(LKRDIR)||
SOLK=<src>|firebee1.asm||<obj>||<lib>||<lkr>|C:\Program Files (x86)\Microchip\MPASM Suite\LKR\18f4520_g.lkr||
SuiteArgsString=
ToolArgsString=/o"$(BINDIR_)$(TARGETBASE).cof" /M"$(BINDIR_)$(TARGETBASE).map" /W
TraceCmdString=
DebugOptions=
[File004]
Location=C:\FireBee\MLAB\firebee1\firebee1.hex
Folder=Output
DeviceName=PIC18F4520
LanguageToolSuiteID={6B3DAA78-59C1-46DD-B6AA-DBDAE4E06484}
LanguageToolID={96C98149-AA1B-4CF9-B967-FAE79CAB663C}
LanguageToolLocation=C:\Program Files (x86)\Microchip\MPASM Suite\mplink.exe
PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)||$(INCDIR)||$(LIBDIR)||$(LKRDIR)||
SOLK=<src>|firebee1.asm||<obj>||<lib>||<lkr>|C:\Program Files (x86)\Microchip\MPASM Suite\LKR\18f4520_g.lkr||
SuiteArgsString=
ToolArgsString=/o"$(BINDIR_)$(TARGETBASE).cof" /M"$(BINDIR_)$(TARGETBASE).map" /W
TraceCmdString=
DebugOptions=
[TOOL_LOC_STAMPS]
tool_loc{49D3CA3F-D9A3-4518-9943-226A347E8CC7}=C:\Program Files (x86)\Microchip\MPASM Suite\MPASMWIN.exe
tool_loc{96C98149-AA1B-4CF9-B967-FAE79CAB663C}=C:\Program Files (x86)\Microchip\MPASM Suite\mplink.exe

Binary file not shown.

View File

@@ -1,156 +0,0 @@
MPLINK 4.33, Linker
Linker Map File - Created Mon Jan 11 14:35:58 2010
Section Info
Section Type Address Location Size(Bytes)
--------- --------- --------- --------- ---------
Reset_Vector code 0x000000 program 0x000004
.cinit romdata 0x000004 program 0x000002
LOW_INT_VEC code 0x000018 program 0x00004a
.code code 0x000100 program 0x00033c
Program Memory Usage
Start End
--------- ---------
0x000000 0x000005
0x000018 0x000061
0x000100 0x00043b
908 out of 33048 program addresses used, program memory utilization is 2%
Symbols - Sorted by Name
Name Address Location Storage File
--------- --------- --------- --------- ---------
AD_ISR 0x000326 program static C:\firebee\MLAB\firebee1\firebee1.asm
FEB 0x0003ee program static C:\firebee\MLAB\firebee1\firebee1.asm
HLVD_ISR 0x000300 program static C:\firebee\MLAB\firebee1\firebee1.asm
HLVD_LE 0x00031a program static C:\firebee\MLAB\firebee1\firebee1.asm
INT_HANDLER 0x00001e program static C:\firebee\MLAB\firebee1\firebee1.asm
INT_HANDLER2 0x00002e program static C:\firebee\MLAB\firebee1\firebee1.asm
KALT_START 0x000100 program static C:\firebee\MLAB\firebee1\firebee1.asm
LADESTROM 0x0001d2 program static C:\firebee\MLAB\firebee1\firebee1.asm
LS_OFF_POWER 0x0001de program static C:\firebee\MLAB\firebee1\firebee1.asm
LS_ON_POWER 0x0001d8 program static C:\firebee\MLAB\firebee1\firebee1.asm
MAIN 0x00019e program static C:\firebee\MLAB\firebee1\firebee1.asm
MEHR_ALS_28_TAGE 0x0003e6 program static C:\firebee\MLAB\firebee1\firebee1.asm
MEHR_ALS_30_TAGE 0x000414 program static C:\firebee\MLAB\firebee1\firebee1.asm
MINUTEN 0x0003c0 program static C:\firebee\MLAB\firebee1\firebee1.asm
NEXT_MONTH 0x0003fa program static C:\firebee\MLAB\firebee1\firebee1.asm
NON_SYNC 0x0002ae program static C:\firebee\MLAB\firebee1\firebee1.asm
NOT_APRIL 0x00041e program static C:\firebee\MLAB\firebee1\firebee1.asm
NOT_FEB 0x00040e program static C:\firebee\MLAB\firebee1\firebee1.asm
NOT_JUNI 0x000428 program static C:\firebee\MLAB\firebee1\firebee1.asm
NOT_SEP 0x000432 program static C:\firebee\MLAB\firebee1\firebee1.asm
PINGS 0x000368 program static C:\firebee\MLAB\firebee1\firebee1.asm
PINGS2 0x000380 program static C:\firebee\MLAB\firebee1\firebee1.asm
POWER_AUS 0x0001c0 program static C:\firebee\MLAB\firebee1\firebee1.asm
POWER_EIN 0x0001a6 program static C:\firebee\MLAB\firebee1\firebee1.asm
POWER_OFF_I 0x000346 program static C:\firebee\MLAB\firebee1\firebee1.asm
POWER_OFF_I2 0x000356 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_ISR 0x000256 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_ISR1 0x000268 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_ISR2 0x000274 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_RFM 0x000290 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_RRFP 0x000280 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_SYNC2 0x0002b4 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_SYNC3 0x0002c6 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_SYNC4 0x0002d8 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_SYNC_START 0x00029c program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_UNBEK 0x00027c program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_WAIT1 0x0002e4 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_WAIT2 0x0002ec program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_WAIT3 0x0002f4 program static C:\firebee\MLAB\firebee1\firebee1.asm
RESETEN 0x000232 program static C:\firebee\MLAB\firebee1\firebee1.asm
RTC_ISR 0x000326 program static C:\firebee\MLAB\firebee1\firebee1.asm
SCHALTJAHR 0x0003f4 program static C:\firebee\MLAB\firebee1\firebee1.asm
SEKUNDEN 0x000386 program static C:\firebee\MLAB\firebee1\firebee1.asm
SEK_2 0x0003ac program static C:\firebee\MLAB\firebee1\firebee1.asm
SEK_NPA 0x00039c program static C:\firebee\MLAB\firebee1\firebee1.asm
SEND_RTC_REG 0x00020c program static C:\firebee\MLAB\firebee1\firebee1.asm
STUNDEN 0x0003ca program static C:\firebee\MLAB\firebee1\firebee1.asm
TAGE_UND_TAG_DER_WOCHE 0x0003d4 program static C:\firebee\MLAB\firebee1\firebee1.asm
TASTE 0x0001e4 program static C:\firebee\MLAB\firebee1\firebee1.asm
TG_END 0x00022c program static C:\firebee\MLAB\firebee1\firebee1.asm
TG_JA 0x0001fa program static C:\firebee\MLAB\firebee1\firebee1.asm
TG_OFF_POWER 0x000224 program static C:\firebee\MLAB\firebee1\firebee1.asm
TG_ON_POWER 0x000206 program static C:\firebee\MLAB\firebee1\firebee1.asm
TG_ON_POWER2 0x000212 program static C:\firebee\MLAB\firebee1\firebee1.asm
TG_ON_POWER3 0x000218 program static C:\firebee\MLAB\firebee1\firebee1.asm
TX_ISR 0x00023c program static C:\firebee\MLAB\firebee1\firebee1.asm
TX_ISR1 0x000254 program static C:\firebee\MLAB\firebee1\firebee1.asm
TX_ISR_FERTIG 0x00024c program static C:\firebee\MLAB\firebee1\firebee1.asm
WAIT_LVDOK 0x000312 program static C:\firebee\MLAB\firebee1\firebee1.asm
WARTEN 0x0001a0 program static C:\firebee\MLAB\firebee1\firebee1.asm
YEAR 0x000406 program static C:\firebee\MLAB\firebee1\firebee1.asm
Symbols - Sorted by Address
Name Address Location Storage File
--------- --------- --------- --------- ---------
INT_HANDLER 0x00001e program static C:\firebee\MLAB\firebee1\firebee1.asm
INT_HANDLER2 0x00002e program static C:\firebee\MLAB\firebee1\firebee1.asm
KALT_START 0x000100 program static C:\firebee\MLAB\firebee1\firebee1.asm
MAIN 0x00019e program static C:\firebee\MLAB\firebee1\firebee1.asm
WARTEN 0x0001a0 program static C:\firebee\MLAB\firebee1\firebee1.asm
POWER_EIN 0x0001a6 program static C:\firebee\MLAB\firebee1\firebee1.asm
POWER_AUS 0x0001c0 program static C:\firebee\MLAB\firebee1\firebee1.asm
LADESTROM 0x0001d2 program static C:\firebee\MLAB\firebee1\firebee1.asm
LS_ON_POWER 0x0001d8 program static C:\firebee\MLAB\firebee1\firebee1.asm
LS_OFF_POWER 0x0001de program static C:\firebee\MLAB\firebee1\firebee1.asm
TASTE 0x0001e4 program static C:\firebee\MLAB\firebee1\firebee1.asm
TG_JA 0x0001fa program static C:\firebee\MLAB\firebee1\firebee1.asm
TG_ON_POWER 0x000206 program static C:\firebee\MLAB\firebee1\firebee1.asm
SEND_RTC_REG 0x00020c program static C:\firebee\MLAB\firebee1\firebee1.asm
TG_ON_POWER2 0x000212 program static C:\firebee\MLAB\firebee1\firebee1.asm
TG_ON_POWER3 0x000218 program static C:\firebee\MLAB\firebee1\firebee1.asm
TG_OFF_POWER 0x000224 program static C:\firebee\MLAB\firebee1\firebee1.asm
TG_END 0x00022c program static C:\firebee\MLAB\firebee1\firebee1.asm
RESETEN 0x000232 program static C:\firebee\MLAB\firebee1\firebee1.asm
TX_ISR 0x00023c program static C:\firebee\MLAB\firebee1\firebee1.asm
TX_ISR_FERTIG 0x00024c program static C:\firebee\MLAB\firebee1\firebee1.asm
TX_ISR1 0x000254 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_ISR 0x000256 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_ISR1 0x000268 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_ISR2 0x000274 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_UNBEK 0x00027c program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_RRFP 0x000280 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_RFM 0x000290 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_SYNC_START 0x00029c program static C:\firebee\MLAB\firebee1\firebee1.asm
NON_SYNC 0x0002ae program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_SYNC2 0x0002b4 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_SYNC3 0x0002c6 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_SYNC4 0x0002d8 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_WAIT1 0x0002e4 program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_WAIT2 0x0002ec program static C:\firebee\MLAB\firebee1\firebee1.asm
RC_WAIT3 0x0002f4 program static C:\firebee\MLAB\firebee1\firebee1.asm
HLVD_ISR 0x000300 program static C:\firebee\MLAB\firebee1\firebee1.asm
WAIT_LVDOK 0x000312 program static C:\firebee\MLAB\firebee1\firebee1.asm
HLVD_LE 0x00031a program static C:\firebee\MLAB\firebee1\firebee1.asm
RTC_ISR 0x000326 program static C:\firebee\MLAB\firebee1\firebee1.asm
AD_ISR 0x000326 program static C:\firebee\MLAB\firebee1\firebee1.asm
POWER_OFF_I 0x000346 program static C:\firebee\MLAB\firebee1\firebee1.asm
POWER_OFF_I2 0x000356 program static C:\firebee\MLAB\firebee1\firebee1.asm
PINGS 0x000368 program static C:\firebee\MLAB\firebee1\firebee1.asm
PINGS2 0x000380 program static C:\firebee\MLAB\firebee1\firebee1.asm
SEKUNDEN 0x000386 program static C:\firebee\MLAB\firebee1\firebee1.asm
SEK_NPA 0x00039c program static C:\firebee\MLAB\firebee1\firebee1.asm
SEK_2 0x0003ac program static C:\firebee\MLAB\firebee1\firebee1.asm
MINUTEN 0x0003c0 program static C:\firebee\MLAB\firebee1\firebee1.asm
STUNDEN 0x0003ca program static C:\firebee\MLAB\firebee1\firebee1.asm
TAGE_UND_TAG_DER_WOCHE 0x0003d4 program static C:\firebee\MLAB\firebee1\firebee1.asm
MEHR_ALS_28_TAGE 0x0003e6 program static C:\firebee\MLAB\firebee1\firebee1.asm
FEB 0x0003ee program static C:\firebee\MLAB\firebee1\firebee1.asm
SCHALTJAHR 0x0003f4 program static C:\firebee\MLAB\firebee1\firebee1.asm
NEXT_MONTH 0x0003fa program static C:\firebee\MLAB\firebee1\firebee1.asm
YEAR 0x000406 program static C:\firebee\MLAB\firebee1\firebee1.asm
NOT_FEB 0x00040e program static C:\firebee\MLAB\firebee1\firebee1.asm
MEHR_ALS_30_TAGE 0x000414 program static C:\firebee\MLAB\firebee1\firebee1.asm
NOT_APRIL 0x00041e program static C:\firebee\MLAB\firebee1\firebee1.asm
NOT_JUNI 0x000428 program static C:\firebee\MLAB\firebee1\firebee1.asm
NOT_SEP 0x000432 program static C:\firebee\MLAB\firebee1\firebee1.asm

View File

@@ -1,125 +0,0 @@
PS2 -> Atari /Amiga Mouse Adapter
~~~~~~~~~~~~~~~~~~~~~~~
Version 1.4 July 2010
Due to the short supply of mice for the Atari computers I decided to build an adapter that would allow me to use a serial mouse on my Atari, but even these are getting a bit old now, so I got the soldering iron out again and here's the result. A PS2 Mouse adapter for the Atari. It supports a standard PS2 mouse with 2 or 3 buttons and can also be used with the Microsoft optical IntelliMouse that comes with a USB to PS2 adapter. The middle button on the PS2 mouse is used as a left click and hold function for easy selection. Click the middle button again to release. Now for the bad news, for some reason Microsoft mice don't support the middle button in standard PS2 mode. :-(
Please don't shout at me all you Atari users but as an added feature if you change a link then the adapter can be used with an Amiga as well.
All files, programs etc contained in this archive are copright 2010 by Tom Kirk. Personal use is allowed but any commercial use is not allowed. Please feel free to use my work but don't rip me off.
Files in this archive.
~~~~~~~~~~~~~~~~~~~~~~
readme.txt This text file
circuit.bmp Picture of circuit in bitmap format
PS2Atari_v1_4.hex Object code of the PIC16F84 program in Intel hex
PS2Atari_v1_4.asm Source code of the PIC16F84 program
pcbtop.bmp Top layer of the PCB in bitmap format
pcbbot.bmp Bottom layer of the PCB in bitmap format
Technical Details.
~~~~~~~~~~~~~~~~~~
When the PS2 mouse is moved or a button changes state a packet of data is sent, my circuit decodes this data and then simulates the Atari mouse.
The circuit consists of a single microcontroller that contains a program to do the conversion. The circuit is shown in the file circuit.bmp
The microcontroller (PIC) can be either a PIC16C84 or PIC16F84 or PIC16F84A.
The PIC (IC1) needs to be programmed with the program.
The program is supplied in two forms PS2Atari_v1_4.hex is an object code file in Intel hex and can be read by most programmers capable of programming the PIC
PS2Atari_v1_4.asm is the source code of the program and can be assembled with the free MPLAB / MPASM software from Microchip if you wish to create your own object file. Note needs "Disable case sensitivity" under build options setting in MPLAB to assemble without errors.
The PIC should be programmed with oscillator as XT, watchdog disabled, powerup timer enabled and code protection off. (No point code protecting a freely available program.)
The source code and object code is compatible with all the PIC microcontrollers listed above.
I've built mine using a printed circuit board but it's small enough to be built using a small piece of stripboard.
On my PCB I have a 6 pin mini din socket at one end and a 9 pin D type socket at the other. I can then use a standard port extender lead to connect to the Atari. I've found that a 9 pin PC serial extension lead can also be used for this as well if you remove the fastening screws.
If you decide to build one on a piece of stripboard it will be easier to use cable mounted sockets as PCB types don't fit onto a stripboard.
Once built the board can be mounted into a small plastic box.
No special software is required on the Atari and it will work with all software.
Your favourite mouse accelerator program may be used if required.
Parts list.
~~~~~~~~~~~
IC1 PIC16F84A or PIC16F84 or PIC16C84
Fi1 4 MHz Ceramic resonator
R1 10K
R2 10K
C1 4.7 uF
C2 0.1 uF
All capacitors should be rated at 16V or more.
CN1 6 pin mini din PCB mounting socket
CN2 9 Pin D type PCB mounting socket
JP1 3 pin header and 2 way link
If building on a piece of stripboard I suggest using cable mounting types of connectors and use a small piece of multicore cable between the sockets and the stripboard. You will find the PCB sockets do not fit on a piece of stripboard.
If you don't need the switchable Atari/Amiga support forget the 3 pin header and just use a wire link instead.
History.
~~~~~~~~
Version 1.4 July 2010
Unused Pin RA4 now correctly set as an imput.
(Pin is tied to +5V on PCB for easier PCB routing.)
My oversight when transfering from prototype to PCB.
Thanks to Luciano for informing me.
Version 1.3 Released March 2010
Corrected a bug in button routine preventing both buttons being active together under certain conditions.
Thanks to Oliver Fleischmann for informing me.
(Can't believe it taken 6 Years for this bug to show itself!!)
Version 1.2 Released March 2009
Changed left/right button outputs to fake open collector.
Needed to stop conflits when using a joystick pluged into other port.
Version 1.1 Released September 2004.
Added support for the Amiga and added the middle button support.
Version 1.0 Never released.
My original version for the Atari only.
Help.
~~~~~
If you need further information or help then contact me at tgkirk@aol.com
Please allow a few days for a reply as I have other commitments as well.
Tom Kirk July 2010
P.S. I also have on my web site a Playstation controller to Atari adapter and a PC viewer for Atari format picture files.
http://www.tgkirk.110mb.com