Skip to content
Please note that GitHub no longer supports your web browser.

We recommend upgrading to the latest Google Chrome or Firefox.

Learn more
Permalink
Browse files

enable weak pull-up at reset line to console if low-active is detected

Some CPUs (especially those in Twin Famicoms) seems to not have an internal weak pull-up (WPU). Without the PICs WPU, one has to reset the console once to get the console running. This commit resolves that issue.
Thank you to voultar (Assemblergames forum user) and to Zachary for reporting and testing!
  • Loading branch information...
borti4938 borti4938
borti4938 authored and borti4938 committed Feb 27, 2016
1 parent bde843e commit 6e478129b5cfa9a209ac8781f8fe4260d0d1926d
@@ -753,8 +753,16 @@ detect_reset_type
btfss PORTA, RESET_IN ; jump next instruction for low-active reset
movwf reg_reset_type

lowreset_cpu_help
skipnext_for_lowreset
goto set_led_type
banksel TRISA
M_movlf 1<<RESET_OUT, WPUA
bcf OPTION_REG, NOT_RAPU ; enable global pull-up
banksel PORTA

set_led_type
call setleds ; set LEDs according to teh LED type
call setleds ; set LEDs according to the LED type

init_end
clrf reg_ctrl_reset ; clear this reg here just in case
@@ -771,6 +771,14 @@ detect_reset_type
btfss PORTA, RESET_IN ; jump next instruction for low-active reset
movwf reg_reset_type

lowreset_cpu_help
skipnext_for_lowreset
goto set_led_type
banksel TRISA
M_movlf 1<<RESET_OUT, WPUA
bcf OPTION_REG, NOT_RAPU ; enable global pull-up
banksel PORTA

set_led_type
call setleds ; set LEDs according to teh LED type

0 comments on commit 6e47812

Please sign in to comment.
You can’t perform that action at this time.