Jump to content
d2squared

Interrupt Service Routine Too Transparent

Recommended Posts

Hi everyone.

 

I hope this finds you well. This is my first project with BoostC so please be gentle with me … my comfort zone has always been assembly language, when it comes to PIC … all right, let me explain what I'm trying to do … first of all, the PIC I'm using for this project is the PIC16F877A. to drive 2 stepper motors I am using the compare module in conjunction with the TMR0; due to the 19.66 MHz crystal oscillator I have to use, TMR0 must overflow 4x times to get a 40ms period. meanwhile, the compare module will clear RC1 and RC2 when TMR1 reaches the value store in CCPRxH:CCPRxL. I have implemented something similar in assembly language and it worked so it should work, right?

anyway, the problem I have is that, for some reason, the interrupt never happens! I've checked flags and enable bits and it looks all good but I must have missed something. I'll be really grateful if you can spot that. I have enclosed here the source code. for testing purpose I've plugged in an LED on PORTA.0 and turn it ON within the Interrupt Service Routine (ISR) but it remains OFF thus the interrupt for TMR0 overflow never happens.

 

thank you for your time!

test.c

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...