Hello all,
I am fairly new to the C2000 and it's been a bit of a learning curve compared with the much simpler MSP430 that I learned on! Anyway....
I have started off using the ePWM_deadband example. I have then removed much of the functionality from main() and placed it into a configPWM() function in a header called ePWM_Config and I call that from main(). I would like to do something similar to configure the ADCs, GPIO and SPI to enable me to have a very simple main() function with all the peripherals setup by a dedicated header file that I can go and modify. My first question is whether this is a good approach and is there a convention for laying out projects? I am assuming I should leave the TI example files like "F2837xD_EPwm.c" well alone and then call my own setup function after they have been called and it has done all the background configuration?
My second issue is that I am a bit concerned about setting the purpose of I/O pins in different header files. It would be good to have a single header file that configured all of the pins one after the other. For example, I would like a file where I set up the function of every GPIO pin, for example setting one up as ePWM1A, but then leave the setting up of the ePWM module for a dedicted function elsewhere. I seem to recall that when I used the F28069M on a previous project there was a header file which listed every pin and then you could comment out sections to assign that pin to a particular peripheral or leave it as GPIO. Is this an option for the F28379D as all the examples seem to focus on one peripheral each and they just set up the pin function in main().
Apologies for the vague questions but I am trying to get into good habits from the start to avoid issues later.