Hi,
Pype.Clicker wrote:
we may have different needs, but i used to set control word to 0x43 rather than 0x34.
Pype: You might want to double check that (perhaps confused with IO Port 0x43?)...
For 0x34 you end up with:
- channel 0
- lobyte/hibyte
- mode 2 (rate generator)
- binary
For 0x43 you end up with:
- channel 1
- counter latch
- mode 1 (hardware-retriggerable one-shot)
- BCD
IMHO "outportb(I8254_CTRL, 0x34);" is probably entirely correct.
That said, I've never trusted compilers when it comes to the order they convert variable sizes. For example, for "u16 ticks = MAX_CLOCK / frequency" does the compiler convert MAX_CLOCK and frequency to 16 bits
before doing the division, or does it do a 32 bit division and convert it to 16 bits
after? It's probably just my own lack of C knowlege (and the fact that I can't think of anything else wrong with the code), but no harm done if I'm chasing shadows right?
...
Cheers,
Brendan