Timer in HC08

Jul 10, 2003 7 Replies

Hi All, I am using HC08908EY16 micro and CodeWarrior for my development. As part of my study I did one simple program which will use the timer interrupt. But it is not working .. I build this program on the



908EY186 sample available in the code warrior tutorial. I am not getting the timer over flow interrupt. Can any body point out waht is wrong with my code. I am using the MON08 debug interface. Here is my code

void InitTimerModuleA(void ) { //Initializes timer :TOIE bit enabled, // timer stopped, reset,Internal Bus clock divided by 64 TASC = 0x76; TAMODH = 0x4A; // Modulo=19200 TAMODL = 0xFF; TASC0 = 0x40; TASC1 = 0x00; } interrupt void TimerInt(void) { Count++; } And my PRM file is as follows



NAMES END



SECTIONS Z_RAM = READ_WRITE 0x0040 TO 0x00EF; /* 0xF0 to 0xFF reserved for Monitor stacking */ MY_PSEUDOROM = READ_ONLY 0x0100 TO 0x023F; PLACEMENT DEFAULT_ROM INTO MY_PSEUDOROM; DEFAULT_RAM INTO Z_RAM; zpage INTO Z_RAM; END



STACKSIZE 0x20



VECTOR ADDRESS 0xFFF2 TimerInt


I suppose you're clearing the I bit in the CCR (global INT mask) somewhere?

Best regards, Spehro Pefhany

"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com

Hi, Spehro is right, do you use the euivalent ASM mnemonic "CLI" somewhere in your inits ?

Yvan

********************************* YBDesign
formatting link
*********************************

Spehro Pefhany a écrit dans le message : snipped-for-privacy@4ax.com...

formatting link

formatting link

Yvan BOURNE a =E9crit:

in

Or use the "EnableInterrupts" macro, don't forget #include

Emmanuel

Hi All, I am enabling the interrupt in my Main() as follows InitTimer(); TASC = TASC & (~0x20); // start timer EnableInterrupts; Still I am not getting the interrupt. But I placed the same code into another sample code availabe in "\Stationery\HC08\EY\EY16\C".Now I am getting the interrupt. I don't know what the hell is going on...When I place the same code on the sample code available in "\Stationery\HC08\Legacy\MON08 Target Interface\hc908ey16", I am not getting the interrupt... Also in the CodeWarrior Debugger, "True-Time Simulator& Real Time Debugger, I am getting the "MON8" menu for "\Stationery\HC08\Legacy\MON08 Target Interface\hc908ey16" project and "PEDebug" for the ""\Stationery\HC08\EY\EY16\C" prject. I don't know what all this things. My questain is, what all this MON8 and PEDebug means... Which development method I have to follow for HC908EY16 ...

Please help me on this... What this Motorola is doing... Please see how Hitachi guys are doing this

Regards Shibu

MON08 is a P&E tool

formatting link

Yvan

********************************* YBDesign
formatting link
*********************************

shibu a écrit dans le message : snipped-for-privacy@posting.google.com...

Hi All, The interrupt functionality worked.by default the debugger worked in Simulation mode and in this mode there is no interrupt by default. So now I flashed the code and getting the interrupt correctly. Sorry for this simple questaion and wasting your time Thanks for all the support extended...

Now I am playing with SPI. But after transmitting the SPI data, I am geeting the receiver interrupt, but the Over Run error bit is set. What could be the problem. Does any one have any sample code on SPI Initialization, transmission, reception...

Thanks Shibu

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required