Thanks for the reply. We want to use a timer to switch a GPIO pin in an ISR. We checked tasks, but they are to slow.
We use the code below, We can see timer 1 is running on output port 7, but we do not see any interrupts are handled (no toggling on port 4). Is there something wrong?
int startTimer(unsigned int *generalArray, void **args, unsigned int argsCount, unsigned int *argSize)
{
// configure fast IO port 1
FIO0DIR = 3; // set as output
FIO0CLR = 2;
// configure VIC
VICIntEnClr = 0x20; // clear
VICSoftIntClr = 0x20;
RLPext->Interrupt.Install(0x20, Timer1Callback, 0);
RLPext->Interrupt.GlobalInterruptEnable();
RLPext->Interrupt.Enable(0x20);
VICIntEnable = 0x20; // enable
// configure timer1
T1TCR = 0x00; // stop timer
T1PR = 0x00; // set prescaler to zero
T1MR0 = 0xFFFF; // set match value of timer0
T1IR = 0x01; // reset all interrrupts of timer0
T1MCR = 0x03; // reset timer0 and interrupt on match
T1TCR = 0x02; // reset timer0
T1TCR = 0x01; // start timer0
while(1)
{
if (T1TC % 100 == 0)
{
if(!toggle1)
FIO0SET = 2;
else
FIO0CLR = 2;
toggle1 = !toggle1;
}
}
return 0;
Well, we will consider to use the task. But actually this is only a test, because we want to install a isr for a SPI interface. So, we really want this to work.
You will never get 1uS, even if you install an interrupt handler it will be very tricky to get right. There is a hole system running on the processor and plenty of interrupts already firing. This is why I am asking as what you are trying to do maybe beyond the processor’s capability.
But you are saying you need this for SPI! Can you please provide more details on what you are trying to accomplish then I can give you better directions
That really does not make sense. The FEZ is ‘always’ the master so no data will be flowing unless you initiate it. There is really no reason to use an interrupt, especially one with very tight timing requirements.
[quote]Native RLP Extensions
RLP provides native code ability. The extensions provide addition…[/quote]
Then under you see
[quote]
Task.Initialize
Initializes a task structure. The task will run when Schedule/ScheduleTimeOffset is called. When a task is executing, it blocks all other managed/native threads/tasks. The user must return from the task in order for the managed threads to run again.
task: User’s task.
taskCallback: Callback when the task runs.
arg: This is passed to the callback function.
isKernelMode: True or False value. Always try to use False (non kernel mode). In this mode, the task executes when appropriate among other managed threads without interrupting them. True (kernel mode) executes the task at a specific time. It interrupts everything else and stops the hardware interrupts while executing.[/quote]
We are creating a 3D LEDcube. We want to use the SPI for a 8 channel RGB LEDdriver for clocking in grayscale values. After that a shift register should be shifted once and both The driver and shift register should be latched to put it on the store register.
So, as I understand it correctly, we better not use an interrupt with the SPI . Instead, I guess that we just have to wait for the finish flag of the SPI and then put the latch signal.
We tested this scenario and it just works fine. As suggested we now use a task to update the LEDs at a speed of 60HZ. So far we can see now, th update takes just a little amount of available time
Unfortuately, we did not manage to get the interrupt working, but we wouldn’t use it anyways.
Thank you very much for your responses.
if someone is interested in our c-code, I will provide it.