TN0837 STMICROELECTRONICS | Alldatasheet

Document overview

  • Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
  • PDF pages: 11

Technical content

Datasheet sections

  • 1 Hardware configuration to select boot mode
  • 1.1 SPC560P34x/SPC560P40x boot pins
  • 1.2 Autobaud feature

September 2013 Doc ID 022359 Rev 2 1/11 TN0837 Technical note SPC560P34x/SPC560P40x Serial Boot with Autobaud Autoscan reference manual addendum Introduction The aim of this document is to give a supplementary description for serial boot modes in addition to the description in RM0046, rev. 3 (see Section Appendix A). It is described the hardware configuration to allow the right selection of the serial boot mode with autobaud by means of autoscan and the RX pins configuration of serial communication peripherals (FlexCAN and LINFlex).

1 Hardware configuration to select boot mode

ABS (Alternate Boot Selector) pins (see Table 1).

  • PAD A[2] - ABS[0],
  • PAD A[3] - ABS[1],
  • PAD A[4] - FAB Note: PAD A[2] - ABS[0] is not bonded on SPC560P34x/SPC560P40x LQFP64 so for this package the option 'FlexCAN without Autobaud ' is not available and the internal pull-down on PAD A[2] assures that it is at low logical value at reset."

1.1 SPC560P34x/SPC560P40x boot pins

Table 1. Hardware configuration to select boot mode

  1. During reset the boot configuration pins are weak pull down.

Table 2. SPC560P34x/SPC560P40x boot pins

1.2 Autobaud feature

  • for LQFP100 internal weak pull-up enabled for both RX pins,
  • for LQFP64 internal weak pull-up enabled only for FlexCAN_0 RX pin. The autoscan routine waits in polling for the first LOW level to select which routine will be executed:
  • FlexCAN Autobaud routine
  • LinFlex Autobaud routine Then the measurement baud rate is computed to configure the serial communication at the right rate. In the end of baud rate measurement, LinFlex_0 RX pin and FlexCAN_0 RX pin switches to work as dedicated pin. Baud rate measurement is using the System Timer Module (STM) which is driven by the system clock. Measurement itself is performed by software polling the related inputs as general purpose IO’s, resulting in a detection granularity that is directly related to the execution speed of the software. One main difference of the autobaud feature is that the system clock is not driven directly by the external oscillator, but it is driven by the FMPLL output. The reason is that to have an optimum resolution for baud rate measurement, the system clock needs to be nearer to the maximum allowed device’s frequency. This is achieved with the following two steps: 1. using the Clock Monitor Unit (CMU) and the internal RC oscillator (IRC), the external frequency is measured using the IRC as reference to determine this frequency. 2. Based on the result of this measurement, the FMPLL is programmed to generate a system clock that is configured to be near, but lower, to the maximum allowed frequency. After setting up the system clock, the BAM autoscan code configures the FlexCAN RX pin (B[1] on all packages) and LINFlex RX pin (B[3] on LQFP100 or B[7] on LQFP64) as GPIO inputs and searches for FlexCAN RX pin level to verify if CAN is connected or not. 1. Weak pull down during reset. 2. SPC560P34x/SPC560P40x LQFP1 00 package uses only PAD B[3] - pin 80 for boot via LINFLEX 3. SPC560P34x/SPC560P40x LQFP64 package uses only PAD B[7] - pin 20 for boot via LINFLEX

Table 2. SPC560P34x/SPC560P40x boot pins (continued)

SPC560P34x, SPC560P40x Hardware configuration to select boot mode Doc ID 022359 Rev 2 7/11 Then continuously waits in polling on change of RX pins level.The FlexCAN RX pin level takes precedence. First signal found at low level selects the serial boot routine that will be executed. In case a low level is detected on any input, the corresponding autobaud measurement functionality is started:

  • when FlexCAN RX (corresponds to pin B[1]) level is low, the CAN autobaud measurement starts and then sets up the FlexCAN baud rate accordingly;
  • when UART RX (corresponds to pin B[3] on LQFP100 or B[7] on LQFP64) level is low, the UART autobaud measurement starts and then sets up the LINFlex baud rate accordingly. After performing the autobaud measurement and setting up the baud rate, the corresponding RX input is reconfigured and the related standard download process is started; in case of a detected CAN transmission a download using the CAN protocol as described in section “Bootstrap with FlexCAN— autobaud disabled”of RM0046, rev. 3 (see Section Appendix A), and in case of a detected UART transmission a download using the UART protocol as described in Section” Boot from UART— autobaud disabled” of RM0046, rev.3 (see Section Appendix A). The following Figure 1 identifies the corresponding flow and steps. Note: When autobaud scan is selected, initially both LINFlex_0 RX pin and FlexCAN_0 RX pin should be at high level. No external circuity should pull-down them to allow right autoscan.

Hardware configuration to select boot mode SPC560P34x, SPC560P40x 8/11 Doc ID 022359 Rev 2Figure 1. BAM Autoscan code flow FlexCAN RX and LINFlex RX configured as GPIO inputs FlexCAN RX == 1 FlexCAN RX == 0 LINFlex RX == 0 CAN Autobaud Set matching baud rate for FlexCAN Autobaud measurement Continue with FlexCAN LINFlex Autobaud Set matching baud rate for LINFlex Autobaud measurement download Continue with LINFlex download NO YES detected detected LINFlex RX == 0 detected Both RDX pins have to be at high level. Avoid to connect them to external pull-down resistor. If CAN is connected, after reset CAN_RX has to be at high level

SPC560P34x, SPC560P40x Reference document Doc ID 022359 Rev 2 9/11 Appendix A Reference document 1. SPC560P34/SPC560P40 32-bit MCU family built on the embedded Power Architecture® (RM0046, rev.3 - Doc ID 16912)

Revision history

Table 3. Document revision history 12-Oct-2011 1 Initial release. 18-Sep-2013 2 Updated disclaimer.