Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7488309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T14:50:05+00:00 2026-05-29T14:50:05+00:00

The embedded system in question is the PIC 16F877 and I’m trying to increment

  • 0

The embedded system in question is the PIC 16F877 and I’m trying to increment the PORTC register with incfsz but it remains at 0. The tutorial says this is possible but I can’t get it to work.

list p=16f877
include "p16f877.inc"

__CONFIG    _CP_OFF & _CPD_OFF & _LVP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_OFF & _XT_OSC


org 0x000           ; Start at the reset vector
nop                 ; Reserved for ICD in debu mode

Init
banksel PORTC
clrf    PORTC       ; Clear PORTC initially


; Set up the Timer0 control register

banksel OPTION_REG
movlw   B'10000111' ; Internal clock, prescaler assigned to Timer0
movwf   OPTION_REG  ; prescaler, 1:256

clrf    TRISC       ; PORTC all output  

banksel PORTC       ; Back to Bank 0

movlw   B'00000000'
Main

; Timer0 delay for acquisition


btfss   INTCON,T0IF ; Loop until T0IF = 1 (TMR0 rollover)
goto    Main
bcf     INTCON,T0IF
incfsz  PORTC , F  
goto Main


LoopWhilePushed         ; Loop if PORTB<0> = 0 (pressed)

btfss   PORTB,0
goto    LoopWhilePushed

goto    Main        ; Do it again

end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T14:50:06+00:00Added an answer on May 29, 2026 at 2:50 pm

    As a novice I cant do that, so I gave up on PORTC and defined a constant, incremented that and moved that WORKING regsiter into portc and got the same results. Yep Im a quitter.

    UPDATE: As it turns out this it was subtle a hardware error that allowed all of the other experiments to function but prevent this one from working. It was not discovered until the circuit was rewired out of spite.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Again I have a question about an ssh issue: On a embedded system (no
I'm trying to cross-compile the OpenCV library for using it on an embedded system
I worked on an embedded system this summer written in straight C. It was
We have a small embedded system without any video or serial ports (i.e. we
On a small embedded system project we have some code which we would like
For an embedded system I need to place a few data structures at fixed
I'm developing an embedded system which currently boots linux with console output on serial
A legacy embedded system is implemented using a cooperative multi-tasking scheduler. The system essentially
In our embedded system (using a PowerPC processor), we want to disable the processor
I am working in embedded system domain. I would like to know how a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.