Jump to content

d2squared

Members
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About d2squared

  • Rank
    Newbrie
  1. 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
  2. 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
×
×
  • Create New...