It's more than just a simple interrupt register issue. The asm instructions are wrong for the K42.
See posts #4 and #6.
It's more than just a simple interrupt register issue. The asm instructions are wrong for the K42.
See posts #4 and #6.
Looks like crafting a working DT's Instant Interrupts for the PIC18F27K42 is well beyond my skill set. It may be time for me to learn to write ISRs using assembly language. In addition to the PBP3 reference manual discussion of Assembly Interrupts for PIC 18 Devices, can anyone suggest a good reference for someone who is not familiar with assembly language coding?
Although a bit dated, my first recommendation is "Applying PIC18 Microcontrollers", by Barry B. Brey; Copyright 2008 by Pearson Education. ISBN-13: 978-0-13-088546-3.
Another recommendation is "PIC Microcontrollers; An Introduction to Microelectronics", by Martin Bates; Copyright 2011 by Martin Bates. ISBN: 978-0-08-096911-4.
Same problem in asm, so if you can figure out how an isr works you can do it in pbp as well
Conventional wisdom states that ISRs should do only minimalistic functions. Never call a subroutine from an interrupt handler. Never use PAUSE type statements. In short, turn something on or off, or set a flag you can poll and service in your main loop. With that said, most ISRs can be crafted in ASM with only basic BSF/BCF and perhaps MOVLW/MOVF type commands. Leave the heavy lifting for a subroutine you write in PBP.
Thanks for the additional comments. At this point, all I want is to understand how to write two ISR for a PIC18F27K42 in which upon an overflow interrupt from Timer3 or Timer1, the appropriate ISR increments a counter, clears the interrupt flag, and returns back to the executing PBP subroutine. The PBP routine uses one overflow count to compute a time period . The other overflow count is used to timeout the subroutine . The application is a tachometer that measures RPM from 0 to 12K. My code works with a PIC18F26K22 and DT_INTS-18. I have tried polling the interrupt flags within the PBP subroutine, but at low RPMs and clocking the PIC at 64MHz the results are erratic.
Yes, I could just keep using an 18F26K22, but why not learn something new?
the k42 series smt module in gated counter mode would be an ideal thing for a tacho and probably a simpler set of interrupts to manage.great lets go.
its at this time you realize that pbp has no support for any pic hardware modules that did not exist at least 15 years ago, the last time pbp had a new command the space shuttles still flew.
so if you want to take advantage of the newer pic's powerful built in stuff you need to learn a whole lot of asm
stuff to prop it up. sadly pbp has become a real programming cul de sac. I put my time and effort into a better method mplabx and C and the wonderful MCC [microchip code configurator]. The real beauty of C is its cross platform compatibility, it opens up a whole new world.
that's my newbut why not learn something new?
Bookmarks