Sx/b interrupt
Spiller
Posts: 52
Hi All,
I would like to know what is the value range for SX/B INTERUPT Rate?
I know it depends on the frequency on which the SX works.
If the SX works at 4MHz and the rate is 100, the Interrupt will run at every 10ms.
If the SX works at 50MHz and the the rate is 1000, the Interrupt will run at every 1ms.
If like to speed up the Interrupt and write 10000 for rate I got compile error. So what is the value range for rate?
Best Regards
Spiller
·
I would like to know what is the value range for SX/B INTERUPT Rate?
I know it depends on the frequency on which the SX works.
If the SX works at 4MHz and the rate is 100, the Interrupt will run at every 10ms.
If the SX works at 50MHz and the the rate is 1000, the Interrupt will run at every 1ms.
If like to speed up the Interrupt and write 10000 for rate I got compile error. So what is the value range for rate?
Best Regards
Spiller
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
I think my probles was that I use old version of SX-Key Editor at home. I have tried it at my office with SX-Key Editor v3.2.92h BETA and I could set ISR rate up to 25_000_000 @ 50_000_000 Hz clock. (Not more due to the RTCC 1:2 prescaler)
By
Spiller
The highest practical ISR rate I've ever used in a program (SX at 50MHz) was 750_000 -- did this to create a receive UART and 8-channel dimmer for a DMX512 project. Of course, you can go higher than that, but you're limited to how much you can accomplish within the ISR. Remember, you have to get in and out and that takes a few cycles on each end.
You are right. We can do anything in this ISR rate, it is the theoretical highest limit. I use rate 100_000 @ 50MHz now.
Thanks
Spiller
I have a clocking project that calls fo a 4MHz crystal with a 1000 interupt rate, but I only have a 50MHz crystal. So how would I change the interupt so the clock will keep time correct?
Thanks
Ace227
If the desired interrupt rate is unachievable given the chosen clock freq., the compiler will issue a warning.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
When you say to change the FREQ directive do you mean to put:
FREQ 50_000_000, 4_000_000
or do I put:
FREQ 4_000_000
You will also have to change the crystal drive on the device line to OSCHS2 or something.
Also, if you specify INTERRUPT 1000 with a 50MHz clock the interrupt rate will be about 1001.6 since that is what you get with the value allowed.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1st rule of finance...Don't lose money.
Never be ashamed of making an honest·profit.
Live within your means...Make do, or do without.
·
Reading over the directive documentation (fuse settings) is a must. The fuse bits determine how your SX is actually setup and running (clock freq, brownout, oscillator settings, etc) , and are arguably the most important settings on the device -- the rest is all code and can be changed at runtime.
Thanks Bean for mentioning the OSC setting, which I neglected.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php