Hello,
I have an Arduino Due card and I plan to use digital pins to control the direction signals that drive three-phase inverters.
I'm thinking of using a code similar to the code below
Between the outputs of the digital pins and the terminals of the direction signals on the drive, I plan to use a UDN2981A (8-transistor array Darlington)
In attachment, I enclose the wiring diagram of the UDN2981A on the inverter (the whole right part of the diagram represents the inverter internal circuit) and SF,SR and SC represent the terminals of the frequency inverter)
Question 1:
With a UDN2981A, is a 10kohms resistor connected between the digital pin outputs and the GND desirable for a more direct transition from 3.3v to the 0v ?
Question 2:
With port manipulation, how do you activate the internal pull-down resistors? Is it automatic with the code below
Question 3:
Is the setup of my test code sufficient?
Question 4:
Between pin state failovers by REG_PIOC_CODR ... and by REG_PIOD_SODR ... , you should maintain a delay of a few µs ?
How µs delay?
Thank you for your help and technical advice
uint32_t pin_25 = (1u << 0); // masque pour la pin 25 (Port Pin D0)
uint32_t pin_45 = (1u << 18); // masque pour la pin 45 (Port Pin C18)
uint32_t pin_53 = (1u << 14); // masque pour la pin 53 (Port Pin B14)
uint32_t pin_35 = (1u << 3); // masque pour la pin 35 (Port Pin C3)
void setup()
{
REG_PIOD_OER = pin_25; // pin 25 est configuré en output au niveau du port D
REG_PIOC_OER = pin_35; // pin 35 est configuré en output au niveau du port C
REG_PIOC_OER = pin_45; // pin 45 est configuré en output au niveau du port C
REG_PIOB_OER = pin_53; // pin 53 est configuré en output au niveau du port B
REG_PIOD_CODR = pin_25; // Basculement pin 25 en OFF (clear)
REG_PIOC_CODR = pin_35; // Basculement pin 35 en OFF (clear)
REG_PIOC_CODR = pin_45; // Basculement pin 45 en OFF (clear)
REG_PIOB_CODR = pin_53; // Basculement pin 53 en OFF (clear)
}
void loop()
{
//Changement état des pins 25 et 45 avec "Delay"
//**********************************************
REG_PIOC_CODR = pin_45; // Basculement pin 45 en OFF (clear)
delayMicroseconds(1); // wait for a 1µs
REG_PIOD_SODR = pin_25; // Basculement pin 25 en ON (set)
delayMicroseconds(1); // wait for a 1µs
REG_PIOD_CODR = pin_25; // Basculement pin 25 en OFF (clear)
delayMicroseconds(1); // wait for a 1µs
REG_PIOC_SODR = pin_45; // Basculement pin 45 en ON (set)
delayMicroseconds(1); // wait for a 1µs