cancel
Showing results for 
Search instead for 
Did you mean: 

f411ce dma timer for more than 1 channel not working?

Selit.1
Associate

hi i want to run timer with dma to chang duty cycle for sinusoidal waveform. I already have been tested it on f103c8t but now i want to upload the code on f411ce and it dose not work prperly. dma timer its ok for one channel but when i have run more than one channel,2nd ,3rd and 4th channels not work.

uint32_t spwm_p_500[500] =
{1000,1011,1023,1034,1045,1057,1068,1079,1090,1102,1113,1124,1135,1146,1158,1169,1180,1191,1202,1213,1224,1235,1246,1257,1267,1278,1289,1300,1310,1321,1331,1342,1352,1363,1373,1383,1393,1404,1414,1424,1434,1443,1453,1463,1473,1482,1492,1501,1511,1520,1529,1538,1547,1556,1565,1574,1582,1591,1599,1608,1616,1624,1632,1640,1648,1656,1664,1671,1679,1686,1693,1701,1708,1715,1721,1728,1735,1741,1748,1754,1760,1766,1772,1778,1783,1789,1794,1799,1804,1809,1814,1819,1824,1828,1833,1837,1841,1845,1849,1852,1856,1859,1863,1866,1869,1872,1874,1877,1880,1882,1884,1886,1888,1890,1891,1893,1894,1895,1897,1897,1898,1899,1899,1900,1900,1900,1900,1900,1899,1899,1898,1897,1897,1895,1894,1893,1891,1890,1888,1886,1884,1882,1880,1877,1874,1872,1869,1866,1863,1859,1856,1852,1849,1845,1841,1837,1833,1828,1824,1819,1814,1809,1804,1799,1794,1789,1783,1778,1772,1766,1760,1754,1748,1741,1735,1728,1721,1715,1708,1701,1693,1686,1679,1671,1664,1656,1648,1640,1632,1624,1616,1608,1599,1591,1582,1574,1565,1556,1547,1538,1529,1520,1511,1501,1492,1482,1473,1463,1453,1443,1434,1424,1414,1404,1393,1383,1373,1363,1352,1342,1331,1321,1310,1300,1289,1278,1267,1257,1246,1235,1224,1213,1202,1191,1180,1169,1158,1146,1135,1124,1113,1102,1090,1079,1068,1057,1045,1034,1023,1011,1000,989,977,966,955,943,932,921,910,898,887,876,865,854,842,831,820,809,798,787,776,765,754,743,733,722,711,700,690,679,669,658,648,637,627,617,607,596,586,576,566,557,547,537,527,518,508,499,489,480,471,462,453,444,435,426,418,409,401,392,384,376,368,360,352,344,336,329,321,314,307,299,292,285,279,272,265,259,252,246,240,234,228,222,217,211,206,201,196,191,186,181,176,172,167,163,159,155,151,148,144,141,137,134,131,128,126,123,120,118,116,114,112,110,109,107,106,105,103,103,102,101,101,100,100,100,100,100,101,101,102,103,103,105,106,107,109,110,112,114,116,118,120,123,126,128,131,134,137,141,144,148,151,155,159,163,167,172,176,181,186,191,196,201,206,211,217,222,228,234,240,246,252,259,265,272,279,285,292,299,307,314,321,329,336,344,352,360,368,376,384,392,401,409,418,426,435,444,453,462,471,480,489,499,508,518,527,537,547,557,566,576,586,596,607,617,627,637,648,658,669,679,690,700,711,722,733,743,754,765,776,787,798,809,820,831,842,854,865,876,887,898,910,921,932,943,955,966,977,989
};
uint32_t spwm_n_500[500] =
{1000,989,977,966,955,943,932,921,910,898,887,876,865,854,842,831,820,809,798,787,776,765,754,743,733,722,711,700,690,679,669,658,648,637,627,617,607,596,586,576,566,557,547,537,527,518,508,499,489,480,471,462,453,444,435,426,418,409,401,392,384,376,368,360,352,344,336,329,321,314,307,299,292,285,279,272,265,259,252,246,240,234,228,222,217,211,206,201,196,191,186,181,176,172,167,163,159,155,151,148,144,141,137,134,131,128,126,123,120,118,116,114,112,110,109,107,106,105,103,103,102,101,101,100,100,100,100,100,101,101,102,103,103,105,106,107,109,110,112,114,116,118,120,123,126,128,131,134,137,141,144,148,151,155,159,163,167,172,176,181,186,191,196,201,206,211,217,222,228,234,240,246,252,259,265,272,279,285,292,299,307,314,321,329,336,344,352,360,368,376,384,392,401,409,418,426,435,444,453,462,471,480,489,499,508,518,527,537,547,557,566,576,586,596,607,617,627,637,648,658,669,679,690,700,711,722,733,743,754,765,776,787,798,809,820,831,842,854,865,876,887,898,910,921,932,943,955,966,977,989,1000,1011,1023,1034,1045,1057,1068,1079,1090,1102,1113,1124,1135,1146,1158,1169,1180,1191,1202,1213,1224,1235,1246,1257,1267,1278,1289,1300,1310,1321,1331,1342,1352,1363,1373,1383,1393,1404,1414,1424,1434,1443,1453,1463,1473,1482,1492,1501,1511,1520,1529,1538,1547,1556,1565,1574,1582,1591,1599,1608,1616,1624,1632,1640,1648,1656,1664,1671,1679,1686,1693,1701,1708,1715,1721,1728,1735,1741,1748,1754,1760,1766,1772,1778,1783,1789,1794,1799,1804,1809,1814,1819,1824,1828,1833,1837,1841,1845,1849,1852,1856,1859,1863,1866,1869,1872,1874,1877,1880,1882,1884,1886,1888,1890,1891,1893,1894,1895,1897,1897,1898,1899,1899,1900,1900,1900,1900,1900,1899,1899,1898,1897,1897,1895,1894,1893,1891,1890,1888,1886,1884,1882,1880,1877,1874,1872,1869,1866,1863,1859,1856,1852,1849,1845,1841,1837,1833,1828,1824,1819,1814,1809,1804,1799,1794,1789,1783,1778,1772,1766,1760,1754,1748,1741,1735,1728,1721,1715,1708,1701,1693,1686,1679,1671,1664,1656,1648,1640,1632,1624,1616,1608,1599,1591,1582,1574,1565,1556,1547,1538,1529,1520,1511,1501,1492,1482,1473,1463,1453,1443,1434,1424,1414,1404,1393,1383,1373,1363,1352,1342,1331,1321,1310,1300,1289,1278,1267,1257,1246,1235,1224,1213,1202,1191,1180,1169,1158,1146,1135,1124,1113,1102,1090,1079,1068,1057,1045,1034,1023,1011
};

HAL_TIM_PWM_Start_DMA(&htim1,TIM_CHANNEL_1,(uint32_t*)spwm_p_500, 500);
	HAL_TIM_PWM_Start_DMA(&htim1,TIM_CHANNEL_2,(uint32_t*)spwm_n_500, 500);
	HAL_TIM_PWM_Start_DMA(&htim1,TIM_CHANNEL_3,(uint32_t*)spwm_p_500, 500);
  HAL_TIM_PWM_Start_DMA(&htim1,TIM_CHANNEL_4,(uint32_t*)spwm_n_500, 500);

0 REPLIES 0