I'm trying to get some simple demo programs to work on an STC8A8K64S4A12
board.

But it seems I don't understand CLKDIV.

* According to the datasheet, at system startup, the main clock is 24
Mhz, and the system clock is the main clock divided by CLKDIV, which has
a reset value of 8, so I think the system clock should be 3 Mhz.
However, when I set up timer 0, which AFAIK is driven by the system
clock, to deliver intervals at a constant rate, it behaves as if driven
by a 24 Mhz clock.

* I don't know how to change SYCLK. According to the datasheet, this is
a memory-mapped register at address 0xfe01. So I tried #define CLKDIV
(*(__xdata uint8_t *)(0xfe01)), but no matter what value I assign to it
(tried leaving it at the default that should be 8, tried setting to 1,
tried setting to 255), my program runs at exactly the same speed (tested
using an infinite loop of unsigned long divisions and toggling LEDs
based on the number of iterations).

Philipp


_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to