How to reduce thread time slice?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,

in a multi-thread FX3 project, a task of one thread is to get samples from an ADC every 160 usec thru SPI port.

Every sample read means a 4 bytes transmission to ADC and then a 3 bytes reading.

When another thread starts, during its execution time the ADC is not read, so FX3 loses some samples.

The minimum available time slice is 1 ms: is it possible to reduce it?

The EOC from ADC is a falling edge signal, and this signal is connected to a FX3 GPIO pin in order to link to it an ISR.

My purpose is to start inside the ISR a read/write SPI transmission based on DMA, but i didn't understand yet how to do it without involving CPU.

Is it possible to do it?

The smallest dimension of a DMA trasfer block is 16 bytes: how can I reduce it? 

Thanks and regards

Massimo Liggio

0 Likes
1 Solution
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

If this is a problem of the thread time slice, please try a function "void CyU3PThreadRelinquish ( void )"

5.27.12.76 void CyU3PThreadRelinquish ( void )

Relinquish control to the OS scheduler.

Description

This is a RTOS call for fair scheduling which relinquishes control to other ready threads that are at the same priority

level. The thread that relinquishes control remains in ready state and can regain control if there are no other ready

threads with the same priority level.

Current thread will be suspended by calling this function.

Regards,

Noriaki

View solution in original post

0 Likes
1 Reply
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

If this is a problem of the thread time slice, please try a function "void CyU3PThreadRelinquish ( void )"

5.27.12.76 void CyU3PThreadRelinquish ( void )

Relinquish control to the OS scheduler.

Description

This is a RTOS call for fair scheduling which relinquishes control to other ready threads that are at the same priority

level. The thread that relinquishes control remains in ready state and can regain control if there are no other ready

threads with the same priority level.

Current thread will be suspended by calling this function.

Regards,

Noriaki

0 Likes