Difference: BoardSupportPackageH747 (1 vs. 15)

Revision 152022-10-11 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="MecrispCubeH74x"
%DASHBOARD{ section="banner"
Line: 438 to 438
 A0 D15, A1 D16, A2 D17, A3 D18, A4 D19, A5 D20, A6 D21
Added:
>
>

RGB LED

 
Changed:
<
<

Breakout Board

https://docs.arduino.cc/hardware/portenta-breakout

Breakout Board Datasheet https://docs.arduino.cc/static/ff6f3cc0c6b5d7484e45642d617a6c73/ASX00031-datasheet.pdf

>
>
Red D6 PA8
Green D4 PC7
Blue D3? PD7 (PG7?)
 

Digital Pins

Line: 530 to 528
 
  • This pin is analog input A6 (ADC3_IN6)
Added:
>
>

Breakout Board

https://docs.arduino.cc/hardware/portenta-breakout

Breakout Board Datasheet https://docs.arduino.cc/static/ff6f3cc0c6b5d7484e45642d617a6c73/ASX00031-datasheet.pdf

 

SD Card / SDIO Pins

SDIO_D0 / PC8 (internal) / CN8.2

Revision 142022-07-15 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="MecrispCubeH74x"
%DASHBOARD{ section="banner"
Line: 17 to 17
 

Overview

Changed:
<
<
  • 512? KiB RAM dictionary
>
>
  • 512? KiB RAM dictionary, 8 MiB external DRAM (AS4C4M16SA)
 
  • 1 MiB Flash dictionary
  • Forth as CMSIS-RTOS thread. CMSIS-RTOS API to use FreeRTOS from Forth.
  • Buffered terminal I/O (5 KiB buffer for UART Rx). Interrupt driven and RTOS aware, key and emit block the calling thread.
Line: 25 to 25
 
Changed:
<
<
    • Internal Flash drive 0:, 128 MiB (QSPI peripheral NAND Flash TC58CVG0S3HRAIG)
>
>
 

Revision 132022-06-22 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="MecrispCubeH74x"
%DASHBOARD{ section="banner"
Line: 18 to 18
 

Overview

  • 512? KiB RAM dictionary
Changed:
<
<
  • 784? KiB Flash dictionary
>
>
  • 1 MiB Flash dictionary
 
  • Forth as CMSIS-RTOS thread. CMSIS-RTOS API to use FreeRTOS from Forth.
  • Buffered terminal I/O (5 KiB buffer for UART Rx). Interrupt driven and RTOS aware, key and emit block the calling thread.
    • USART1: D0 RX, D1 TX
    • USART3: ST-LINK VCP
  • USB-CDC for serial communication via USB. Redirect console I/O like cdc-emit, cdc-key
  • microSD and internal Flash mass storage for blocks and FAT filesystem.
Changed:
<
<
    • Internal Flash drive 0:, 1024 KiB
    • microSD drive 1: (optional)
>
>
    • Internal Flash drive 0:, 128 MiB (QSPI peripheral NAND Flash TC58CVG0S3HRAIG)
    • microSD drive 1: (optional e.g. on breakout board)
 

Revision 122022-06-20 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="MecrispCubeH74x"
%DASHBOARD{ section="banner"
Changed:
<
<
image="/twiki/pub/MecrispCube/MecrispCubeH74x/NUCLEO-H743ZI2-header.jpg"
>
>
image="/twiki/pub/MecrispCube/BoardSupportPackageH747/portenta-h7.jpg"
  title="Board Support Package for the Arduino Portenta H7 Development Board" titlestyle="color:#F00000;" }%
Line: 565 to 565
 

<--/commentPlugin-->
\ No newline at end of file
Added:
>
>
META FILEATTACHMENT attachment="portenta-h7.jpg" attr="" comment="" date="1655720974" name="portenta-h7.jpg" path="portenta-h7.jpg" size="105524" user="PeterSchmid" version="1"

Revision 112022-06-19 - PeterSchmid

Line: 1 to 1
Changed:
<
<
META TOPICPARENT name="MecrispCubeH7"
>
>
META TOPICPARENT name="MecrispCubeH74x"
 
%DASHBOARD{ section="banner"
Changed:
<
<
image="/twiki/pub/MecrispCube/MecrispCubeH7/NUCLEO-H743ZI2-header.jpg"
>
>
image="/twiki/pub/MecrispCube/MecrispCubeH74x/NUCLEO-H743ZI2-header.jpg"
  title="Board Support Package for the Arduino Portenta H7 Development Board" titlestyle="color:#F00000;" }%
Line: 425 to 425
  https://docs.arduino.cc/hardware/portenta-h7
Changed:
<
<
Error: (1) can't find portenta-h7-pinout.png at /MecrispCube.MecrispCubeH7
>
>
portenta-h7-pinout.png
Portenta H7 Pinout
  Schematics

Revision 102022-06-18 - PeterSchmid

Line: 1 to 1
Changed:
<
<
META TOPICPARENT name="MecrispCubeH743"
>
>
META TOPICPARENT name="MecrispCubeH7"
 
%DASHBOARD{ section="banner"
Changed:
<
<
image="/twiki/pub/MecrispCube/MecrispCubeH743/NUCLEO-H743ZI2-header.jpg"
>
>
image="/twiki/pub/MecrispCube/MecrispCubeH7/NUCLEO-H743ZI2-header.jpg"
  title="Board Support Package for the Arduino Portenta H7 Development Board" titlestyle="color:#F00000;" }%
Line: 425 to 425
  https://docs.arduino.cc/hardware/portenta-h7
Changed:
<
<
Error: (1) can't find portenta-h7-pinout.png at /MecrispCube.MecrispCubeH743
>
>
Error: (1) can't find portenta-h7-pinout.png at /MecrispCube.MecrispCubeH7
  Schematics

Revision 92022-06-15 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="MecrispCubeH743"
%DASHBOARD{ section="banner"
Line: 9 to 9
 
Intro
DRAFT
Changed:
<
<
The board support package for the Arduino Portenta H7 Board is restricted to the Arduino MKR pin header and the onboard RGB LED and switch (push button). The STM32H747 has much more capabilities then 15 digital I/O pins, 7 analog input pins, UART, SPI, and I2C interfaces. But if you want to use the more advanced features you can use the CubeMX to create source code for the internal peripherals. This project wants to show how to use the Cube Ecosystem for a Forth system (or vice versa) and can't implement all features and possibilities the STM32H747 has. It is a good starting point for your project.
>
>
The board support package for the Arduino Portenta H7 Board is restricted to the Arduino MKR pin header and the onboard RGB LED. The STM32H747 has much more capabilities then 15 digital I/O pins, 7 analog input pins, UART, SPI, and I2C interfaces. But if you want to use the more advanced features you can use the CubeMX to create source code for the internal peripherals. This project wants to show how to use the Cube Ecosystem for a Forth system (or vice versa) and can't implement all features and possibilities the STM32H747 has. It is a good starting point for your project.
 
Line: 429 to 429
  Schematics
Deleted:
<
<
 Full Pinout https://docs.arduino.cc/static/2d38006e78d2abc588a80f12bb9c0c70/ABX00042-full-pinout.pdf
Deleted:
<
<
SCL D15, SDA D14
SCK D2, MO D4, MI D3, RX D0, TX D1

  The anlog pins can be used as digital pins too:

Changed:
<
<
A0 D16, A1 D17, A2 D18, A3 D19, A4 D20, A5 D21
>
>
A0 D15, A1 D16, A2 D17, A3 D18, A4 D19, A5 D20, A6 D21
 
Added:
>
>

Breakout Board

https://docs.arduino.cc/hardware/portenta-breakout

Breakout Board Datasheet https://docs.arduino.cc/static/ff6f3cc0c6b5d7484e45642d617a6c73/ASX00031-datasheet.pdf

 

Digital Pins

D0 / PWM7 / PH15 / JA.9

Line: 450 to 455
 

D1 / PWM6 / PK1 / JA.10

  • PWM out on TIM4_CH1
Changed:
<
<

D2 / PWM5 / PG14 / JA.11

  • Alternate uses: UART6_TX, SPI6_MOSI
>
>

D2 / PWM5 / PJ11 / JA.11

  • PWM out on
 
Changed:
<
<

D3 / PWM4 / PE13 / JA.12

>
>

D3 / PWM4 / PG7 / JA.12

 
  • PWM out on TIM1_CH3
Changed:
<
<
  • Alternate uses: SPI6_MISO
>
>
  • RGB LED blue ??
 
Changed:
<
<

D4 / PWM3 / PE14 / JA.13

>
>

D4 / PWM3 / PC7 / JA.13

 
  • PWM out on TIM1_CH4
Changed:
<
<
  • Alternate uses: SPI4_MOSI
>
>
  • RGB LED green
 
Changed:
<
<

D5 / PWM2 / PE11 / JA.14

>
>

D5 / PWM2 / PC6 / JA.14

 
  • PWM out on TIM1_CH2
Deleted:
<
<
  • Alternate uses: USART6_RX
 
Changed:
<
<

D6 / PWM1 / PE9 / JD.1

>
>

D6 / PWM1 / PA8 / JD.1

 
  • PWM out on TIM1_CH1
Changed:
<
<
  • Alternate uses: USART6_TX

D7 / SPI1.CS / PC13 / JD.2

  • Blue Button
  • Alternate uses: SPI6_MISO, USART6_RTS
>
>
  • RGB LED red
 
Changed:
<
<

D8 / PF3 / JD.3

  • Alternate uses: ADC3_5
>
>

D7 / CSS / PI0 / JD.2

  • SPI chip select, Hardware SPI1_CSS
 
Changed:
<
<

D9 / PD15 / JD.4

  • PWM out on TIM4_CH4
  • Alternate uses: UART8_RTS
>
>

D8 / MOSI (COPI) / PC3 / JD.3

  • SPI master out slave in, Hardware SPI1_MOSI
 
Changed:
<
<

D10 / PD14 / JD.5

  • PWM out on TIM4_CH3
  • Alternate uses: UART8_CTS, SPI1_CS

D11 / MOSI / PB5 / JD.6

  • SPI SPI1_MOSI
  • PWM out on TIM3_CH2
  • Alternate uses: USART5_RX
>
>

D9 / SCK / PI1 / JD.4

  • SPI clock, Hardware SPI1_SCK
 
Changed:
<
<

D12 / MISO / PA6 / JD.7

  • SPI SPI1_MISO
  • PWM out on TIM3_CH1
  • Alternate uses: I2S2ext SD, SPI2 MISO

D13 / SCK / PA5 / JD.8

  • SPI SPI1_SCK
  • Output Compare on TIM2_CH1
  • Alternate uses: ADC1_8

D14 / SDA / PB9 / JD.9

  • The I2C (Wire) data pin, Hardware I2C1_SDA
  • (PWM out on TIM4_CH4)
  • Alternate uses: USART4_RX
>
>

D10 / MISO (CIPO) / PC2 / JD.5

  • SPI master in slave out, Hardware SPI1_MISO
 
Changed:
<
<

RESET / JD.10

>
>

D11 / SDA / PH8 / JD.6

  • The I2C (Wire) data pin, Hardware I2C0_SDA
 
Added:
>
>

D12 / SCL / PH7 / JD.7

  • The I2C (Wire) clock pin, Hardware I2C0_SCL
 
Changed:
<
<

UART_RX / PB7 / CN10.16

>
>

D13 / UART_RX / PA10 / JD.8

 
  • Receive (input) pin for Serial1. Hardware USART1_RX
Deleted:
<
<
  • PWM out on TIM4_CH2
  • Alternate uses: I2C1_SDA
 
Changed:
<
<

UART_TX / PB6 / CN10.14

>
>

D14 / UART_TX / PA9 / JD.9

 
  • Transmit (output) pin for Serial1. Hardware USART1_TX
Deleted:
<
<
  • PWM out on TIM4_CH1
  • Alternate uses: I2C1_SCL

MOSI / PB5 / CN7.14

  • SPI SPI1_MOSI
  • PWM out on TIM3_CH2
  • Alternate uses: USART5_RX
 
Changed:
<
<

MISO / PA6 / CN7.12

  • SPI SPI1_MISO
  • PWM out on TIM3_CH1
  • Alternate uses: I2S2ext SD, SPI2 MISO

SCK / PA5 / CN7.10

  • SPI SPI1_SCK
  • Output Compare on TIM2_CH1
  • Alternate uses: ADC1_8

SDA / PB9 / CN7.4

  • The I2C (Wire) data pin, Hardware I2C1_SDA
  • (PWM out on TIM4_CH4)
  • Alternate uses: USART4_RX
>
>

RESET / JD.10

 

Analog Pins

Changed:
<
<

AREF+ / / PA3 / JA.1

  • This pin is analog input A0 (ADC1_IN15)
  • Input Capture on TIM2_CH4
  • Alternate uses: USART2_RX
>
>

AREF+ / / / JA.1

  • This pin is analog i
 
Changed:
<
<

A0 / D15 / PA3 / JA.2

>
>

A0 / D15 / PA0_C / JA.2

 
  • This pin is analog input A0 (ADC1_IN15)
  • Input Capture on TIM2_CH4
  • Alternate uses: USART2_RX
Changed:
<
<

A1 / D16 / PC0 / JA.3

>
>

A1 / D16 / PA1_C / JA.3

 
  • This pin is analog input A1 (ADC1_IN10)
Changed:
<
<

A2 / D17 / PC3 / JA.4

>
>

A2 / D17 / PC2_C / JA.4

 
  • This pin is analog input A2 (ADC3_IN1)
  • PWM out on TIM1_CH3N
Changed:
<
<

A3 / D18 / PB1 / JA.5

>
>

A3 / D18 / PC3_C / JA.5

 
  • This pin is analog input A3 (ADC1_IN5)
  • PWM out on TIM3_CH2

A4 / D19 / PC2 / JA.6

  • This pin is analog input A4 (ADC3_IN0)
Changed:
<
<

A5 / D20 / PF10 / JA.7

>
>

A5 / D20 / PC3/ JA.7

 
  • This pin is analog input A5 (ADC3_IN6)
Changed:
<
<

A6 / D21 / PF10 / JA.8

  • This pin is analog input A5 (ADC3_IN6)
>
>

A6 / D21 / PA4 / JA.8

  • This pin is analog input A6 (ADC3_IN6)
 

SD Card / SDIO Pins

Revision 82022-06-15 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="MecrispCubeH743"
%DASHBOARD{ section="banner"
Line: 539 to 539
 

Analog Pins

Changed:
<
<

AREF+ / D16 / PA3 / JA.1

>
>

AREF+ / / PA3 / JA.1

 
  • This pin is analog input A0 (ADC1_IN15)
  • Input Capture on TIM2_CH4
  • Alternate uses: USART2_RX
Changed:
<
<

A0 / D16 / PA3 / JA.2

>
>

A0 / D15 / PA3 / JA.2

 
  • This pin is analog input A0 (ADC1_IN15)
  • Input Capture on TIM2_CH4
  • Alternate uses: USART2_RX
Changed:
<
<

A1 / D17 / PC0 / JA.3

>
>

A1 / D16 / PC0 / JA.3

 
  • This pin is analog input A1 (ADC1_IN10)
Changed:
<
<

A2 / D18 / PC3 / JA.4

>
>

A2 / D17 / PC3 / JA.4

 
  • This pin is analog input A2 (ADC3_IN1)
  • PWM out on TIM1_CH3N
Changed:
<
<

A3 / D19 / PB1 / JA.5

>
>

A3 / D18 / PB1 / JA.5

 
  • This pin is analog input A3 (ADC1_IN5)
  • PWM out on TIM3_CH2
Changed:
<
<

A4 / D20 / PC2 / JA.6

>
>

A4 / D19 / PC2 / JA.6

 
  • This pin is analog input A4 (ADC3_IN0)
Changed:
<
<

A5 / D21 / PF10 / JA.7

>
>

A5 / D20 / PF10 / JA.7

 
  • This pin is analog input A5 (ADC3_IN6)

A6 / D21 / PF10 / JA.8

Revision 72022-06-14 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="MecrispCubeH743"
%DASHBOARD{ section="banner"
Line: 418 to 418
 

Pinouts

Changed:
<
<
Error: (1) can't find pinout_legend_2017-06-28-2.png at /MecrispCube.MecrispCubeH743
>
>
This Arduino Portenta H7 development board follows the Arduino MKR form factor, but enhanced with the Portenta family 80 pin high-density connector.

The BSP supports only the MKR pins, the high-density connector is not supported yet.

https://docs.arduino.cc/hardware/portenta-h7

Error: (1) can't find portenta-h7-pinout.png at /MecrispCube.MecrispCubeH743

Schematics

  Full Pinout https://docs.arduino.cc/static/2d38006e78d2abc588a80f12bb9c0c70/ABX00042-full-pinout.pdf
Line: 434 to 444
 

Digital Pins

Changed:
<
<

RESET / JP1.16

D0 / UART_RX / PB7 / CN10.16

  • Receive (input) pin for Serial1. Hardware USART1_RX
>
>

D0 / PWM7 / PH15 / JA.9

 
  • PWM out on TIM4_CH2
Deleted:
<
<
  • Alternate uses: I2C1_SDA
 
Changed:
<
<

D1 / UART_TX / PB6 / CN10.14

  • Transmit (output) pin for Serial1. Hardware USART1_TX
>
>

D1 / PWM6 / PK1 / JA.10

 
  • PWM out on TIM4_CH1
Deleted:
<
<
  • Alternate uses: I2C1_SCL
 
Changed:
<
<

D2 / PG14 / CN10.12

>
>

D2 / PWM5 / PG14 / JA.11

 
  • Alternate uses: UART6_TX, SPI6_MOSI
Changed:
<
<

D3 / PE13 / CN10.10

>
>

D3 / PWM4 / PE13 / JA.12

 
  • PWM out on TIM1_CH3
  • Alternate uses: SPI6_MISO
Changed:
<
<

D4 / PE14 / CN10.8

>
>

D4 / PWM3 / PE14 / JA.13

 
  • PWM out on TIM1_CH4
  • Alternate uses: SPI4_MOSI
Changed:
<
<

D5 / PE11 / CN10.6

>
>

D5 / PWM2 / PE11 / JA.14

 
  • PWM out on TIM1_CH2
  • Alternate uses: USART6_RX
Changed:
<
<

D6 / PE9 / CN10.4

>
>

D6 / PWM1 / PE9 / JD.1

 
  • PWM out on TIM1_CH1
  • Alternate uses: USART6_TX
Changed:
<
<

D7 / PC13 / CN10.2

>
>

D7 / SPI1.CS / PC13 / JD.2

 
  • Blue Button
  • Alternate uses: SPI6_MISO, USART6_RTS
Changed:
<
<

D8 / PF3 / CN7.20

>
>

D8 / PF3 / JD.3

 
  • Alternate uses: ADC3_5

Changed:
<
<

D9 / PD15 / CN7.18

>
>

D9 / PD15 / JD.4

 
  • PWM out on TIM4_CH4
  • Alternate uses: UART8_RTS
Changed:
<
<

D10 / PD14 / CN7.16

>
>

D10 / PD14 / JD.5

 
  • PWM out on TIM4_CH3
  • Alternate uses: UART8_CTS, SPI1_CS
Changed:
<
<

D11 / MOSI / PB5 / CN7.14

>
>

D11 / MOSI / PB5 / JD.6

 
  • SPI SPI1_MOSI
  • PWM out on TIM3_CH2
  • Alternate uses: USART5_RX
Changed:
<
<

D12 / MISO / PA6 / CN7.12

>
>

D12 / MISO / PA6 / JD.7

 
  • SPI SPI1_MISO
  • PWM out on TIM3_CH1
  • Alternate uses: I2S2ext SD, SPI2 MISO
Changed:
<
<

D13 / SCK / PA5 / CN7.10

>
>

D13 / SCK / PA5 / JD.8

 
  • SPI SPI1_SCK
  • Output Compare on TIM2_CH1
  • Alternate uses: ADC1_8
Changed:
<
<

D14 / SDA / PB9 / CN7.4

>
>

D14 / SDA / PB9 / JD.9

 
  • The I2C (Wire) data pin, Hardware I2C1_SDA
  • (PWM out on TIM4_CH4)
  • Alternate uses: USART4_RX
Changed:
<
<

D15 / SCL / PB8 / CN7.2

  • the I2C (Wire) clock pin, Hardware I2C1_SCL
  • (PWM out on TIM4_CH3)
  • Alternate uses: USART4_TX
>
>

RESET / JD.10

UART_RX / PB7 / CN10.16

  • Receive (input) pin for Serial1. Hardware USART1_RX
  • PWM out on TIM4_CH2
  • Alternate uses: I2C1_SDA

UART_TX / PB6 / CN10.14

  • Transmit (output) pin for Serial1. Hardware USART1_TX
  • PWM out on TIM4_CH1
  • Alternate uses: I2C1_SCL

MOSI / PB5 / CN7.14

  • SPI SPI1_MOSI
  • PWM out on TIM3_CH2
  • Alternate uses: USART5_RX
 
Added:
>
>

MISO / PA6 / CN7.12

  • SPI SPI1_MISO
  • PWM out on TIM3_CH1
  • Alternate uses: I2S2ext SD, SPI2 MISO

SCK / PA5 / CN7.10

  • SPI SPI1_SCK
  • Output Compare on TIM2_CH1
  • Alternate uses: ADC1_8

SDA / PB9 / CN7.4

  • The I2C (Wire) data pin, Hardware I2C1_SDA
  • (PWM out on TIM4_CH4)
  • Alternate uses: USART4_RX
 

Analog Pins

Changed:
<
<

A0 / D16 / PA3 / CN9.1

>
>

AREF+ / D16 / PA3 / JA.1

  • This pin is analog input A0 (ADC1_IN15)
  • Input Capture on TIM2_CH4
  • Alternate uses: USART2_RX

A0 / D16 / PA3 / JA.2

 
  • This pin is analog input A0 (ADC1_IN15)
  • Input Capture on TIM2_CH4
  • Alternate uses: USART2_RX
Changed:
<
<

A1 / D17 / PC0 / CN9.3

>
>

A1 / D17 / PC0 / JA.3

 
  • This pin is analog input A1 (ADC1_IN10)
Changed:
<
<

A2 / D18 / PC3 / CN9.5

>
>

A2 / D18 / PC3 / JA.4

 
  • This pin is analog input A2 (ADC3_IN1)
  • PWM out on TIM1_CH3N
Changed:
<
<

A3 / D19 / PB1 / CN9.7

>
>

A3 / D19 / PB1 / JA.5

 
  • This pin is analog input A3 (ADC1_IN5)
  • PWM out on TIM3_CH2
Changed:
<
<

A4 / D20 / PC2 / CN9.9

>
>

A4 / D20 / PC2 / JA.6

 
  • This pin is analog input A4 (ADC3_IN0)
Changed:
<
<

A5 / D21 / PF10 / CN9.11

>
>

A5 / D21 / PF10 / JA.7

  • This pin is analog input A5 (ADC3_IN6)

A6 / D21 / PF10 / JA.8

 
  • This pin is analog input A5 (ADC3_IN6)

Revision 62022-06-13 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="MecrispCubeH743"
%DASHBOARD{ section="banner" image="/twiki/pub/MecrispCube/MecrispCubeH743/NUCLEO-H743ZI2-header.jpg"
Changed:
<
<
title="Board Support Package for the STM NUCLEO-H743ZI Board"
>
>
title="Board Support Package for the Arduino Portenta H7 Development Board"
  titlestyle="color:#F00000;" }%
Intro
DRAFT
Changed:
<
<
The board support package for the STM NUCLEO-H743ZI Board is restricted to the Arduino UNO pin header and the onboard LEDs and switch (push button). The STM32H743 has much more capabilities then 16 digital I/O pins, 6 analog input pins, UART, SPI, and I2C interfaces. But if you want to use the more advanced features you can use the CubeMX to create source code for the internal peripherals. This project wants to show how to use the Cube Ecosystem for a Forth system (or vice versa) and can't implement all features and possibilities the STM32H743 has. It is a good starting point for your project.
>
>
The board support package for the Arduino Portenta H7 Board is restricted to the Arduino MKR pin header and the onboard RGB LED and switch (push button). The STM32H747 has much more capabilities then 15 digital I/O pins, 7 analog input pins, UART, SPI, and I2C interfaces. But if you want to use the more advanced features you can use the CubeMX to create source code for the internal peripherals. This project wants to show how to use the Cube Ecosystem for a Forth system (or vice versa) and can't implement all features and possibilities the STM32H747 has. It is a good starting point for your project.
 
Line: 31 to 31
 
  • LEDs: LED1 (green, PB0), LED2 (yellow, PE1), LED3 (red, PB14)
  • Switch: SW1, Push button (D7, PC13)
Changed:
<
<
  • Digital and analog pins, Arduino Uno Header
    • Digital port pins: D0 to D15 (ST Zio D16 to D72)
    • Analog port pins: A0 to A5 (ST Zio A6 to A8)
>
>
  • Digital and analog pins, Arduino MKT Header
    • Digital port pins: D0 to D14
    • Analog port pins: A0 to A6
 
    • PWM:
      • TIM1: D3, D4, D5, D6
      • TIM3: D11, D12
Line: 420 to 420
 

Pinouts

Error: (1) can't find pinout_legend_2017-06-28-2.png at /MecrispCube.MecrispCubeH743
Changed:
<
<
Error: (1) can't find nucleo_h743zi2_zio_left_2019_10_9.png at /MecrispCube.MecrispCubeH743 Error: (1) can't find nucleo_h743zi2_zio_right_2019_10_9.png at /MecrispCube.MecrispCubeH743 Error: (1) can't find nucleo_h743zi2_morpho_left_2019_10_9.png at /MecrispCube.MecrispCubeH743 Error: (1) can't find nucleo_h743zi2_morpho_right_2019_10_9.png at /MecrispCube.MecrispCubeH743
>
>
Full Pinout https://docs.arduino.cc/static/2d38006e78d2abc588a80f12bb9c0c70/ABX00042-full-pinout.pdf
 
SCL D15, SDA D14

Revision 52022-06-13 - TWikiGuest

Line: 1 to 1
 
META TOPICPARENT name="MecrispCubeH743"
%DASHBOARD{ section="banner"

Revision 42022-04-18 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="MecrispCubeH743"
%DASHBOARD{ section="banner"
Line: 22 to 22
 
  • Forth as CMSIS-RTOS thread. CMSIS-RTOS API to use FreeRTOS from Forth.
  • Buffered terminal I/O (5 KiB buffer for UART Rx). Interrupt driven and RTOS aware, key and emit block the calling thread.
    • USART1: D0 RX, D1 TX
Changed:
<
<
    • USART6: ST-LINK VCP
>
>
    • USART3: ST-LINK VCP
 
Line: 30 to 30
 
Changed:
<
<
  • Switch: SW1, Push button (PC13)
>
>
  • Switch: SW1, Push button (D7, PC13)
 
  • Digital and analog pins, Arduino Uno Header
    • Digital port pins: D0 to D15 (ST Zio D16 to D72)
    • Analog port pins: A0 to A5 (ST Zio A6 to A8)
    • PWM:
Changed:
<
<
      • TIM3: D5, D6
      • TIM4: D9, D10, D14, D15
    • Input capture TIM2: A1,
    • Output compare TIM2: D0, D1
>
>
      • TIM1: D3, D4, D5, D6
      • TIM3: D11, D12
      • TIM4: D0, D1, D9, D10
    • Input capture TIM2: A0
    • Output compare TIM2: D13
 
    • EXTI: D11, D12, D13
  • SPI: D2 SCK, D3 MISO, D4 MOSI (e.g. for display, memory)
  • I2C: D14 SDA, D15 SCL (external peripherals)
Line: 467 to 468
 
  • Alternate uses: USART6_TX

D7 / PC13 / CN10.2

Added:
>
>
  • Blue Button
 
  • Alternate uses: SPI6_MISO, USART6_RTS
Line: 493 to 495
 

D13 / SCK / PA5 / CN7.10

  • SPI SPI1_SCK
Changed:
<
<
  • PWM out on TIM2_CH1
>
>
  • Output Compare on TIM2_CH1
 
  • Alternate uses: ADC1_8

D14 / SDA / PB9 / CN7.4

Line: 511 to 513
 

A0 / D16 / PA3 / CN9.1

  • This pin is analog input A0 (ADC1_IN15)
Changed:
<
<
  • PWM out on TIM2_CH4
>
>
  • Input Capture on TIM2_CH4
 
  • Alternate uses: USART2_RX

A1 / D17 / PC0 / CN9.3

Line: 526 to 528
 
  • PWM out on TIM3_CH2

A4 / D20 / PC2 / CN9.9

Changed:
<
<
  • This pin is analog input A4 (ADC3_IN1)
>
>
  • This pin is analog input A4 (ADC3_IN0)
 

A5 / D21 / PF10 / CN9.11

  • This pin is analog input A5 (ADC3_IN6)
Line: 550 to 552
 

VCP UART

STLK_VCP_TX / PG14 / ST-LINK VCP Rx

Changed:
<
<
  • USART6_TX
>
>
  • USART3_TX
 

STLK_VCP_RX / PG9 / ST-LINK VCP Tx

Changed:
<
<
  • USART6_RX
>
>
  • USART3_RX
 

Revision 32022-03-08 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="MecrispCubeH743"
%DASHBOARD{ section="banner"
Line: 20 to 20
 
  • 512? KiB RAM dictionary
  • 784? KiB Flash dictionary
  • Forth as CMSIS-RTOS thread. CMSIS-RTOS API to use FreeRTOS from Forth.
Changed:
<
<
  • Buffered terminal I/O (5 KiB buffer for UART Rx). Interrupt driven and RTOS aware, key and emit block the calling thread. USART3: D0 RX, D1 TX
>
>
  • Buffered terminal I/O (5 KiB buffer for UART Rx). Interrupt driven and RTOS aware, key and emit block the calling thread.
    • USART1: D0 RX, D1 TX
    • USART6: ST-LINK VCP
 
Line: 39 to 41
 
    • Output compare TIM2: D0, D1
    • EXTI: D11, D12, D13
  • SPI: D2 SCK, D3 MISO, D4 MOSI (e.g. for display, memory)
Changed:
<
<
  • I2C: D14 SDA, D15 SCL (external peripherals Qwiic / STEMMA QT port)
>
>
  • I2C: D14 SDA, D15 SCL (external peripherals)
 
  • vi Editor origin in BusyBox tiny vi. Workflow development: begin Edit EVALUATE while SaveFile repeat
  • Real Time Clock (32 bit UNIX time stamp, valid times are from 1.1.2000 to 31.12.2099 because of the STM32WB RTC peripheral) time!, time@, and .time (YYYY-MM-DDTHH:MM:SS ISO 8601).

Changed:
<
<
Defaults: Digital port pins D1, D5, D6, D9 to D13 are inputs; D0 (UART_RX) is input with 100 kOhm pull-up resistor; D14 (SDA) and D15 (SCL) are open drain outputs with 10 kOhm pull-up resistors; D5, D6, and D9 with internal pull-ups (for the push buttons).
>
>
Defaults:
  • Digital port pins D2 to D13 are inputs
  • D0 (UART_RX) is input with internal pull-up resistor, D1 (UART_TX) is output
  • D14 (SDA) and D15 (SCL) are open drain outputs with internal pull-up resistors
 

Line: 541 to 547
 

USB_DP / PA12

USB_DM / PA11

Added:
>
>

VCP UART

STLK_VCP_TX / PG14 / ST-LINK VCP Rx

  • USART6_TX

STLK_VCP_RX / PG9 / ST-LINK VCP Tx

  • USART6_RX
 

Revision 22022-03-07 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="MecrispCubeH743"
%DASHBOARD{ section="banner"
Line: 431 to 431
 

RESET / JP1.16

Changed:
<
<

D0 / UART_RX / PB11 / JP1.3

  • Receive (input) pin for Serial3. Hardware USART3
  • PWM out on TIM2_CH4
  • Alternate uses: I2C2 SDA
>
>

D0 / UART_RX / PB7 / CN10.16

  • Receive (input) pin for Serial1. Hardware USART1_RX
  • PWM out on TIM4_CH2
  • Alternate uses: I2C1_SDA
 
Changed:
<
<

D1 / UART_TX / PB10 / JP1.2

  • Transmit (output) pin for Serial3. Hardware USART3
  • PWM out on TIM2_CH3
  • Alternate uses: I2C2 SCL

D2 /SCK / PB13 / JP1.6

  • The SPI bus clock pin. Hardware SPI2
  • PWM out on TIM1_CH1N
  • Alternate uses: I2S2 Clock, CAN2 TX

D3 / MISO / PB14 / JP1.4

  • The SPI bus clock pin. Hardware SPI2
  • PWM out on TIM1_CH2N
  • Alternate uses: I2S2ext SD
>
>

D1 / UART_TX / PB6 / CN10.14

  • Transmit (output) pin for Serial1. Hardware USART1_TX
  • PWM out on TIM4_CH1
  • Alternate uses: I2C1_SCL
 
Changed:
<
<

D4 / MOSI / PB15 / JP1.5

  • The SPI bus clock pin. Hardware SPI2
  • PWM out on TIM1_CH3N
  • Alternate uses: I2S2 SD
>
>

D2 / PG14 / CN10.12

  • Alternate uses: UART6_TX, SPI6_MOSI
 
Changed:
<
<

D5 / Button C / PC7 / JP3.10

  • PWM out on TIM3_CH2
  • Alternate uses: USART6 RX, I2S3 MCK
>
>

D3 / PE13 / CN10.10

  • PWM out on TIM1_CH3
  • Alternate uses: SPI6_MISO
 
Changed:
<
<

D6 / Button B / PC6 / JP3.9

  • PWM out on TIM3_CH1
  • Alternate uses: USART6 TX, I2S2 MCK
>
>

D4 / PE14 / CN10.8

  • PWM out on TIM1_CH4
  • Alternate uses: SPI4_MOSI
 
Changed:
<
<

D7 / PC13

>
>

D5 / PE11 / CN10.6

  • PWM out on TIM1_CH2
  • Alternate uses: USART6_RX
 
Changed:
<
<

D8 / PC0

>
>

D6 / PE9 / CN10.4

  • PWM out on TIM1_CH1
  • Alternate uses: USART6_TX
 
Added:
>
>

D7 / PC13 / CN10.2

  • Alternate uses: SPI6_MISO, USART6_RTS
 
Deleted:
<
<

D9 / PB8 / JP3.8

  • PWM out on TIM4_CH3
  • Alternate uses: CAN1 RX, I2C1 SCL
 
Changed:
<
<

D10 / PB9 / JP3.7

>
>

D8 / PF3 / CN7.20

  • Alternate uses: ADC3_5

D9 / PD15 / CN7.18

 
  • PWM out on TIM4_CH4
Changed:
<
<
  • Alternate uses: CAN1 TX, I2C1 SDA
>
>
  • Alternate uses: UART8_RTS
 
Changed:
<
<

D11 / PC3 / JP3.6

  • No PWM
  • Alternate uses: I2S2 SD, SPI2 MOSI
>
>

D10 / PD14 / CN7.16

  • PWM out on TIM4_CH3
  • Alternate uses: UART8_CTS, SPI1_CS
 
Changed:
<
<

D12 / PC2 / JP3.5

  • No PWM
>
>

D11 / MOSI / PB5 / CN7.14

  • SPI SPI1_MOSI
  • PWM out on TIM3_CH2
  • Alternate uses: USART5_RX

D12 / MISO / PA6 / CN7.12

  • SPI SPI1_MISO
  • PWM out on TIM3_CH1
 
  • Alternate uses: I2S2ext SD, SPI2 MISO
Changed:
<
<

D13 / PC1 / JP3.4

>
>

D13 / SCK / PA5 / CN7.10

  • SPI SPI1_SCK
  • PWM out on TIM2_CH1
  • Alternate uses: ADC1_8

D14 / SDA / PB9 / CN7.4

  • The I2C (Wire) data pin, Hardware I2C1_SDA
  • (PWM out on TIM4_CH4)
  • Alternate uses: USART4_RX

D15 / SCL / PB8 / CN7.2

  • the I2C (Wire) clock pin, Hardware I2C1_SCL
  • (PWM out on TIM4_CH3)
  • Alternate uses: USART4_TX
 
Deleted:
<
<

D14 / SDA / PB7 / JP3.12

  • The I2C (Wire) data pin, this has a 10K pullup to 3.3V. Hardware I2C1
  • PWM out on TIM4_CH2
  • Alternate uses: USART1 RX
 
Changed:
<
<

D15 / SCL / PB6 / JP3.11

  • the I2C (Wire) clock pin, this has a 10K pullup to 3.3V. Hardware I2C1
  • PWM out on TIM4_CH1
  • Alternate uses: USART1 TX, CAN2 TX
>
>

Analog Pins

 
Added:
>
>

A0 / D16 / PA3 / CN9.1

  • This pin is analog input A0 (ADC1_IN15)
  • PWM out on TIM2_CH4
  • Alternate uses: USART2_RX
 
Changed:
<
<

Analog Pins

>
>

A1 / D17 / PC0 / CN9.3

  • This pin is analog input A1 (ADC1_IN10)
 
Changed:
<
<

A0 / GPIO 16 / PA4 / JP1.12

  • This pin is analog input A0 (ADC12 IN4)
  • Analog output (DAC OUT1) due to having a DAC (digital-to-analog converter). You can set the raw voltage to anything from 0 to 3.3V, unlike PWM outputs this is a true analog output
  • No PWM or alternate uses

A1 / GPIO 17 / PA5 / JP1.11

  • This pin is analog input A1 (ADC12 IN5)
  • Analog output (DAC OUT2) due to having a DAC (digital-to-analog converter). This is the second DAC, and is 'independent' of A0. You can set the raw voltage to anything from 0 to 3.3V, unlike PWM outputs this is a true analog output.
  • Alternative uses: SPI1 SCK

A2 / GPIO18 / PA6 / JP1.10

  • This pin is analog input A2 (ADC12 IN6)
  • Alternative uses: SPI1 MISO
  • PWM out on TIM3_CH1
>
>

A2 / D18 / PC3 / CN9.5

  • This pin is analog input A2 (ADC3_IN1)
  • PWM out on TIM1_CH3N
 
Changed:
<
<

A3 / GPIO19 / PA7 / JP1.9

  • This pin is analog input A3 (ADC12 IN7)
  • Alternative uses: SPI1 MOSI
>
>

A3 / D19 / PB1 / CN9.7

  • This pin is analog input A3 (ADC1_IN5)
 
  • PWM out on TIM3_CH2
Changed:
<
<

A4 / GPIO20 / PC4 / JP1.8

  • This pin is analog input A4 (ADC12 IN14)
>
>

A4 / D20 / PC2 / CN9.9

  • This pin is analog input A4 (ADC3_IN1)
 
Changed:
<
<

A5 / GPIO21 / PC5 / JP1.7

  • This pin is analog input A5 (ADC12 IN15)
>
>

A5 / D21 / PF10 / CN9.11

  • This pin is analog input A5 (ADC3_IN6)
 

SD Card / SDIO Pins

Changed:
<
<

SDIO_D0 / SD_MISO / PC8 (internal)

SDIO_D1 / PC9 (internal)

SDIO_D2 / PC10 (internal)

SDIO_D3 / SD_CS / PC11 (internal)

SDIO_CLK / SD_CLK / PC12 (internal)

SDIO_CMD / SD_MOSI / PD2 (internal)

SD_DETECT / PB12 (internal)

>
>

SDIO_D0 / PC8 (internal) / CN8.2

SDIO_D1 / PC9 (internal) / CN8.4

SDIO_D2 / PC10 (internal) / CN8.6

SDIO_D3 / PC11 (internal) / CN8.8

SDIO_CLK / PC12 (internal) / CN8.10

SDIO_CMD / PD2 (internal) / CN8.12

SD_DETECT / PB12 (internal) / optional / CN7.7

 

USB

Revision 12022-03-07 - PeterSchmid

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="MecrispCubeH743"
Board Support Package for the STM NUCLEO-H743ZI Board
Intro
DRAFT

The board support package for the STM NUCLEO-H743ZI Board is restricted to the Arduino UNO pin header and the onboard LEDs and switch (push button). The STM32H743 has much more capabilities then 16 digital I/O pins, 6 analog input pins, UART, SPI, and I2C interfaces. But if you want to use the more advanced features you can use the CubeMX to create source code for the internal peripherals. This project wants to show how to use the Cube Ecosystem for a Forth system (or vice versa) and can't implement all features and possibilities the STM32H743 has. It is a good starting point for your project.

Overview

  • 512? KiB RAM dictionary
  • 784? KiB Flash dictionary
  • Forth as CMSIS-RTOS thread. CMSIS-RTOS API to use FreeRTOS from Forth.
  • Buffered terminal I/O (5 KiB buffer for UART Rx). Interrupt driven and RTOS aware, key and emit block the calling thread. USART3: D0 RX, D1 TX
  • USB-CDC for serial communication via USB. Redirect console I/O like cdc-emit, cdc-key
  • microSD and internal Flash mass storage for blocks and FAT filesystem.
  • LEDs: LED1 (green, PB0), LED2 (yellow, PE1), LED3 (red, PB14)
  • Switch: SW1, Push button (PC13)
  • Digital and analog pins, Arduino Uno Header
    • Digital port pins: D0 to D15 (ST Zio D16 to D72)
    • Analog port pins: A0 to A5 (ST Zio A6 to A8)
    • PWM:
      • TIM3: D5, D6
      • TIM4: D9, D10, D14, D15
    • Input capture TIM2: A1,
    • Output compare TIM2: D0, D1
    • EXTI: D11, D12, D13
  • SPI: D2 SCK, D3 MISO, D4 MOSI (e.g. for display, memory)
  • I2C: D14 SDA, D15 SCL (external peripherals Qwiic / STEMMA QT port)
  • vi Editor origin in BusyBox tiny vi. Workflow development: begin Edit EVALUATE while SaveFile repeat
  • Real Time Clock (32 bit UNIX time stamp, valid times are from 1.1.2000 to 31.12.2099 because of the STM32WB RTC peripheral) time!, time@, and .time (YYYY-MM-DDTHH:MM:SS ISO 8601).

Defaults: Digital port pins D1, D5, D6, D9 to D13 are inputs; D0 (UART_RX) is input with 100 kOhm pull-up resistor; D14 (SDA) and D15 (SCL) are open drain outputs with 10 kOhm pull-up resistors; D5, D6, and D9 with internal pull-ups (for the push buttons).

Board Support Words

led1!        ( n -- )    sets LED1 (green)
led2!        ( n -- )    sets LED2 (yellow)
led3!        ( n -- )    sets LED3 (red)
led1@        ( -- n )    gets LED1 (green)
led2@        ( -- n )    gets LED2 (yellow)
led3@        ( -- n )    gets LED3 (red)

switch1?     ( -- n )    gets switch1 (button A), closed=TRUE
dport!       ( n -- )    sets the digital output port (D0=bit0 .. D15=bit15).
dport@       ( -- n )    gets the digital input/output port (D0=bit0 .. D15=bit15).
dpin!        ( n a -- )  sets the digital output port pin a (D0=0 .. D15=15, A0=16 .. A6=23)
dpin@        ( a -- n )  gets the digital input/output port pin a
dmod         ( u a -- )  sets the pin mode: 0 in, 1 in pull-up, 2 in pull-down, 3 out push pull, 4 out open drain, 
                                            5 out push pull PWM, 6 input capture, 7 output compare, 8 I2C, 9 USART, 10 analog

EXTImod      ( u a -- )  Sets for pin a (D11, D12, D13) the EXTI mode u: 0 rising, 1 falling, 2 both edges, 3 none
EXTIwait     ( u a -- )  Wait for EXTI interrupt on pin a (D11, D12, D13), timeout u in [ms]

pwmpin!      ( u a -- )  sets the digital output port pin a (D5=5, D6=6, D9=9, D10=10, D14=14, and D15=15) to a PWM value u (0..1000).
                           Default frequency is 1 kHz, TIMER3/TIMER4
pwmprescale  ( u --  )   Sets the PWM prescale for TIMER3/TIMER4. 42 kHz / prescale, default 42 -> PWM frequency 1 kHz

ICOCprescale ( u -- )    Sets the input capture / output compare prescale for TIMER2. default 42 -> 42 MHz / 42 = 1 MHz, timer resolution 1 us
ICOCperiod!  ( u -- )    Sets the input capture / output compare (TIMER2) period. default $FFFFFFFF (4'294'967'295). 
                         When the up counter reaches the period, the counter is set to 0. 
                         For prescale 32 the maximum time is about 1 h 11 m
ICOCcount!   ( -- u )    Sets the input capture / output compare counter for TIMER2
ICOCcount@   ( u -- )    Gets the input capture / output compare counter for TIMER2
ICOCstart    ( -- )      Starts the ICOC period
ICOCstop     ( -- )      Stops the ICOC period
OCmod        ( u a -- )  Sets for pin a (D0, D1) the Output Compare mode u: 0 frozen, 1 active level on match, 
                           2 inactive level on match, 3 toggle on match, 4 forced active, 5 forced inactive
    
OCstart      ( u a -- )  Starts the output compare mode for pin a with pulse u
OCstop       ( a -- )    Stops output compare for pin a
ICstart      ( u -- )    Starts input capture u: 0 rising edge, 1 falling edge, 2 both edges
ICstop       ( -- )      Stops input capture

waitperiod   ( -- )      wait for the end of the TIMER2 period
OCwait       ( a -- )    wait for the end of output capture on pin a
ICwait       ( u -- u )  wait for the end of input capture with timeout u, returns counter u

apin@        ( a -- u )  gets the analog input port pin (A0=0 .. A6=6). Returns a 12 bit value (0..4095) 

Using the Digital Port Pins (Input and Output)

Set 8 port pins to push/pull output

3 15 dmod   \ set D15 (SCL) to Output
3 5  dmod   \ set D5 to Output
3 6  dmod   \ set D6 to Output
3 9  dmod   \ set D9 to Output
3 10 dmod   \ set D10 to Output
3 11 dmod   \ set D11 to output
3 12 dmod   \ set D12 to output
3 13 dmod   \ set D13 to output

remap D15, D5, .. D13

create port-map 15 , 5 , 6 , 9 , 10 , 11 , 12 , 13 ,

: pin ( n -- n )  \ gets the Dx pin number
  cells port-map + @
;

: left ( -- ) 
  7 0 do
    1 i pin dpin! 
    100 osDelay drop  
    0 i pin dpin!
  loop 
;
: right ( -- )
  8 1 do  
    1 8 i - pin dpin! 
    100 osDelay drop  
    0 8 i - pin dpin!
  loop 
;
: knigthrider ( -- )
  begin 
    left right 
    key? 
  until    \ key pressed
  0 0 dpin!
  key drop     \ eat key
;

Use the port pins on the lower row:

3 16 dmod   \ set A0 to Output
3 17 dmod   \ set A1 to Output
3 18 dmod   \ set A2 to Output
3 19 dmod   \ set A3 to Output
3 20 dmod   \ set A4 to Output
3 21 dmod   \ set A5 to output
3 2 dmod    \ set D2 (SCK) to output
3 4 dmod    \ set D4 (MOSI) to output

remap D15, D5, .. D13

create port-map 16 , 17 , 18 , 19 , 20 , 21 , 2 , 4 ,

Using the ADC (Analog Input Pins)

Control the Neopixel

apin@ ( a -- u ) returns the ADC value (12 bit, 0 .. 4095) from one of the analog pins A0 to A5 (0 .. 5). Here I use the A0 to control the neopixel blue led brightness.

: neo-blue ( -- ) 
  begin
    0 apin@ 16 /  neopixel! 
    10 osDelay drop
  key? until 
  key drop
;

Control the Knightrider Pace

apin@ ( a -- u ) returns the ADC value (12 bit, 0 .. 4095) from one of the analog pins A0 to A5 (0 .. 5). Here I use the A0 to control the delay.

: left ( -- ) 
  7 0 do
    1 i pin dpin! 
    0 apin@ 10 / osDelay drop  \ delay depends on A0
    0 i pin dpin!
  loop 
;
: right ( -- )
  8 1 do  
    1 8 i - pin dpin! 
    0 apin@ 10 / osDelay drop  \ delay depends on A0
    0 8 i - pin dpin!
  loop 
;

Using the PWM (Analog Output Pins)

Six port pins are supported so far. The 16 bit timers TIM3 (D5 and D6) and TIM4 (D9, D10, D14, and D15) are used for the timebase, time resolution is 1 us (42 MHz SysClk divided by 42). The PWM scale is from 0 (0 % duty cycle) to 1000 (100 % duty cycle), this results in a PWM frequency of 1 kHz. If you need higher PWM frequencies, decrease the divider and/or the scale.

PWM port pins: D5 (TIM3CH2), D6 (TIM3CH1), D9 (TIM4CH3), D10 (TIM4CH4), D14 (TIM4CH2), and D15 (TIM4CH1).

Simple test program to set brightness of a LED on pin D6 with a potentiometer on A0. Default PWM frequency is 1 kHz (prescaler set to 42). You can set the prescale with the word pwmprescale from 42 kHz (value 1) down to 0.5 Hz (64000).

5 6 dmod   \ set D6 to PWM

: pwm ( -- )
  begin 
    0 apin@  4 /  6 pwmpin!
    10 osDelay drop
    key? 
  until
  key drop
;

Control an RC Servo

https://en.wikipedia.org/wiki/Servo_(radio_control): The control signal is a digital PWM signal with a 50 Hz frame rate. Within each 20 ms timeframe, an active-high digital pulse controls the position. The pulse nominally ranges from 1.0 ms to 2.0 ms with 1.5 ms always being center of range. Pulse widths outside this range can be used for "overtravel" - moving the servo beyond its normal range.

A servo pulse of 1.5 ms width will typically set the servo to its "neutral" position (typically half of the specified full range), a pulse of 1.0 ms will set it to 0°, and a pulse of 2.0 ms to 90° (for a 90° servo). The physical limits and timings of the servo hardware varies between brands and models, but a general servo's full angular motion will travel somewhere in the range of 90° – 180° and the neutral position (45° or 90°) is almost always at 1.5 ms. This is the "standard pulse servo mode" used by all hobby analog servos.

The BSPs default PWM frequency is 1 kHz, 50 Hz is 20 times slower. The divider is therefore 42 * 20 = 840.

1 ms 50
45° 1.5 ms 75
90° 2 ms 100
180° 3 ms 150
270 4 ms 200

1 ms 50
90° 1.5 ms 75
180° 2 ms 100
270° 2.5 ms 150

840 pwmprescale 
5 5 dmod   \ set D5 to PWM

: servo ( -- ) 
  begin
    130 40 do
      i 5 pwmpin! 
      i neopixel! 
      i 40 = if 
        1000 \ give some more time to get back
      else
        200
      then 
      osDelay drop
    10 +loop
  key? until 
  key drop
;

Using Input Capture and Output Compare

Time Base

Default timer resolution is 1 us. The 32 bit TIMER2 is used as time base for Input Capture / Output Compare. For a 5 s period 5'000'000 cycles are needed. All channels (input capture / output compare) use the same time base.

: period ( -- )
  5000000 ICOCperiod! \ 5 s period
  ICOCstart
  begin
     waitperiod
     cr .time
  key? until
  key drop 
;

Output Compare

Output compare TIM2: D0, D1

7 0 dmod  \ output compare for D0
7 1 dmod  \ output compare for D1

: oc-toggle ( -- )
  5000000 ICOCperiod! \ 5 s period
  ICOCstart
  3 0 OCmod  1000000 0 OCstart \ toggle D0 after 1 s
  3 1 OCmod  2000000 1 OCstart \ toggle D1 after 2 s
  begin
     waitperiod
     cr .time
  key? until
  key drop 
;

When you abort (hit any key) the program, the timer still runs and controls the port pins. To stop the port pins:

0 OCstop  1 OCstop  

Or change the prescale to make it faster or slower:

1 ICOCprescale

Input Capture

This sample program measures the time between the edges on port A1. if no event occurs within 2 seconds, "timeout" is issued. Hit any key to abort program.

: ic-test ( -- )
  6 17 dmod \ input capture on A1
  ICOCstart
  2 ICstart  \ both edges
  ICOCcount@ ( -- count )
  begin
    2000 \ 2 s timeout
    ICwait ( -- old-capture capture ) 
    cr
    dup 0= if
      ." timeout" drop
    else 
      dup rot ( -- capture capture old-capture )
      - 1000 / . ." ms"
    then
  key? until
  key drop
  drop
  ICstop
;

Using EXTI line

D11, D12, and D13 can be used as an EXTI line. EXTIs are external interrupt lines, D13 uses EXTI1 (EXTI Line1 interrupt), D12 EXIT2, and D11 EXTI3.

: exti-test ( -- )
  2 11 EXTImod \ both edges on D11
  begin
    2000 11 EXTIwait \ wait for edge on D11 with 2 s timeout
    cr
    0= if
      11 dpin@ if
        ." rising edge"
      else
        ." falling edge"
      then 
    else
      ." timeout"
    then
  key? until
  key drop
;

Pinouts

Error: (1) can't find pinout_legend_2017-06-28-2.png at /MecrispCube.MecrispCubeH743

Error: (1) can't find nucleo_h743zi2_zio_left_2019_10_9.png at /MecrispCube.MecrispCubeH743 Error: (1) can't find nucleo_h743zi2_zio_right_2019_10_9.png at /MecrispCube.MecrispCubeH743 Error: (1) can't find nucleo_h743zi2_morpho_left_2019_10_9.png at /MecrispCube.MecrispCubeH743 Error: (1) can't find nucleo_h743zi2_morpho_right_2019_10_9.png at /MecrispCube.MecrispCubeH743

SCL D15, SDA D14
SCK D2, MO D4, MI D3, RX D0, TX D1
The anlog pins can be used as digital pins too:
A0 D16, A1 D17, A2 D18, A3 D19, A4 D20, A5 D21

Digital Pins

RESET / JP1.16

D0 / UART_RX / PB11 / JP1.3

  • Receive (input) pin for Serial3. Hardware USART3
  • PWM out on TIM2_CH4
  • Alternate uses: I2C2 SDA

D1 / UART_TX / PB10 / JP1.2

  • Transmit (output) pin for Serial3. Hardware USART3
  • PWM out on TIM2_CH3
  • Alternate uses: I2C2 SCL

D2 /SCK / PB13 / JP1.6

  • The SPI bus clock pin. Hardware SPI2
  • PWM out on TIM1_CH1N
  • Alternate uses: I2S2 Clock, CAN2 TX

D3 / MISO / PB14 / JP1.4

  • The SPI bus clock pin. Hardware SPI2
  • PWM out on TIM1_CH2N
  • Alternate uses: I2S2ext SD

D4 / MOSI / PB15 / JP1.5

  • The SPI bus clock pin. Hardware SPI2
  • PWM out on TIM1_CH3N
  • Alternate uses: I2S2 SD

D5 / Button C / PC7 / JP3.10

  • PWM out on TIM3_CH2
  • Alternate uses: USART6 RX, I2S3 MCK

D6 / Button B / PC6 / JP3.9

  • PWM out on TIM3_CH1
  • Alternate uses: USART6 TX, I2S2 MCK

D7 / PC13

D8 / PC0

D9 / PB8 / JP3.8

  • PWM out on TIM4_CH3
  • Alternate uses: CAN1 RX, I2C1 SCL

D10 / PB9 / JP3.7

  • PWM out on TIM4_CH4
  • Alternate uses: CAN1 TX, I2C1 SDA

D11 / PC3 / JP3.6

  • No PWM
  • Alternate uses: I2S2 SD, SPI2 MOSI

D12 / PC2 / JP3.5

  • No PWM
  • Alternate uses: I2S2ext SD, SPI2 MISO

D13 / PC1 / JP3.4

D14 / SDA / PB7 / JP3.12

  • The I2C (Wire) data pin, this has a 10K pullup to 3.3V. Hardware I2C1
  • PWM out on TIM4_CH2
  • Alternate uses: USART1 RX

D15 / SCL / PB6 / JP3.11

  • the I2C (Wire) clock pin, this has a 10K pullup to 3.3V. Hardware I2C1
  • PWM out on TIM4_CH1
  • Alternate uses: USART1 TX, CAN2 TX

Analog Pins

A0 / GPIO 16 / PA4 / JP1.12

  • This pin is analog input A0 (ADC12 IN4)
  • Analog output (DAC OUT1) due to having a DAC (digital-to-analog converter). You can set the raw voltage to anything from 0 to 3.3V, unlike PWM outputs this is a true analog output
  • No PWM or alternate uses

A1 / GPIO 17 / PA5 / JP1.11

  • This pin is analog input A1 (ADC12 IN5)
  • Analog output (DAC OUT2) due to having a DAC (digital-to-analog converter). This is the second DAC, and is 'independent' of A0. You can set the raw voltage to anything from 0 to 3.3V, unlike PWM outputs this is a true analog output.
  • Alternative uses: SPI1 SCK

A2 / GPIO18 / PA6 / JP1.10

  • This pin is analog input A2 (ADC12 IN6)
  • Alternative uses: SPI1 MISO
  • PWM out on TIM3_CH1

A3 / GPIO19 / PA7 / JP1.9

  • This pin is analog input A3 (ADC12 IN7)
  • Alternative uses: SPI1 MOSI
  • PWM out on TIM3_CH2

A4 / GPIO20 / PC4 / JP1.8

  • This pin is analog input A4 (ADC12 IN14)

A5 / GPIO21 / PC5 / JP1.7

  • This pin is analog input A5 (ADC12 IN15)

SD Card / SDIO Pins

SDIO_D0 / SD_MISO / PC8 (internal)

SDIO_D1 / PC9 (internal)

SDIO_D2 / PC10 (internal)

SDIO_D3 / SD_CS / PC11 (internal)

SDIO_CLK / SD_CLK / PC12 (internal)

SDIO_CMD / SD_MOSI / PD2 (internal)

SD_DETECT / PB12 (internal)

USB

USB_DP / PA12

USB_DM / PA11

-- Peter Schmid - 2022-03-07

Creative Commons License
This work by Peter Schmid is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

<--/commentPlugin-->
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback