flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
rhyno_dagreat
![]() ![]() Jokes aside, though, go here: http://www.osdever.net/bkerndev/index.php and check the tutorial on the PIT. It's pretty handy. |
|||
![]() |
|
dosin
lol! thanks!
|
|||
![]() |
|
rhyno_dagreat
No problem!
![]() |
|||
![]() |
|
LocoDelAssembly
Quote:
Maybe I'm misreading you but, wouldn't it be 18.222 interrupts per second rather than the timer turns off every 18.222 seconds? |
|||
![]() |
|
bitRAKE
IIRC, there is a way to acknowledge the IRQ has been handled - resetting the delay counter. Otherwise, it fires off every chance it gets.
|
|||
![]() |
|
rhyno_dagreat
LocoDelAssembly wrote:
You're right. I apologize, though what you said is actually what I meant to type. ![]() |
|||
![]() |
|
sinsi
Try this file - I can't remember where I got it from, but it's pretty good.
Although I would use 1193 instead of 1192 - this gives 1000.15 vs 1000.99
|
|||||||||||
![]() |
|
edfed
1000 int/second is too much
int spend time push eflag, push eip, push cs pop cs, pop eip, pop eflag these 6 inherent instructions are repeat 1000 time/second. it's too much for my OS, i'm thinking about a 110Hz timer; cnt=10847,1 closer to 110 int/second, musical frequency 'LA' or 24int/second for cinema FPS, cnt=49715,19{6} or a real integral int/second, to see later. PS: one strange thing, 1193182Hz is 1234DEh, note the 1234 string amazing, no? |
|||
![]() |
|
sinsi
That's the beauty of the code - just change "mov ax,1192" to your chosen divisor and you can go from 18.2 to 1,193,182(theoretically), but the comments say that a pentium 100(?) can run at 100,000 ticks/sec.
push,push,push/pop,pop,pop - this takes no time now (or at least very little) - it's all automatic. |
|||
![]() |
|
roboman
http://www.powerbasic.com/files/pub/asm/8259.ZIP
is a good doc on the int chip on the pc. Also if you dig around in a lot of stepper motor control programs they use either the 8259 timer or the pent cpu built in timer |
|||
![]() |
|
dosin
Thanks- I'll take a look!
|
|||
![]() |
|
edfed
in case of cached stack, it is really fast. but takes at least 6 PUSH/POP, 6 cpu cycles.
but if the stack is in real ram, then you must wait RAM latency, it's a long time. more than 6 cpu cycle ok , it's only 6 Push/pop, but in am, we shall code the fatest program as possible. what about the 44100Hz audio sample rate? how to make this one stable? is it integrated in the sound chip or the DMA controler? |
|||
![]() |
|
Dex4u
If in your clocktick IRQ it increaser's a counter every tick, from startup of your OS.
You just need function that gets count. Example Code: mov ax,6 ;function numberint 40h ; int 40 like dos in 21hmov dword[StartCount],ebx ;returns tick so far in EBX;do what you want timed heremov ax,6 ;function numberint 40h ; int 40 like dos in 21hsub ebx, dword[StartCount] ;sub the start ticksmov dword[StopTime],ebx ; save the ticks that have passed. |
|||
![]() |
|
edfed
value for the nearest integral value of 100
1193182 / 14551 = 82Hz good because integral, no decimal... |
|||
![]() |
|
revolution
edfed wrote: value for the nearest integral value of 100 |
|||
![]() |
|
edfed
erf
![]() by googling besenham, just now, i discover that MY line algorithm is the besenham one... ![]() i didn't know that, it's not the besenham algorithm but the edfed one... ![]() i reinvent the weel everydays, and finally, i see that my weel is circular like all others ![]() what you speak about is not the besenham algorythm, it's a digital PLL, something that regulate the frequency... ![]() |
|||
![]() |
|
revolution
edfed wrote: what you speak about is not the besenham algorythm, it's a digital PLL |
|||
![]() |
|
edfed
hum, by using this in timer, one very bad thing is the quantification error, because the time of periods is variable.
|
||||||||||
![]() |
|
revolution
edfed: You show an extreme case where the two frequencies are very close. Of course the difference will create what you see, it is called clock jitter. I already mentioned it will be 1 unit of difference maximum. So expect some severe jitter if the two frequencies are similar.
In any normal application, good programmers would to chose an interrupt frequency at least 10 times, and preferably >=20 times, the desired output frequency. That way the jitter is small enough to become imperceptible. Using ~1ms interrupt with 25 or 30 fps is a very good solution. |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.