2003-06-02 11:20 PM
2003-05-28 01:48 AM
Hello,
I do not manage to put on the timer A of the ST7. I would want a temporization of 10 µs or 100 µs. I have an oscillator of 16 Mhz. are that somebody could help me... The language: C with Cosmic Thank you in advance.[ Ce message a ete modifié par : : Guigoun on 28-05-2003 16:58 ]2003-05-28 02:54 AM
For using the timer for 10 usec (@ 8 MHz CPU frequency) you need to do the following register settings:
TACR2 = 0x08; /* timer clock = fcpu/8 */ TACR1 = 0x40; /* output compare interrupt enabled*/ TAOC1HR = 0x00; TAOC1LR = 0x0a; In ISR routine , increment the TAOC1xR registers by (0x0a) to get the next interrupt after another 10 usec*/ For more explanation, You can refer an application note AN974 downloadable from the same site.2003-05-28 04:22 AM
Thank you very much for your help.
Be that you know the configurations of vectors and segments which are necessary for the programming? My ST7 ignores the interruptions and I do not find the error... Greeting2003-05-30 02:45 AM
There is a special assembly instruction to enable the interrupts: RIM that you can include in your C Cosmic file as follows:
asm RIM; For the complete structure (vector.c containing the interrupt vector and their mapping), you have examples in the install path of STVD7, the debugger delivered for free by ST downloadable from this site. It can be used with assembly, C Cosmic or C Metrowerks.2003-06-02 05:51 PM
I hope you are using the @interrupt qualifier? Eg :
@interrupt void handler(void) {... }2003-06-02 11:20 PM
Yes, I use well the interruptions with the programming of the timer. but I found my problem: the vectors of the ST72264 are not the even that for the classic ST7 (because of the bus I2C)
bye