переназначены пины для работы 485

This commit is contained in:
seklyuts 2024-02-15 15:47:57 +03:00
parent 2ab1befcb2
commit a43486cd7d
9 changed files with 97 additions and 75 deletions

View File

@ -9,10 +9,20 @@
void GpioInit(void)
{
EALLOW;
GpioCtrlRegs.GPAMUX1.bit.GPIO4 = 0;
GpioCtrlRegs.GPAGMUX1.bit.GPIO4 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO4 = 1;
GpioDataRegs.GPADAT.bit.GPIO4 = 0;
GpioCtrlRegs.GPAMUX1.bit.GPIO6 = 0;
GpioCtrlRegs.GPAGMUX1.bit.GPIO6 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO6 = 0;
GpioDataRegs.GPADAT.bit.GPIO6 = 1;
GpioCtrlRegs.GPAMUX1.bit.GPIO7 = 0;
GpioCtrlRegs.GPAGMUX1.bit.GPIO7 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO7 = 1;
GpioDataRegs.GPADAT.bit.GPIO7 = 0;
GpioCtrlRegs.GPAMUX1.bit.GPIO10 = 0;
GpioCtrlRegs.GPAGMUX1.bit.GPIO10 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO10 = 1;
GpioDataRegs.GPADAT.bit.GPIO10 = 0;
//
// GpioCtrlRegs.GPAMUX2.bit.GPIO21 = 0;
// GpioCtrlRegs.GPAGMUX2.bit.GPIO21 = 0;
@ -39,10 +49,21 @@ void GpioInit(void)
// GpioCtrlRegs.GPBDIR.bit.GPIO56 = 1;
// GpioDataRegs.GPBDAT.bit.GPIO56 = 0;
//
// GpioCtrlRegs.GPBMUX2.bit.GPIO57 = 0;
// GpioCtrlRegs.GPBGMUX2.bit.GPIO57 = 0;
// GpioCtrlRegs.GPBDIR.bit.GPIO57 = 1;
// GpioDataRegs.GPBDAT.bit.GPIO57 = 0;
GpioCtrlRegs.GPBMUX2.bit.GPIO57 = 0;
GpioCtrlRegs.GPBGMUX2.bit.GPIO57 = 0;
GpioCtrlRegs.GPBDIR.bit.GPIO57 = 1;
GpioDataRegs.GPBDAT.bit.GPIO57 = 0;
GpioCtrlRegs.GPCMUX2.bit.GPIO83 = 0;
GpioCtrlRegs.GPCGMUX2.bit.GPIO83 = 0;
GpioCtrlRegs.GPCDIR.bit.GPIO83 = 1;
GpioDataRegs.GPCDAT.bit.GPIO83 = 0;
GpioCtrlRegs.GPAMUX2.bit.GPIO21 = 0;
GpioCtrlRegs.GPAGMUX2.bit.GPIO21 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO21 = 1;
GpioDataRegs.GPADAT.bit.GPIO21 = 1;
//
//
//
@ -93,9 +114,19 @@ void GpioInit(void)
//}
void Gpio4out(uint16_t out_bit)
void Gpio6out(uint16_t out_bit)
{
GpioDataRegs.GPADAT.bit.GPIO4 = out_bit;
GpioDataRegs.GPADAT.bit.GPIO6 = out_bit;
}
void Gpio7out(uint16_t out_bit)
{
GpioDataRegs.GPADAT.bit.GPIO7 = out_bit;
}
void Gpio10out(uint16_t out_bit)
{
GpioDataRegs.GPADAT.bit.GPIO10 = out_bit;
}
void Gpio55out(uint16_t out_bit)

View File

@ -25,7 +25,9 @@ void GpioInit(void);
//void Gpio20out(uint16_t out_bit);
//void Gpio21out(uint16_t out_bit);
void Gpio_SPI_CS_BL25CM1A(uint16_t out_bit);
void Gpio4out(uint16_t out_bit);
void Gpio6out(uint16_t out_bit);
void Gpio7out(uint16_t out_bit);
void Gpio10out(uint16_t out_bit);
void Gpio55out(uint16_t out_bit);
void Gpio56out(uint16_t out_bit);
void Gpio57out(uint16_t out_bit);

View File

@ -44,13 +44,13 @@ void pwm_set_volt_3F(float phaseA, float phaseB, float phaseC, float Udc)
{
Gpio4out(1);
A_proc = (int16_t)((phaseA/Udc)*PERIOD_2);
B_proc = (int16_t)((phaseB/Udc)*PERIOD_2);
C_proc = (int16_t)((phaseC/Udc)*PERIOD_2);
Gpio4out(0);
if(A_proc > 0) A_proc+= EPWM_DB/2;
else if(A_proc < 0) A_proc-= EPWM_DB/2;

View File

@ -14,5 +14,16 @@ void init_Biss(void)
EDIS;
}
void init_GPIO_Biss(void)
{
EALLOW;
EDIS;
}

View File

@ -10,7 +10,7 @@
void init_Biss(void);
void init_GPIO_Biss(void);
#endif /* SRC_BISS_H_ */

View File

@ -62,10 +62,10 @@ void FRMUartInit(void)
GPIO_SetupPinOptions(83, GPIO_INPUT, GPIO_PUSHPULL);
EALLOW;
GpioCtrlRegs.GPDDIR.bit.GPIO108 = 1;
GpioDataRegs.GPDDAT.bit.GPIO108 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO21 = 1;
GpioDataRegs.GPADAT.bit.GPIO21 = 1;
GpioCtrlRegs.GPCDIR.bit.GPIO83 = 1;
GpioDataRegs.GPCDAT.bit.GPIO83 = 1;
GpioDataRegs.GPCDAT.bit.GPIO83 = 0;
EDIS;
// GPIO_SetupPinMux(28, GPIO_MUX_CPU1, 1);
@ -134,25 +134,25 @@ char FMSTR_SCI_GETCHAR()
void FMSTR_SCI_RE(void)
{
GpioDataRegs.GPCDAT.bit.GPIO83 = 0;
// GpioDataRegs.GPCDAT.bit.GPIO83 = 0;
SciaRegs.SCICTL1.bit.RXENA = 1;
}
void FMSTR_SCI_RD(void)
{
GpioDataRegs.GPCDAT.bit.GPIO83 = 1;
// GpioDataRegs.GPCDAT.bit.GPIO83 = 1;
SciaRegs.SCICTL1.bit.RXENA = 0;
}
void FMSTR_SCI_TE(void)
{
GpioDataRegs.GPDDAT.bit.GPIO108 = 1;
// GpioDataRegs.GPADAT.bit.GPIO21 = 1;
SciaRegs.SCICTL1.bit.TXENA = 1;
}
void FMSTR_SCI_TD(void)
{
GpioDataRegs.GPDDAT.bit.GPIO108 = 0;
// GpioDataRegs.GPADAT.bit.GPIO21 = 0;
SciaRegs.SCICTL1.bit.TXENA = 0;
}

View File

@ -16,6 +16,7 @@ volatile uint16_t Rele=0;
void frmmstr_run(void)
{
static uint16_t diod = 0;
if(FMSTR_is_enable()) {
if(counter < 100) counter++;
else
@ -26,6 +27,8 @@ void frmmstr_run(void)
{
counter1=0;
counter2++;
if(diod) {Gpio7out(0); diod = 0;}
else {Gpio7out(1); diod = 1;}
}
}
FMSTR_Poll();

View File

@ -338,7 +338,7 @@ void vector_klark_park(uint16_t SectorOn, int16_t CurrentA, int16_t CurrentB, in
CurrLoop.piId.uCorr = CurrLoop.piIq.uCorr = 0.0f;
#endif
Gpio4out(1);
float UmaxVolt = VOLT_MAX_FACTOR * UdcVolt;
@ -352,11 +352,11 @@ void vector_klark_park(uint16_t SectorOn, int16_t CurrentA, int16_t CurrentB, in
/*Пропорциональное ограничение напряжений Uq и Ud*/
// Test1 = my_sqrtf(Test2);
Gpio4out(0);
float Ulim = my_sqrtf(CurrLoop.piId.Out * CurrLoop.piId.Out + CurrLoop.piIq.Out * CurrLoop.piIq.Out);
Gpio4out(1);
if (Ulim > UmaxVolt)// максимальное напряжение в вольтах
{
@ -368,7 +368,7 @@ void vector_klark_park(uint16_t SectorOn, int16_t CurrentA, int16_t CurrentB, in
}
}
Gpio4out(0);
if(!NoLoop)
{

View File

@ -1,54 +1,29 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<configurations XML_version="1.2" id="configurations_0">
<configuration XML_version="1.2" id="Texas Instruments XDS100v2 USB Debug Probe_0">
<instance XML_version="1.2" desc="Texas Instruments XDS100v2 USB Debug Probe_0" href="connections/TIXDS100v2_Connection.xml" id="Texas Instruments XDS100v2 USB Debug Probe_0" xml="TIXDS100v2_Connection.xml" xmlpath="connections"/>
<connection XML_version="1.2" id="Texas Instruments XDS100v2 USB Debug Probe_0">
<instance XML_version="1.2" href="drivers/tixds100v2icepick_c.xml" id="drivers" xml="tixds100v2icepick_c.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds100v2c28x.xml" id="drivers" xml="tixds100v2c28x.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds100v2cla2.xml" id="drivers" xml="tixds100v2cla2.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds100v2cs_child.xml" id="drivers" xml="tixds100v2cs_child.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds100v2cs_dap.xml" id="drivers" xml="tixds100v2cs_dap.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds100v2cortexM.xml" id="drivers" xml="tixds100v2cortexM.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds510ajsm.xml" id="drivers" xml="tixds510ajsm.xml" xmlpath="drivers"/>
<configuration XML_version="1.2" id="Texas Instruments XDS2xx USB Debug Probe_0">
<instance XML_version="1.2" desc="Texas Instruments XDS2xx USB Debug Probe_0" href="connections/TIXDS2XXUSB_Connection.xml" id="Texas Instruments XDS2xx USB Debug Probe_0" xml="TIXDS2XXUSB_Connection.xml" xmlpath="connections"/>
<connection XML_version="1.2" id="Texas Instruments XDS2xx USB Debug Probe_0">
<instance XML_version="1.2" href="drivers/tixds560icepick_c.xml" id="drivers" xml="tixds560icepick_c.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds560c28x.xml" id="drivers" xml="tixds560c28x.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds560cla2.xml" id="drivers" xml="tixds560cla2.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds560cs_child.xml" id="drivers" xml="tixds560cs_child.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds560cs_dap.xml" id="drivers" xml="tixds560cs_dap.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds560cortexM.xml" id="drivers" xml="tixds560cortexM.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds560ajsm.xml" id="drivers" xml="tixds560ajsm.xml" xmlpath="drivers"/>
<platform XML_version="1.2" id="platform_0">
<instance XML_version="1.2" desc="TMS320F28388D_0" href="devices/f28388d.xml" id="TMS320F28388D_0" xml="f28388d.xml" xmlpath="devices"/>
<device HW_revision="1" XML_version="1.2" description="" id="TMS320F28388D_0" partnum="TMS320F28388D" simulation="no">
<device HW_revision="1" XML_version="1.2" description="" id="TMS320F28388D_0" partnum="TMS320F28388D">
<router HW_revision="1.0" XML_version="1.2" description="ICEPick_C router" id="IcePick_C_0" isa="ICEPICK_C">
<subpath id="Subpath_1">
<property Type="numericfield" Value="0x11" desc="Port Number_0" id="Port Number"/>
</subpath>
<subpath id="CM">
<property Type="numericfield" Value="0x12" desc="Port Number_1" id="Port Number"/>
</subpath>
</router>
</device>
</platform>
</connection>
</configuration>
</configurations>