This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

TWIM EasyDMA Delay Between Bytes

Hi,

I'm writing a library for the common Hitachi_HD44780 (LCD2004 etc) but need it to be non-blocking. I'll open source it once done. I'm using EasyDMA to do the transfers but the aging HD44780 needs a 50us delay in-between commands. My idea so far is;

1. set a timer with a period of 50us and a counter equal to the amount of bytes with a PPI to halt the timer and fire an interrupt to indicate "done"
2. timer period event fires EasyDMA which transfers one byte.

My question then is around EasyDMA List mode. Can I clarify that what it's doing is adding MAXCNT to the PTR object after each send?

In other words if I set MAXCNT = 1 and use list mode I should get the spaces inbetween the bytes without needing to interrupt to PTR++?

Parents Reply
  • Yupp, just done that and still no-go. What's odd is the interrupt on the same compare is firing, so that side is good, it's just not making it's way through PPI.

    NRF_PPI->CH[CFG_PPI_LCD_CHANNEL_COUNTER_RESET].EEP = (uint32_t) &CFG_TIMER_LCD_COUNTER->EVENTS_COMPARE[0]; // wire timer compare
    NRF_PPI->CH[CFG_PPI_LCD_CHANNEL_COUNTER_RESET].TEP = (uint32_t) &CFG_TIMER_LCD_SPACE->TASKS_STOP;
    NRF_PPI->FORK[CFG_PPI_LCD_CHANNEL_COUNTER_RESET].TEP = (uint32_t) &CFG_TIMER_LCD_SPACE->TASKS_CLEAR;
    


    To confirm when in COUNTER mode there's no means to stop the timer (TASK_START) doesn't need to be set? This potentially means the compare is always active and if so I''ll need to disable the interrupt (could be why it's refiring).



Children
Related