Re: [Flashforth-devel] more fun with PIC18F46K22-s...
Brought to you by:
oh2aun
From: Mikael N. <mik...@fl...> - 2019-12-10 07:44:47
|
Hi Craig. In fact all interrupts are serviced. My point was just that it takes clock cycles when on the PIC18 you need to scan all potential interrupt flags even if only one flag is set. To optimize that a little bit the system tick code does a RETFIE without checking any further interrupts. These will then be serviced immediately afterwards when the interrupt code is called again. Another tip is the use a lower system tick resolution. It will reduce the load a little bit. You can configure the system tick time in the latest FFs. Do you really need a 1 ms resolution ? The buffers do not need to be aligned, but the size needs to be a power of 2. The _FULL_BIT macros are checking the fill level counter. You can use TMR2 to control the HW PWM frequency. I suppose the A/D can just be polled whenever, as long as it is often enough. I removed the buffered TX because I never used it. And I never heard of anyone using it either. But I have never pushed the PICs to the limit. Just using soft realtime :-) BR Mikael On 2019-12-09 16:31, craig bair via Flashforth-devel wrote: > Mikael, > Thanks much! I'll see if I can get these suggestions to work for me this next weekend. > > I didn't know that the user interrupts might not be getting serviced, I may try setting up some vectors in eeprom and hook the main interrupt service to check them if they're set to something valid. I've extended the sys-tick to 32 bits and added a word "dticks" to toss the double onto the stack when needed. > > I've looked back into the Buffered TX code and still don't see the hole that the character is leaking out of when the output string exceeds the buffer size, but since I'm going to use output packets of less than 32 bytes for my TX2 it might work to roll a custom version back into the kernal. It looks like you were using the linker to align all of the buffers on 16 byte boundries back then. Do the "**_FULL_BIT" macros rely on that? (I never used linker scripts, I just hard-positioned my variables in the *.asm (grin)). > > Oh, and yes, I'm pushing the chip to 64mhz. I haven't tried overclocking yet. > > Thanks Again! (and keep smiling), > craig |