PIC16F873 Assembly Update – Add Gate Auto-Close & Build HEX
Budget: $25 – $50 AUD
Legacy PIC16F873 assembly code (sp501404.asm, ~5000 lines, v4.04/4.05) needs a small update: add automatic gate-close when gate is detected open unexpectedly (not from dose/trigger/manual-open).
The code block to insert (in READINP after INP8, before NOIP/RETURN) is ready:
textBTFSS INPUTS,6 ; Skip if closed
GOTO NOIP
BTFSC SYSTAT2,2 ; Skip if manual open mode
GOTO NOIP
BANK1
MOVF OPENPULSE,F ; Skip if open pulse active
BTFSS ZERO
GOTO NOIP
MOVF CLOSEPULSE,F ; Skip if close pulse active
BTFSS ZERO
GOTO NOIP
MOVF DOSETIME,F ; Skip if dose timer active
BTFSS ZERO
GOTO DOSETIME_LSB_CHECK
MOVF DOSETIME+1,F
BTFSS ZERO
GOTO NOIP
DOSETIME_LSB_CHECK:
BANK0
GOTO CHKCL
Tasks:
Insert the block in the correct place (with comments)
Fix compilation issues for modern MPASM (replace ORG 0x20 + RES lines with CBLOCK, remove any # immediates)
Build clean HEX using MPLAB X + MPASM (v5.xx–v6.xx preferred)
Deliverables:
Updated .asm file (changes commented)
Compiled .hex file
Brief note confirming clean build
Skills needed:
PIC16 mid-range assembly (PIC16F873 experience ideal)
MPASM + MPLAB X (v5 or v6)
Fixing legacy code (CBLOCK conversion, banking)
No hardware testing needed – we test on device with PICkit 4.
Fast turnaround preferred (1–3 days).
Original .asm provided upon award.
Please bid with your PIC assembly experience and whether you already have MPLAB X + MPASM set up. Thanks!
The code block to insert (in READINP after INP8, before NOIP/RETURN) is ready:
textBTFSS INPUTS,6 ; Skip if closed
GOTO NOIP
BTFSC SYSTAT2,2 ; Skip if manual open mode
GOTO NOIP
BANK1
MOVF OPENPULSE,F ; Skip if open pulse active
BTFSS ZERO
GOTO NOIP
MOVF CLOSEPULSE,F ; Skip if close pulse active
BTFSS ZERO
GOTO NOIP
MOVF DOSETIME,F ; Skip if dose timer active
BTFSS ZERO
GOTO DOSETIME_LSB_CHECK
MOVF DOSETIME+1,F
BTFSS ZERO
GOTO NOIP
DOSETIME_LSB_CHECK:
BANK0
GOTO CHKCL
Tasks:
Insert the block in the correct place (with comments)
Fix compilation issues for modern MPASM (replace ORG 0x20 + RES lines with CBLOCK, remove any # immediates)
Build clean HEX using MPLAB X + MPASM (v5.xx–v6.xx preferred)
Deliverables:
Updated .asm file (changes commented)
Compiled .hex file
Brief note confirming clean build
Skills needed:
PIC16 mid-range assembly (PIC16F873 experience ideal)
MPASM + MPLAB X (v5 or v6)
Fixing legacy code (CBLOCK conversion, banking)
No hardware testing needed – we test on device with PICkit 4.
Fast turnaround preferred (1–3 days).
Original .asm provided upon award.
Please bid with your PIC assembly experience and whether you already have MPLAB X + MPASM set up. Thanks!
Related categories:
Electronics
Microcontroller
Assembly
Debugging
Software Development
Embedded Systems
Software Engineering