2021-04-09 07:03 AM
With the SW generated by MX as example I have a timer that seems to work, but not a signal on PC7.
2021-04-09 02:36 PM
2021-04-09 04:02 PM
sConfigOC.Pulse = 0;
Also, prescaler should be 999.
Shouldn't you put a value here?
Like 50% of the timer period. Whatever, but not 0.
0 will never trigger the OC.
Also, why run the timer at 2KHz to toggle the output and achieve 1KHz.
You can just set it into PWM mode.
Pre=999
Period=79
Pulse=39
Start PWM and it'll be toggling the output at 1KHz.
2021-04-09 06:44 PM
2021-04-10 01:12 AM
Are you trying to send the registers content through e-mail? Nothing arrived here.
If so, can you please do it through the web interface.
Or just enter it as plain text into the message, once you have it in text form.
JW
2021-04-10 04:17 AM
2021-04-10 04:30 AM
2021-04-10 06:02 AM
Export the project in zip and upload here.
Delete Debug and Release folders, they take a lot of space.
2021-04-10 08:53 AM
Sending e-mails with attachments to this forum apparently does not work.
Please use the web interface.
JW
2021-04-10 09:53 AM
2021-04-10 01:51 PM
GPIOC is OK.
00000001 __IO uint32_t CR1; /*!< TIM control register 1, Address offset: 0x00 */
00000000 __IO uint32_t CR2; /*!< TIM control register 2, Address offset: 0x04 */
00000000 __IO uint32_t SMCR; /*!< TIM slave mode control register, Address offset: 0x08 */
00000000 __IO uint32_t DIER; /*!< TIM DMA/interrupt enable register, Address offset: 0x0C */
0003001f __IO uint32_t SR; /*!< TIM status register, Address offset: 0x10 */
00000000 __IO uint32_t EGR; /*!< TIM event generation register, Address offset: 0x14 */
00000000 __IO uint32_t CCMR1; /*!< TIM capture/compare mode register 1, Address offset: 0x18 */
00000000 __IO uint32_t CCMR2; /*!< TIM capture/compare mode register 2, Address offset: 0x1C */
00000000 __IO uint32_t CCER; /*!< TIM capture/compare enable register, Address offset: 0x20 */
00000020 __IO uint32_t CNT; /*!< TIM counter register, Address offset: 0x24 */
000003e8 __IO uint32_t PSC; /*!< TIM prescaler, Address offset: 0x28 */
00000027 __IO uint32_t ARR; /*!< TIM auto-reload register, Address offset: 0x2C */
00000000 __IO uint32_t RCR; /*!< TIM repetition counter register, Address offset: 0x30 */
00000000 __IO uint32_t CCR1; /*!< TIM capture/compare register 1, Address offset: 0x34 */
00000000 __IO uint32_t CCR2; /*!< TIM capture/compare register 2, Address offset: 0x38 */
00000000 __IO uint32_t CCR3; /*!< TIM capture/compare register 3, Address offset: 0x3C */
00000000 __IO uint32_t CCR4; /*!< TIM capture/compare register 4, Address offset: 0x40 */
00008000 __IO uint32_t BDTR; /*!< TIM break and dead-time register, Address offset: 0x44 */
00000000 __IO uint32_t DCR; /*!< TIM DMA control register, Address offset: 0x48 */
00000001 __IO uint32_t DMAR; /*!< TIM DMA address for full transfer, Address offset: 0x4C */
00000000 __IO uint32_t OR1; /*!< TIM option register 1, Address offset: 0x50 */
00000000 __IO uint32_t CCMR3; /*!< TIM capture/compare mode register 3, Address offset: 0x54 */
00000000 __IO uint32_t CCR5; /*!< TIM capture/compare register5, Address offset: 0x58 */
00000000 __IO uint32_t CCR6; /*!< TIM capture/compare register6, Address offset: 0x5C */
00000001 __IO uint32_t OR2; /*!< TIM option register 2, Address offset: 0x60 */
00000001 __IO uint32_t OR3; /*!< TIM option register 3, Address offset: 0x64 */
This is a running timer, but channel 2 is not set to PWM. You need to:
I don't use Cube so I don't know how to do that in Cube.
JW