This code is called right at the start of Main()
The way ThreadX works is that the only function in Main is
TX_KERNEL_ENTER and the first function called in that in
TX_initialize which calls this initial part of assembler code that
they wrote for the EB01 board and I have modified for the 91SAM7S.
In answer to your last question we are using TC, not B. I wonder if
the same thing has to be done. I am digesting what you put Kris,
thanks a bunch..
Andrew
LDR r2,=TC_CCR
LDR r1,=TIMER0_ENABLE
STR r1, [r2] ; Enable the timer
LDR r1,=TIMER0_SYNC ; Build timer sync value
STR r1, [r2] ; Start the timer running!
Reply by microbit●April 13, 20052005-04-13
BTW Andrew,
> SAM7S, but the timer interrupt is still not running. > I can
email anyone my startup file if they feel they can help me out >
here. > Has anybody else done this?? > Any help would be
appreciated.
Did you use TC_RB by any chance ?
I posted this on at91.com quite some time ago, and at the kickoff of this
group
as well on Wed 2 Feb 2005, copy below :
Subject : No compare Interrupts for TC_RB --------------
I could NOT get compare interrupts on TC_RB and tested with WAVE = 1, and tried with WAVESEL = 00 or WAVESEL = 10.
Soon I solved the problem :
I set it up to output toggle
the TIOA and TIOB signals on PA0,PA1 and same drama, no RB compare toggle
output.........
Then I saw the EEVT bits in TC_CMR !!! (External Event trigger) The
default is 00 - or TIOB event, TIOB as commented becomes an input. That
fixes that for the output unit... Could this affect RB compare ? Surely not ?
I added a simple definition for XC1 as EEVT in
TC_CMR (instead of default TIOB) and the interrupt RB compare now works
!!!!
I DON'T see why the EEVT bits should affect the
normal RB compare interrupt, but that's how it turned out ...
I hope this saves some of you the intiial trouble I had with RB
compare INTs for TC.
B regards Kris
Reply by microbit●April 13, 20052005-04-13
Hi Andrew,
> and cause an interrupt. If timer0 does not run then the Timers
and a > lot of other ThreadX features don't run. > The
trouble is the demo from ExpressLogic runs of the AT91EB01 eval >
board. I have made lots of changes to the startup .s79 (assembler) > file that came with the EB01 in order to get it to work with the > SAM7S, but the timer interrupt is still not running. > I can
email anyone my startup file if they feel they can help me out
Don't know why you're concerned with startup file, I would prefer
that the C
init code at start of main() takes care of this.
Timer 0 is not a big drama to use INTs on, just make sure you have the AIC
set up
properly.
I've pasted in some snippet code I use to init TC0 with SAM7S-EK
board.
You just need the functions mask_isr() and
unmask_isr(), these are slightly changed
CrossWorks functions to enable and disable individual INTs.
set_irq_isr() just sets up the AIC given the
proper Per. ID # , trigger level, priority etc.
Then you just need to define TIMER_TICK to a
value that suits your MCLK and INT interval you need.
I just use my own startup file
that exports the PLL settings, calcs MCLK at compile time, and
adjusts
the constants to yield 1 mS ticks.
If you follow this sequence I use, it should
work hunkey dory.
PS : You might need to define the constants for Timer use, but you should
already have them if you
Hello,
I am using the ThreadX OS and tring to get it to work with the
AT91SAM7S-EK eval kit and IAR Embeded Workbench.
Much of last week was conversing with IAR and Expresslogic in tryting
to get a file compiled and run in the flash of the AT91SAM7S.
We have that going, however ThreadX requires Timer0 of the TC to run
and cause an interrupt. If timer0 does not run then the Timers and a
lot of other ThreadX features don't run.
The trouble is the demo from ExpressLogic runs of the AT91EB01 eval
board. I have made lots of changes to the startup .s79 (assembler)
file that came with the EB01 in order to get it to work with the
SAM7S, but the timer interrupt is still not running.
I can email anyone my startup file if they feel they can help me out
here.
Has anybody else done this??
Any help would be appreciated.
Thanks.
Andrew