Other Parts Discussed in Thread: TM4C123GH6PM
Greetings, denizens of the e2e community.
I am programming a TM4C123GH6PM microcontroller within a TIVA Launchpad using Code Composer Studio. What I am doing is generating variable pulse widths with the GPIOs using interrupts that are triggered when a general purpose timer count reaches 0. Within this interrupt, the next pulse width duration in the lookup table is loaded into the timer using the Tivaware API, as is the 'high' or 'low' value for the GPIO to take, corresponding to its timer duration.
Speed is very important in this application and unfortunately, the necessary timer reconfiguration during the interrupt takes up a lot of time, which adds considerably to the minimum pulse width it can generate. The minimum pulse width it can generate right now is about 1.4 microseconds. In order to speed it up I have used direct register access to disable and enable the timer for reconfiguration during the interrupt which shaved off about 400 nanoseconds, so before, using just Tivaware API functions, the minimum pulse width it could generate was about 1.8 microseconds. If I can get this down to about 1 microsecond, I would be satisfied. And i think this can be achieved through direct register access writing to the data register of the GPIO and the timer load register, instead of using the Tivaware API. So my question is this:
I have two arrays, one of type uint8_t and the other uint32_t. The uint8_t array is filled with the desired 1 and 0 values for the GPIO data register and the uint32_t array is filled with the desired timer load values, corresponding to each of the GPIO output values stored in the uin8_t array.
How do I write these values to the GPIO data and timer load registers? I tried just doing something like this:
GPIO_PORTF_DATA_R = switchingVectors[interruptCounter];
But when I try to run it, I get a faultISR.
So obviously, my understanding is lacking here. Could anyone enlighten me as to how to do this?
