AN2401 Application note

Size: px
Start display at page:

Download "AN2401 Application note"

Transcription

1 Application note upsd3400 USB firmware Introduction The upsd3400 combines a high-performance 8051-based microcontroller with numerous peripherals to facilitate the design of complex applications. Many applications require some sort of control or data communications with a host computer. While communication over a standard RS-232 serial link was the norm, USB (Universal Serial Bus) is becoming more and more popular. In many cases, the only serial port available on newer PCs is a USB port. The upsd3400 not only includes two UARTs used with typical RS-232 communication, but it also includes a full-speed (12 Mbps) USB port. This application note covers the various aspects of the USB port included in the device related to firmware control. It is highly recommended that the USB interface chapter of the upsd3400 datasheet be read first and available for reference as needed while reading this application note. It is also assumed that the reader is familiar with the USB specification and the terminology used. Additionally, several USB firmware examples for the upsd3400 are available on ST's website. They can be found at: under Support Files for the upsd family. July 2006 Rev 1 1/18

2 Contents AN2401 Contents 1 upsd3400 USB firmware Firmware responsibility USB SIE clock Endpoint FIFOs FIFO pairing Endpoint related interrupts Bus signaled events RESET SUSPEND and RESUME Control transfers USB address Endpoint receive mode Endpoint transmit mode USB endpoint control register (UCON) ENABLE STALL TOGGLE USB interrupt service routine (ISR) framework Treatment of USEL in the USB ISR - single FIFO usage Treatment of USEL in the USB ISR - double FIFO usage Revision history /18

3 upsd3400 USB firmware 1 upsd3400 USB firmware 1.1 Firmware responsibility The USB SIE (Serial Interface Engine) is responsible for automatically handling many of the low level protocol tasks relieving the firmware of that burden. Interrupts are only generated by the USB SIE when data has been successfully transmitted/received or when special signaling on the bus is generated or detected. The firmware is responsible for handling the following: 1. Decoding and handling incoming control requests sent with SETUP packets. 2. Preparing data to be sent to the host in response to IN packets. 3. Unloading data received from the host with OUT packets. 4. Handling of events indicated on the bus (Suspend, Reset, and Resume). 5. Managing the state of the USB device and responding to the host requests appropriately. Figure 1 below shows a block diagram of the USB module within the upsd3400. Please refer to the data sheet for an explanation of each of the blocks within it. Figure 1. USB module block diagram Clock PLL 3-40MHz 48MHz Endpoint MCU D D+ USB USB+ USB Transceiver Serial Interface Engine Endpoint0 Endpoint0 IN FIFOs (64 bytes each) FIFO Interface Logic OUT FIFOs (64 bytes each) XDATA CTRL S F R B u s USB SFRs Endpoint4 CTRL CTRL and Data SETUP Command Buffer (8 bytes) CTRL and Data AI USB SIE clock The USB SIE (Serial Interface Engine) requires a 48 MHz clock for proper operation. Included in the upsd3400 is a PLL that provides many options for obtaining a 48 MHz clock from various main clock frequencies. It is important to select a main clock crystal or oscillator frequency that can be used with the PLL to generate the 48 MHz clock. The USB_CLK section in the MCU CLOCK GENERATION chapter contains the details for the PLL with respect to setting it up to generate a 48 MHz clock from the main clock. Also 3/18

4 upsd3400 USB firmware AN2401 included is a table with some common main clock frequencies and some example PLL settings to generate a 48 MHz clock. An important thing to note is that the PLL lock time is 200 µs, so firmware should wait that amount of time after setting the PLL multiplier and divider bits in registers CCON0/1 before enabling the PLL (controlled by the UPLLCE bit in register CCON0). 1.3 Endpoint FIFOs The host PC transfers data between itself and a USB device through endpoints. From a device's standpoint, an endpoint is a FIFO. From the host's standpoint, an endpoint is either a destination for data that it sends to the device or a source of data that it has requested from the device. There are various types of data transfers (control, interrupt, bulk, or isochronous) and two directions of transfer, IN and OUT. IN transfers are from the device to the host and OUT transfers are from the host to the device. Each of the 5 endpoints in the upsd3400 has a FIFO for both IN and OUT directions for a total of 10 FIFOs. Each FIFO is 64 bytes in length resulting in a total of 640 bytes of FIFO. The endpoint FIFOs are accessible through a 64-byte window in the XDATA space. The base address for this window is written into two registers, UBASEH and UBASEL. The lower 5 bits of the base address is hardwired to "0", so the base address is aligned on 64-byte boundaries. The base address should be set to any available 64-byte window in the XDATA space not occupied by any external device, internal memory, or the CSIOP registers. Since the window into the XDATA memory space to access the FIFOs is through a 64-byte window, the particular endpoint to be accessed must be selected using the USEL register. There are three bits in that register that specify an endpoint number and another bit that specifies the direction. Using the USEL register, the endpoint FIFO of interest is accessed. The endpoint FIFOs are always available to the USB SIE, but are not available to firmware by default (after a hardware reset). The FIFO is made accessible by setting the VISIBLE bit in the USB control register (UCTL). For most applications it is only necessary to initially make the FIFO visible and this bit is not touched after that. 1.4 FIFO pairing For more efficient bulk data transfers, the FIFOs can be paired so the MCU can operate on one packet of data while another is being transferred over USB. Pairing is done on an odd endpoint basis, such that pairing on endpoint 1 uses endpoint 1's FIFO plus endpoint 2's FIFO (making endpoint 2 no longer available). The same is true for endpoint 3, such that when pairing is enabled, endpoint 3's FIFO and endpoint 4's FIFO is used and endpoint 4 is no longer available. From a firmware standpoint when pairing is enabled, the second FIFO is transparent and all transactions (status, interrupts, etc.) take place with respect to endpoint 1 and the hardware handles switching back and forth between accessing FIFO #1 and FIFO #2. By default (after a hardware reset), pairing is turned off. To enable pairing on an endpoint and direction basis, the UPAIR register must be written appropriately. Important Note: When FIFO pairing is enabled, in the background the hardware manages whether it is using endpoint 1 or endpoint 2's FIFO, status register, etc. This is handled by hardware, so firmware is not burdened with this overhead. However, the FIFO or status register actually being used by the hardware is indicated by the USEL register. For example, assuming there are 128 bytes of data to send to the host over endpoint 1, the firmware first writes to the USEL register to select endpoint 1 and then writes the data to the 4/18

5 upsd3400 USB firmware FIFO. After writing to the USIZE register (which arms the FIFO), the USEL register changes from 1 to 2. If firmware were to write a 1 to the USEL register and were to read it back, it would still be a 2. This is because the next FIFO to be loaded is for endpoint 2. Firmware would then check the FIFO status and would see that it is not full (even though the contents were not transferred yet). The firmware then writes data to the FIFO (that actually goes into endpoint 2 FIFO), and then sets the USIZE register. If USEL were read back, it would still be a 2. After the host sends an IN packet to the device and the first 64 bytes are transferred, a 1 would be read from USEL register. So, when FIFO pairing is used, always treat the pair as endpoint 1 and don't be concerned with what the hardware is doing in the background. The only time that USEL needs to be read is to save and restore it in the ISR (see the ISR section for further details). 1.5 Endpoint related interrupts There are three interrupts related to each endpoint, IN FIFO, OUT FIFO, and IN FIFO NAK. The IN FIFO interrupts indicate that a particular FIFO was transmitted successfully. The OUT FIFO interrupts indicate that the particular FIFO is full (a packet of data has been received from the host). The third interrupt, IN FIFO NAK, indicates that the host sent an IN token to the device and the device sent a NAK response. The device only sends a NAK response when there is no data available in the FIFO to send to the host. This particular interrupt is generally not used but in some applications it may be helpful to tell when the host is requesting data from the device signaling to the firmware to gather or generate the data to send in response. Each endpoint's three interrupts can be selectively enabled to generate an interrupt. All USB event related interrupts vector to the same location and the interrupt service routine firmware is responsible for checking the interrupt flag registers to determine the exact cause of the interrupt and process it accordingly. Since all USB event generated interrupts vector to the same location, the priority is determined by the order that the interrupt flags are checked and processed. 1.6 Bus signaled events RESET There are three bus conditions that indicate special events. Such events include RESET, SUSPEND, and RESUME. These events cause an interrupt, if enabled, when detected by hardware. These events must be processed appropriately for the device to operate properly on the USB so it is recommended that interrupts be used to handle these events. A USB RESET indicates that the host is resetting the device. Firmware, after detecting a RESET, should set the device back to the default state. A USB RESET, when detected by the hardware, does not reset the device as does a hardware reset (a reset via the reset pin). It sets a few USB registers back to their default power on state (or hardware reset) but does not affect all pertinent registers. In the data sheet, with each register definition, it is indicated what the reset value is after a hardware and also a USB reset. Since a USB RESET does not set the USB address register back to zero, it is critical that firmware writes a zero to the UADDR register. There are a few other registers that must be written with a particular value to get back to the default state. A USB RESET function may look like the following: 5/18

6 upsd3400 USB firmware AN2401 void OnUsbReset() /****************************************************************************** Function : void OnUsbReset() Parameters : none Description: USB driver module initialization routine. ******************************************************************************/ UCTL &= ~USBEN; //USB disable/enable resets the UCTL = USBEN; // USB state machine USTA = 0; UADDR = 0; UIF1 = 0; UIF2 = 0; UIF3 = 0; UIF0 = 0; brstf = 0; bsuspendf = 0; UIE0 = RSTIE SUSPENDIE; UIE1 = IN0IE; UIE2 = OUT0IE; UIE3 = 0; UIE1 = IN1IE; UIE2 = OUT2IE; //Reset device address //Enable RESET and SUSPEND interrupts //Enable EP0 IN interrupts //Enable EP0 OUT interrupts //Disable all NAK interrupts //Enable EP1 IN interrupts //Enable EP2 OUT interrupts //Enable endpoint FIFOs and clear busy bits USEL = OUTDIR SELEP0; //Select EP0 OUT UCON = ENABLE_FIFO EPFIFO_BSY; USEL = INDIR SELEP0; UCON = ENABLE_FIFO; //Select EP0 IN USEL = OUTDIR SELEP2; //Select EP2 OUT UCON = ENABLE_FIFO EPFIFO_BSY; USEL = INDIR SELEP1; //Select EP1 IN UCON = ENABLE_FIFO; confignum = 0; usbstate = US_DEFAULT; Important Note for revision A of the silicon: If CPUPS in CCON0 is anything other than 000b, then a reset is not detected. This is corrected in Rev B SUSPEND and RESUME Suspend and resume detection by the hardware is always enabled. Interrupts are generated, if enabled, when these events are detected. When a suspend event is detected, the SUSPENDF bit in the UIF0 register is set. If the SUSPENDIE bit in the UIE0 register is set, an interrupt is generated. The hardware shuts down the clock to the SIE when a suspend event is detected to conserve power. When a resume event is detected, the RESUMF bit is set and an interrupt is generated if that interrupt is enabled. The RESUMIE bit in the UIE0 register enables the interrupt. Upon detection of a resume event, firmware must clear the SUSPENDF bit to enable the clock to the SIE for processing of USB transactions. 6/18

7 upsd3400 USB firmware Below is a piece of some code taken from the example USB ISR code in Figure 4 that shows the handling of the suspend and resume interrupt: if (bsuspendf) if (bresumef) // If Resume interrupt occurred UIE0 = SUSPENDIE; // Enable the suspend interrupt UIE0 &= ~RESUMEIE; // Disable the resume interrupt OnUsbResume(); // Process the resume interrupt bresumef = 0; // Clear the resume interrupt flag bsuspendf = 0; // Clear the suspend interrupt flag else // A suspend interrupt is detected UIE0 = RESUMEIE; // Enable the resume interrupt UIE0 &= ~SUSPENDIE; // Disable the suspend interrupt OnUsbSuspend(); // Process the suspend interrupt A typical system may require additional tasks to be performed when the host signals a suspend or resume on USB such as managing power of the device or external devices. In a simple system, only the USB state flag is changed as shown in the example code below: void OnUsbSuspend() /****************************************************************************** Function : void OnUsbSuspend() Parameters : none Description: service routine for USB Suspend event ******************************************************************************/ usbstate = US_SUSPENDED; void OnUsbResume() /****************************************************************************** Function : void OnUsbResume() Parameters : none Description: service routine for USB Host resume event ******************************************************************************/ usbstate = US_DEFAULT; 1.7 Control transfers Control transfers are used to configure and send commands to a device. Control transfers consist of two or three stages. They always consist of Setup and Status and optionally contain a data stage in between. During the Setup stage, a SETUP packet is used to transmit information to the control endpoint of a function. SETUP transactions are similar in format to an OUT but use a SETUP rather than an OUT PID. Figure 2 shows the SETUP packet format. A SETUP always uses a DATA0 PID for the data field of the SETUP transaction. Per the USB specification, the function receiving a SETUP packet must always accept the SETUP data and respond with ACK. If the data is corrupted, the data is discarded and no response is sent to the host rather than a NAK. This is all handled by the USB SIE hardware -- no interrupts or status bits are set so no firmware processing is required. Note that when a host does not receive an ACK from a device in 7/18

8 upsd3400 USB firmware AN2401 response to a SETUP packet, it assumes that the device did not receive the packet properly and resends it. Figure 2. Control SETUP transaction Idle Token SETUP Data DATA0 Handshake ACK Error Idle Host Function Assuming the device receives a Setup packet with no transmission errors, it responds with an ACK. After the ACK is sent, the USB SIE immediately generates an OUT0/Setup interrupt. A Setup packet is similar to an OUT0 packet in that the OUT0F flag is set and an OUT interrupt is generated. By checking the SETUP flag in the USTA register, firmware can determine if a Setup packet was received or if it was only an OUT0 packet (OUT0 packet data goes to the OUT0 FIFO). When a Setup packet is received, the 8 bytes of data sent are put into the USB Setup Command register (USCV). In the USB ISR, the firmware checks the UIF0 (USB Global Interrupt Flag) register and sees that the OUT FIFO (OUTF) bit is set. Firmware then checks the SETUP bit in the USTA (USB Endpoint 0 Status) register and when set, knows that a SETUP packet was received. Firmware uses the USB Setup Command Index register (USCI) to read out the 8 command bytes from the USB Setup Command value register (USCV). An example of the code to read out the 8 command bytes is shown below: void ReadSetupPacket(void) /****************************************************************************** Function : ReadSetupPacket() Parameters : none Description: Reads a setup packet from USB Setup Command Register. ******************************************************************************/ data unsigned char i; unsigned char* p = (unsigned char*) &setuppacket; USTA &= ~SETUP; // Clear setup bit in USTA for (i=0; i<8; i++) 8/18

9 upsd3400 USB firmware USCI = i; *p++ = USCV; After the SETUP packet data has been read from the USCI register, the request from the host must be decoded and processed accordingly. If present, the Data stage of a control transfer consists of one or more IN or OUT transactions and follows the same protocol rules as bulk transfers. All the transactions in the Data stage must be in the same direction (i.e., all INs or all OUTs). The amount of data to be sent during the data stage and its direction are specified during the Setup stage. If the amount of data exceeds the pre-negotiated data packet size, the data is sent in multiple transactions (INs or OUTs) that carry the maximum packet size. Any remaining data is sent as a residual in the last transaction. The Status stage of a control transfer is the last transaction in the sequence. The status stage transactions follow the same protocol sequence as bulk transactions. A Status stage is delineated by a change in direction of data flow from the previous stage and always uses a DATA1 PID. If, for example, the Data stage consists of OUTs, the status is a single IN transaction. If the control sequence has no Data stage, then it consists of a Setup stage followed by a Status stage consisting of an IN transaction. Figure 3. Control Read and Write sequences Setup Stage Data Stage Status Stage Control Write SETUP (0) DATA0 OUT (1) DATA1 OUT (0)... OUT (0/1) DATA0 DATA0/1 IN (1) DATA1 Control Read SETUP (0) DATA0 IN (1) DATA1 IN (0)... IN (0/1) OUT (1) DATA0 DATA0/1 DATA1 Setup Stage Status Stage No-data Control SETUP (0) DATA0 IN (1) DATA1 Figure 3 shows the transaction order, the data sequence bit value, and the data PID types for control read and write sequences. The sequence bits are displayed in parentheses. 1.8 USB address When a device is first connected to the bus, the USB address register (UADDR) is set to 0x00. The host always starts general enumeration of a newly discovered device on the bus using address 0x00. The device only responds to bus traffic with the address in the UADDR register. After the host gathers some basic information from the device on the default address of 0x00, it sends a SET_ADDRESS request to the device providing a 7-bit address. The device, upon decoding a SET_ADDRESS request, writes the 7-bit address into UADDR. After UADDR is written, the device will only respond to the host with that address and no longer the default address, 0x00. Since the UADDR register takes immediate effect as soon as it is written, it is important to write the assigned address to UADDR after the status stage of the SET_ADDRESS request. 9/18

10 upsd3400 USB firmware AN2401 A set address command follows the No-data Control sequence as shown in Figure 3. The SET_ADDRESS command consists of the host sending a SETUP packet to address 0 and endpoint 0. The data sent with the SETUP packet is the SET_ADDRESS command plus the address assigned to the device. When the firmware receives a SET_ADDRESS command, it temporarily stores the address in RAM and changes a state flag to indicate the USB state is a set address request. It also enables the IN0 FIFO with a zero bytes. The host then sends an IN PID and the device responds with a zero length data packet. After the SIE sends the ACK, an IN interrupt is generated. The USB ISR sees that the interrupt was an IN0 and the state flag is set for an address request. At this point, the firmware writes the address received from the host into the UADDR register and changes the USB state back to the default. Now, the device has a new address and responds only to packets with this address. When the host sends a subsequent packet, it is no longer on address 0 but on the newly assigned address and the device responds only to packets with this new address. When a SET_ADDRESS command is received from the host, the function that processes that command changes the USB state to a value that indicates it is a set address command but does not write the address value to UADDR since the address of the device must be 0x00 when it receives the Status Stage from the host. In this case, the Status Stage consists of a zero length data packet. It is only after the Status Stage is received that the UADDR register should be written with the assigned address. An example of the function that processes the Set Address is simply as follows: void OnSetAddress() /****************************************************************************** Function : void OnSetAddress() Parameters : none Description: Handler for SET_ADDRESS packets ******************************************************************************/ usbstate = US_ADDRESSED; TransmitZeroLengthEP0(); Below is a piece of some code taken from the example USB ISR code in Figure 4 that shows the setting of the USB address register (UADDR) after the Status. Basically, if an IN interrupt occurred and it was on endpoint 0 and the usbstate was US_ADDRESSED (which indicates the processing of the SET_ADDRESS request from the host), the UADDR register is written with the new address. The address is the value received from the host with the last setup packet and is stored in setuppacket.wvalue.lo. /* IN packets servicing */ if (binf) if (UIF1 & IN0F) // EP0 IN UIF1 &= ~IN0F; TransmitEP0(); if (usbstate == US_ADDRESSED) UADDR = setuppacket.wvalue.lo; // new device address usbstate = US_DEFAULT; After the new address is written to UADDR, the device responds only to packets with that address. 10/18

11 upsd3400 USB firmware 1.9 Endpoint receive mode When the device receives an OUT packet from the host, the USB SIE puts the received data into the target endpoint's FIFO. After all bytes have been received, the SIE performs a CRC check of the data against the CRC it received from the host. If the CRC check is good, then the SIE responds with an ACK, sets the OUTxF (x = the endpoint number) interrupt flag, and generates an interrupt. The ISR, upon determining that an OUT interrupt condition occurred (by reading the UIF0 register), then reads the UIF2 register to determine the endpoint that received the packet of data. The data is then read out of the endpoint's FIFO and the FIFO is rearmed making it ready to receive another packet of data. To read the data out of the endpoint's FIFO, the appropriate endpoint FIFO is selected with the USEL register. The USEL register is written with bit 7 (DIR) set to a "1" for the OUT direction and bits 2:0 with the endpoint number. After selecting the appropriate FIFO, the USIZE register is read to determine how many bytes were received into the FIFO. For the OUT direction, the USIZE register always indicates the number of bytes that were received into the FIFO. The data is then read out of the XDATA space where the USB FIFO was located as specified by the UBASEH and UBASEL. After the data is read out, the FIFO is rearmed by writing any value to the USIZE register. Until USIZE is written after a packet has been received, the SIE will NAK all subsequent OUT packets to that endpoint since the FIFO is full and hasn't been rearmed Endpoint transmit mode When the host wants to receive data from a device, it sends an IN packet. If the endpoint's FIFO has data, the device sends the contents; otherwise, no data is sent and the request is NAKed. When the device has data to send to the host, it loads the FIFO and then writes into the USIZE register the number of bytes to send to the host with an IN request. Writing to the USIZE register arms the FIFO for transmission and also tells the SIE how many bytes to send to the host. In addition, the endpoint's BSY (Busy) bit is set indicating that the FIFO is full and awaiting for transmission to the host. Even though the FIFO is 64 bytes in length, only the number of bytes specified by USIZE are sent. When the device detects an IN packet from the host, it sends the data that is in the FIFO. If the device does not receive an ACK from the host, the SIE assumes there is an error and leaves the FIFO armed. When the host sends the next IN packet, the device retransmits the data. Once the device detects an ACK from the host, it changes the status of the FIFO to not busy, indicating that it is empty and another packet of data can be loaded. To load the particular endpoint's FIFO with data to send to the host with an IN request, the USEL register is written with the DIR bit cleared (indicating an IN FIFO) and the EP bits set to the endpoint number. The data is then written to the FIFO and USIZE is written with the number of bytes to transmit. Writing to the USIZE register changes the state of the BSY bit in the UCON register from a 0 to a 1 indicating that the FIFO if full (or armed). When the next IN packet for that endpoint is received, the SIE transmits the FIFOs contents. After the FIFO's contents are successfully transmitted and the ACK is received from the host, the BSY bit is cleared. The BSY bit should be used to tell when the FIFO is full or empty, and when empty, can load the FIFO with new data to send. 11/18

12 upsd3400 USB firmware AN USB endpoint control register (UCON) ENABLE STALL Each endpoint has a couple of other bits in the control register (UCON) that are important to mention and were not previously described. Those bits are the ENABLE, STALL, and TOGGLE. The operation of the BSY bit in the UCON register was described in the endpoint transmit and receive sections. The ENABLE bit determines whether the SIE responds to requests on this endpoint. If the endpoint is not enabled, then the SIE ignores all packets from the host for this endpoint and provides no response on the bus. Also, no interrupt flags are set nor any interrupts generated. The FIFO must be enabled in order for the SIE to properly respond to host requests on this endpoint. Important Note: When a FIFO is enabled (after being in a disabled state), the TOGGLE (data toggle bit) is set to a TOGGLE Another important bit is the STALL bit. There are certain cases when this bit should be used. When the bit is set, the SIE responds to all packets from the host on this endpoint with a STALL packet. This bit, when set, remains set until firmware clears it. For IN endpoints, the TOGGLE bit indicates what the data toggle is to be set to (DATA0 or DATA1) for the DATA packet response to the next IN packet from the host. This is a read only bit indicating what the SIE will send. The SIE automatically toggles this bit when an ACK is received from the host in response to a successfully transmitted packet. If the SIE transmits the data and does not receive an ACK, the data toggle bit does not toggle. The packet is retransmitted with the next IN packet. In cases where the data toggle must be reset, disabling and re-enabling the endpoint FIFO (using the ENABLE bit) resets the data toggle. For OUT endpoints, the TOGGLE bit indicates what the data toggle should be with the next OUT packet that is received. If the data toggle is as expected, then the transmission is considered good and the appropriate OUT interrupt flags are set and an interrupt is generated. If the data toggle is not as expected, the SIE assumes the host is retransmitting the last packet it sent. The host retransmits a packet if it doesn t properly receive an ACK from the device with the last OUT packet that was sent on the particular endpoint. If the device had sent the ACK but some noise corrupted the packet, the host believes that the device did not receive the packet; therefore, it retransmits it with the same data toggle. The device, seeing the same data toggle as was received with the previous packet, assumes the host is retransmitting the packet. Since the device successfully received the last packet, it discards the retransmitted packet and doesn't set any interrupt flags or generate any interrupts. It does, however, respond with an ACK to the retransmitted packet. The host, upon receiving the ACK this time, toggles its data toggle and now the host and the device are back in sync. As is the case with IN endpoints, if there is a need for the data toggle to be reset, the endpoint FIFO should be disabled and re-enabled. Important Note: For revision A silicon, disabling and enabling an endpoint's FIFO does not reset the data toggle. For cases where the data toggle is a "1" and its bit must be reset ("0"), sending the next data packet on the endpoint twice effectively gets the data toggle to the correct state. 12/18

13 upsd3400 USB firmware One such case where an endpoint's data toggle must be reset is after a Clear Feature/Stall request. How this is handled is dependent on the how the application code is structured. One such way is that when firmware determines that such a request was received, a transmit_again flag is set only if the current state of the toggle bit is a "1". If the toggle bit is a "0", it is in the correct state and nothing needs to be done. In the interrupt service routine for that endpoint, if the transmit_again flag is set, then the USIZE register should be written again with the packet size to rearm the FIFO. Since the FIFO contents remains unchanged after the data is sent to the host, the FIFO only needs to be armed again. (If different lengths of packets are sent on the endpoint, the packet size should be saved and written to the USIZE register in the ISR. If the same size packets are always sent on the endpoint, then this value may be hard-coded in the ISR.) The packet is sent with the next IN from the host, this time with the data toggle set to a "0". The code below is an example portion of the ISR for endpoint 1 processing. In this case, the packet size on the endpoint is always 0x40 bytes. If the packet size is variable, it is important to save the packet size in a temporary location so that USIZE is written with the correct length in the ISR for retransmission. if (UIF1 & IN1F) // EP1 IN UIF1 &= ~IN1F; USEL = INDIR SELEP1; UCON &= ~EPFIFO_BSY; if (transmit_again) //Rev A silicon only - check to see if packet should // be resent. This is to effectively clear the data // toggle. USIZE = 0x40; //Arm the FIFO to resend the packet. By resending the // packet, it gets the data toggle back to the correct // state. transmit_again = 0; //Reset the transmit again flag. // Processing of user data on EP USB interrupt service routine (ISR) framework All USB event-related interrupts vector to a single ISR. The order that the USB interrupt flags are checked and processed in the ISR determines the priority. The USB reset is a high priority event and should be processed first, especially since any pending USB interrupts are no longer valid when a USB reset is detected Treatment of USEL in the USB ISR - single FIFO usage If firmware uses the USEL register outside of the USB ISR, then USEL must be saved in a temporary variable when coming into the USB ISR and then restored before leaving the ISR. This is important as USEL may be changed while in the ISR resulting in the main line code accessing the wrong endpoint's register Treatment of USEL in the USB ISR - double FIFO usage If double FIFO (pairing) is used, the restore of USEL becomes a bit more complicated. With FIFO pairing, when USEL is read back and FIFO pairing is used on endpoint 1, USEL may 13/18

14 upsd3400 USB firmware AN2401 be a 1 or a 2 for the IN direction or 0x81 or 0x82 for the OUT direction. If it is a 1 or a 2, then USEL should be restored with a 1. If it is an 0x81 or 0x82, then it should be restored with an 0x81. When FIFO pairing is used on endpoint 3, if USEL is a 3 or a 4, then it should be restored with a 3. If USEL is an 0x83 or 0x84, then it should be restored with a 0x83. The framework for an example USB ISR is shown below. Note that temp_usel_saved is used to save and restore the USEL register. This example is for single FIFO operation. Figure 4. Example Framework for a USB ISR void UsbIsr(void) interrupt USB_VECTOR using 2 /****************************************************************************** Function : void UsbIsr() Parameters : none Description: USB interrupt service routine. ******************************************************************************/ unsigned char temp_usel_saved; // used to save and then restore USEL temp_usel_saved = USEL; // save USEL if (brstf) OnUsbReset(); // USB Reset int UCTL = VISIBLE; // enable USB FIFO mapping in XDATA /* OUT packets servicing */ if (boutf) if (UIF2 & OUT0F) // EP0 OUT if (USTA & SETUP) ReadSetupPacket() USTA &= ~SETUP; // Clear setup bit in USTA UIF2 &= ~OUT0F; OnSetupPacket(); else // Processing of user data on EP0 UIF2 &= ~OUT0F; if (UIF2 & OUT1F) // EP1 OUT UIF2 &= ~OUT1F; USEL = OUTDIR SELEP1; UCON &= ~EPFIFO_BSY; // Processing of user data on EP1 if (UIF2 & OUT2F) // EP2 OUT UIF2 &= ~OUT2F; USEL = OUTDIR SELEP2; UCON &= ~EPFIFO_BSY; // Processing of user data on EP2 if (UIF2 & OUT3F) // EP3 OUT UIF2 &= ~OUT3F; USEL = OUTDIR SELEP3; UCON &= ~EPFIFO_BSY; 14/18

15 upsd3400 USB firmware // Processing of user data on EP3 if (UIF2 & OUT4F) // EP4 OUT UIF2 &= ~OUT4F; USEL = OUTDIR SELEP4; UCON &= ~EPFIFO_BSY; // Processing of user data on EP4 /* IN packets servicing */ if (binf) if (UIF1 & IN0F) // EP0 IN UIF1 &= ~IN0F; TransmitEP0(); if (usbstate == US_ADDRESSED) UADDR = setuppacket.wvalue.lo; // new device address usbstate = US_DEFAULT; if (UIF1 & IN1F) // EP1 IN UIF1 &= ~IN1F; USEL = INDIR SELEP1; UCON &= ~EPFIFO_BSY; // Processing of user data on EP1 if (UIF1 & IN2F) // EP2 IN UIF1 &= ~IN2F; USEL = INDIR SELEP2; UCON &= ~EPFIFO_BSY; // Processing of user data on EP2 if (UIF1 & IN3F) // EP3 IN UIF1 &= ~IN3F; USEL = INDIR SELEP3; UCON &= ~EPFIFO_BSY; // Processing of user data on EP3 if (UIF1 & IN4F) // EP4 IN UIF1 &= ~IN4F; USEL = INDIR SELEP4; UCON &= ~EPFIFO_BSY; // Processing of user data on EP4 if (bsuspendf) if (bresumef) // If Resume interrupt occurred UIE0 = SUSPENDIE; // Enable the suspend interrupt UIE0 &= ~RESUMEIE; // Disable the resume interrupt OnUsbResume(); // Process the resume interrupt bresumef = 0; // Clear the resume interrupt flag bsuspendf = 0; // Clear the suspend interrupt flag 15/18

16 upsd3400 USB firmware AN2401 else // A suspend interrupt is detected UIE0 = RESUMEIE; // Enable the resume interrupt UIE0 &= ~SUSPENDIE; // Disable the suspend interrupt OnUsbSuspend(); // Process the suspend interrupt USEL = temp_usel_saved; // restore USEL Important Note: In single FIFO or double FIFO mode, an endpoint's busy bit should be cleared in the ISR when an interrupt was generated for that endpoint as a precaution against rare occurrences when the hardware does not properly clear the bit. The USB ISR framework shown in Figure 4 includes code that clears the busy bit for an endpoint when an interrupt event occurred on it. 16/18

17 Revision history 2 Revision history Table 1. Document revision history Date Revision Changes 20-Jul Initial release. 17/18

18 Please Read Carefully: Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries ( ST ) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. All ST products are sold pursuant to ST s terms and conditions of sale. Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein. UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY, DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER S OWN RISK. Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST. ST and the ST logo are trademarks or registered trademarks of ST in various countries. Information in this document supersedes and replaces all information previously supplied. The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners STMicroelectronics - All rights reserved STMicroelectronics group of companies Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan - Malaysia - Malta - Morocco - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America 18/18

AN2667 Application note

AN2667 Application note Application note STM8A GPIO application examples Introduction This document is intended to provide two practical application examples of the GPIO peripheral use in the STM8A device. The examples are: Toggling

More information

AN4113 Application note

AN4113 Application note Application note Managing the Driver Enable signal for RS-485 and IO-Link communications with the STM32F05x USART Introduction RS-485 and IO-Link are half-duplex communication protocols that offer easy

More information

AN2672 Application note

AN2672 Application note Application note I²C application examples Introduction The I 2 C peripheral is very flexible, supporting standard interrupts in both 10-bit and 7-bit addressing modes. As a result, generated events are

More information

AN2676 Application note

AN2676 Application note Application note STM8A reset application examples Introduction This document is one of a set of application notes giving examples of how to use the various blocks of the STM8A microcontroller family and

More information

STEVAL-SPBT4ATV3. USB dongle for the Bluetooth class 1 SPBT2632C1A.AT2 module. Features. Description

STEVAL-SPBT4ATV3. USB dongle for the Bluetooth class 1 SPBT2632C1A.AT2 module. Features. Description USB dongle for the Bluetooth class 1 SPBT2632C1A.AT2 module Features Based on V3.0 Bluetooth class 1 module, SPBT2632C1A.AT2 USB interface and power supply Supported reprogrammability via USB interface

More information

STEVAL-PCC010V1. ST802RT1A Ethernet PHY demonstration board with STM32F107 controller add-on board. Features. Description

STEVAL-PCC010V1. ST802RT1A Ethernet PHY demonstration board with STM32F107 controller add-on board. Features. Description ST802RT1A Ethernet PHY demonstration board with STM32F107 controller add-on board Data brief Features ST802RT1A Ethernet PHY demonstration board: ST802RT1A fast Ethernet physical layer transceiver On-board

More information

STEVAL-CCM002V1. TFT-LCD panel demonstration board based on the STM32 as LCD controller. Features. Description

STEVAL-CCM002V1. TFT-LCD panel demonstration board based on the STM32 as LCD controller. Features. Description TFT-LCD panel demonstration board based on the STM32 as LCD controller Data brief Features Displays images on a TFT-LCD using the STM32 as LCD controller Includes a slideshow of images to demonstrate static

More information

AN3996 Application Note

AN3996 Application Note Application Note Adjustable LED blinking speed using STM8SVLDISCOVERY Application overview This application note provides a short description of the demonstration firmware Discover which is preprogrammed

More information

AN3154 Application note

AN3154 Application note Application note CAN protocol used in the STM32 bootloader Introduction This application note describes the CAN protocol used in the STM32 microcontroller bootloader. It details each supported command.

More information

UM0792 User manual. Demonstration firmware for the DMX-512 communication protocol transmitter based on the STM32F103Zx.

UM0792 User manual. Demonstration firmware for the DMX-512 communication protocol transmitter based on the STM32F103Zx. User manual Demonstration firmware for the DMX-512 communication protocol transmitter based on the STM32F103Zx Introduction This document describes how to use the demonstration firmware for the DMX-512

More information

AN3279 Application Note

AN3279 Application Note Application Note Adjustable LED blinking speed using STM8S-DISCOVERY touch sensing key Application overview This application note provides a short description of how to use the touch sensing key to change

More information

STM32-MP3NL/DEC. STM32 audio engine MP3 decoder library. Description. Features

STM32-MP3NL/DEC. STM32 audio engine MP3 decoder library. Description. Features STM32 audio engine MP3 decoder library Data brief Features MPEG-1, 2 or 2.5 formats Layers 1, 2 and 3 Constant bit rate and variable bit rate Mono or stereo input streams PCM (Pulse Code Modulation) output

More information

OSPlus USB Extension. OSPlus USB 2.0 extension. Description. Features. Application. TCP/IP stack NexGenOS NexGenIP VFS. FAT Ext2 LVM Device layer

OSPlus USB Extension. OSPlus USB 2.0 extension. Description. Features. Application. TCP/IP stack NexGenOS NexGenIP VFS. FAT Ext2 LVM Device layer OSPlus USB 2.0 extension Data brief Application VFS FAT Ext2 LVM Device layer Device drivers TCP/IP stack NexGenOS NexGenIP NexGenRemote NexGenResolve NexGenBoot NexGenPPP USB stack OSPlus interface Class

More information

AN2825 Application Note

AN2825 Application Note Application Note S-Touch STMPE811 resistive touchscreen controller advanced features Introduction This application note provides details on the advanced features of the S-Touch STMPE811 touchscreen controllers.

More information

AN626 Application note

AN626 Application note Application note Serial EEPROM product numbering This application note provides a detailed description of the part numbering scheme of Serial EEPROM products. The part numbering scheme consists of a maximum

More information

AN2143 Application note

AN2143 Application note AN2143 Application note Programming the ST10F27X embedded Flash using the ST10FLASHER tool Introduction This document summarizes the different steps needed to program the internal Flash memory of the ST10F27x

More information

AN3980 Application note

AN3980 Application note Application note STM32 firmware library for dspin L6470 1 Introduction This application note describes the implementation of the STM32 firmware library for the dspin stepper motor control product (L6470).

More information

ST19WR08 Dual Contactless Smartcard MCU With RF UART, IART & 8 Kbytes EEPROM Features Contactless specific features

ST19WR08 Dual Contactless Smartcard MCU With RF UART, IART & 8 Kbytes EEPROM Features Contactless specific features Dual Contactless Smartcard MCU With RF UART, IART & 8 Kbytes EEPROM Data Brief Features Enhanced 8-bit CPU with extended addressing modes 112 KBytes user ROM with partitioning 2 KBytes user RAM with partitioning

More information

STM8 I 2 C optimized examples

STM8 I 2 C optimized examples Application note STM8 I 2 C optimized examples Introduction This document describes how to use the following I 2 C optimized examples Hardware configuration example of a common I 2 C bus Master firmware

More information

UM0401 User manual. User manual for eight bit port expander STMPE801 demonstration board. Introduction

UM0401 User manual. User manual for eight bit port expander STMPE801 demonstration board. Introduction User manual User manual for eight bit port expander STMPE801 demonstration board Introduction This document explains the functioning of the demo board for the port expander Chip STMPE801 with a PC GUI

More information

UM1084 User manual. CR95HF development software user guide. Introduction. Reference documents

UM1084 User manual. CR95HF development software user guide. Introduction. Reference documents User manual CR95HF development software user guide Introduction The CR95HF development software is a PC software which allows to configure, evaluate, and communicate with ST CR95HF 13.56 MHz multiprotocol

More information

AN3354 Application note

AN3354 Application note Application note STM32F105/107 in-application programming using a USB host 1 Introduction An important requirement for most Flash-memory-based systems is the ability to update firmware installed in the

More information

AN3965 Application note

AN3965 Application note Application note STM32F40x/STM32F41x in-application programming using the USART 1 Introduction An important requirement for most Flash-memory-based systems is the ability to update firmware when installed

More information

AN2470 Application note TS4871 low voltage audio power amplifier Evaluation board user guidelines Features Description

AN2470 Application note TS4871 low voltage audio power amplifier Evaluation board user guidelines Features Description Application note TS4871 low voltage audio power amplifier Evaluation board user guidelines Features TS4871 low voltage audio power amplifier with active low standby mode Operating range from V CC =2.2V

More information

UM1572 User manual. STEVAL-IPE020V1: ST energy meter application based on the Android platform. Introduction

UM1572 User manual. STEVAL-IPE020V1: ST energy meter application based on the Android platform. Introduction User manual STEVAL-IPE020V1: ST energy meter application based on the Android platform Introduction The ST energy meter application is a user friendly Android based solution based on NFC technology that

More information

AN2855 Application note

AN2855 Application note Application note Configuration for single-click and double-click detection using the FC30 Introduction This document is intended to provide application information for the click and double-click detection

More information

AN2737 Application note Basic in-application programming example using the STM8 I 2 C and SPI peripherals Introduction

AN2737 Application note Basic in-application programming example using the STM8 I 2 C and SPI peripherals Introduction Application note Basic in-application programming example using the STM8 I 2 C and SPI peripherals Introduction This application note is one of a set of application notes giving examples of how to use

More information

STM3210B-SK/KEIL STR91X-SK/KEI, STR7-SK/KEIL

STM3210B-SK/KEIL STR91X-SK/KEI, STR7-SK/KEIL STM3210B STR91X-SK/KEI, STR7 Keil starter kits for ST ARM core-based microcontrollers Data brief Features The ARM RealView Microcontroller Development Kit complete development software package with: µvision3

More information

AN2781 Application note

AN2781 Application note Application note UART emulation software in STM8S and STM8A microcontrollers Introduction This application note describes how to emulate the UART behavior and functionality using routines in STM8S microcontrollers.

More information

AN2594 Application note

AN2594 Application note AN2594 Application note EEPROM emulation in STM32F101xx and STM32F103xx microcontrollers Introduction Many applications require EEPROM (electrically erasable programmable read-only memory) for non-volatile

More information

STTS V memory module temperature sensor. Features

STTS V memory module temperature sensor. Features 2.3 V memory module temperature sensor Data brief Features is a 2.3 V memory module temperature sensor forward compatible with JEDEC standard TS3000 and backward compatible with STTS424 Operating temperature

More information

AN2361 Application note

AN2361 Application note AN2361 Application note Interfacing with the STR91x software library using Configuration and Programming Software (CAPS) Introduction STR91x microcontrollers offer extremely flexible configuration of I/O

More information

AN2261 APPLICATION NOTE

AN2261 APPLICATION NOTE APPLICATION NOTE GPIO ports configuration in ST30 devices INTRODUCTION The General Purpose IO (GPIO) Ports of ST30 devices are programmable by software in several modes:, Output, Alternate Function,, Output

More information

EV-VNQ5E050AK VNQ5E050AK evaluation board

EV-VNQ5E050AK VNQ5E050AK evaluation board VNQ5E050AK evaluation board Data brief production data Features Parameter Symbol Value Unit Max supply voltage V CC 41 V Operating voltage range V CC 4.5 to 28 V Max On-State resistance R ON 50 mω Current

More information

STA bit single chip baseband controller for GPS and telematic applications. Features

STA bit single chip baseband controller for GPS and telematic applications. Features 32-bit single chip baseband controller for GPS and telematic applications Data Brief Features Suitable for automotive applications ARM7TDMI 16/32 bit RISC CPU based host microcontroller. Complete embedded

More information

AN2202 Application note

AN2202 Application note Application note STR73x microcontroller power management Introduction This application note provides an overview of the STR73x power management features and gives some guidelines for using the low power

More information

ST33F1M. Smartcard MCU with 32-bit ARM SecurCore SC300 CPU and 1.25 Mbytes high-density Flash memory. Features. Hardware features.

ST33F1M. Smartcard MCU with 32-bit ARM SecurCore SC300 CPU and 1.25 Mbytes high-density Flash memory. Features. Hardware features. Smartcard MCU with 32-bit ARM SecurCore SC300 CPU and 1.25 Mbytes high-density Flash memory Data brief Features ST33F1M major applications include: Mobile communications (GSM, 3G and CDMA) Java Card applications

More information

UM0693 User manual. 1 Introduction. STM8L101-EVAL demonstration firmware

UM0693 User manual. 1 Introduction. STM8L101-EVAL demonstration firmware User manual STM8L101-EVAL demonstration firmware 1 Introduction Note: This document describes the demonstration firmware running on the STM8L101-EVAL evaluation board. You can use it to evaluate the capabilities

More information

STM32-SK/KEIL STR91X-SK/KEI, STR7-SK/KEIL

STM32-SK/KEIL STR91X-SK/KEI, STR7-SK/KEIL STM32 STR91X-SK/KEI, STR7 Keil starter kits for ST ARM core-based microcontrollers Data brief Features The ARM RealView Microcontroller Development Kit complete development software package with: µvision3

More information

UM1488 User manual. STPMC1 evaluation software. Introduction

UM1488 User manual. STPMC1 evaluation software. Introduction User manual STPMC1 evaluation software Introduction STPMC1 evaluation software is a graphical user interface to read, configure and calibrate an STPMC1 energy metering device, suitable for parallel and

More information

AN2557 Application note

AN2557 Application note Application note STM32F10x in-application programming using the USART Introduction An important requirement for most Flash-memory-based systems is the ability to update firmware when installed in the end

More information

STM3220G-SK/KEI. Keil starter kit for STM32F2 series microcontrollers (STM32F207IG MCU) Features. Description

STM3220G-SK/KEI. Keil starter kit for STM32F2 series microcontrollers (STM32F207IG MCU) Features. Description Keil starter kit for STM32F2 series microcontrollers (STM32F207IG MCU) Data brief Features The Keil MDK-Lite development tools: µvision 4 IDE/Debugger for application programming and debugging ARM C/C++

More information

AN3250 Application note

AN3250 Application note Application note M24LR64-R Multi-bank reference design description and settings 1 Introduction The M24LR64-R multi-bank reference design has been created to help users increase the memory density of their

More information

Description SPC564A-DISP. March 2014 DocID Rev 3 1/5

Description SPC564A-DISP. March 2014 DocID Rev 3 1/5 SPC564A-DISP: Discovery+ evaluation board Description Data brief - production data Features SPC564A70L7 32-bit 150 MHz e200z4 Power Architecture core, 2Mbyte on-chip in an LQFP176 package. Board Supply:

More information

AN2673 Application note

AN2673 Application note Application note STM8A SPI application examples Introduction This application note is one of a set of application notes giving examples of how to use the various blocks of the STM8A microcontroller family

More information

TN0132 Technical note

TN0132 Technical note Technical note STM32 Serial Wire Viewer and ETM capabilities with EWARM 5.40 and MDK-ARM 3.70 Introduction This document presents Serial Wire Viewer (SWV) and Embedded Trace Macrocell (ETM) capabilities

More information

AN2592 Application note

AN2592 Application note AN2592 Application note How to achieve 32-bit timer resolution using the link system in STM32F101xx and STM32F103xx microcontrollers Introduction In many applications, 32-bit resolution is required to

More information

AN2430 Application note

AN2430 Application note Application note STR75x SystemMemory boot mode Introduction te: This application note describes the features of the SystemMemory boot mode developed for STR75x Flash microcontrollers providing all the

More information

STLC2500D. Bluetooth V2.1 "Lisbon" + EDR. Features. Description

STLC2500D. Bluetooth V2.1 Lisbon + EDR. Features. Description Bluetooth V2.1 "Lisbon" + EDR Data Brief Features Based on Ericsson Technology Licensing Baseband Core (EBC) Bluetooth specification compliance: V2.1 ( Lisbon ) + EDR HW support for packet types ACL, SCO,

More information

STM32-SK/RAIS,STR91X-SK/RAI,STR7-SK/RAIS STM32-D/RAIS,STR9-D/RAIS,STR7-D/RAIS

STM32-SK/RAIS,STR91X-SK/RAI,STR7-SK/RAIS STM32-D/RAIS,STR9-D/RAIS,STR7-D/RAIS STM32-SK/RAIS,,STR7-SK/RAIS STM32-D/RAIS,STR9-D/RAIS,STR7-D/RAIS Raisonance REva starter kits for ST ARM core-based microcontrollers Data brief Features Raisonance software toolset with: GNU C compiler

More information

AN3362 Application note

AN3362 Application note Application note Clock configuration tool for STM32F2xx microcontrollers Introduction This application note presents the clock system configuration tool for the STM32F2xx microcontroller family. The purpose

More information

EVAL6235PD. L6235 three-phase brushless DC motor driver demonstration board. Features. Description

EVAL6235PD. L6235 three-phase brushless DC motor driver demonstration board. Features. Description L6235 three-phase brushless DC motor driver demonstration board Features Operating supply voltage from 8 V to 52 V 5.6 A output peak current (2.8 A RMS ) Operating frequency up to 100 khz Non-dissipative

More information

AN2240 Application note

AN2240 Application note AN0 Application note Using the evaluation board for the TS7 low noise microphone preamplifier with V bias Introduction This application note describes the DEMO TS7 evaluation board, specifically designed

More information

ST10F271B/E, ST10F272B/E Errata sheet

ST10F271B/E, ST10F272B/E Errata sheet Errata sheet BAG silicon version Introduction Note: This errata sheet describes all the functional and electrical problems known in the BAG silicon version of ST10F271B, ST10F271E, ST10F272B and ST10F272E

More information

Main components USB charging controller with integrated power switch

Main components USB charging controller with integrated power switch DN0019 Design note Smart dual-port USB charger with STCC2540 Designs from our labs describe tested circuit designs from ST labs which provide optimized solutions for specific applications. For more information

More information

AN3265 Application note

AN3265 Application note Application note Handling hardware and software failures with the STM8S-DISCOVERY Application overview This application is based on the STM8S-DISCOVERY. It demonstrates how to use the STM8S window watchdog

More information

Description of STM8 LIN software package (STSW-STM8A-LIN) release 4.1. Table 1. Release information. STM8 LIN package

Description of STM8 LIN software package (STSW-STM8A-LIN) release 4.1. Table 1. Release information. STM8 LIN package Release note Description of STM8 LIN software package (STSW-STM8A-LIN) release 4.1 Introduction The STM8 LIN package implements the LIN 2.x (2.1 and 2.0) and LIN 1.3 protocols to drive USART/UART1 (named

More information

SOT23-6L ESDALCL6-2SC6

SOT23-6L ESDALCL6-2SC6 Very low capacitance and low leakage current ESD protection Features 2 data-line protection Datasheet production data Protects V BUS Very low capacitance: 2.5 pf typ. Very low leakage current: 10 na at

More information

AN2474 Application note

AN2474 Application note AN474 Application note TS4995.W fully differential audio power amplifier with selectable standby and 6db fixed gain - Evaluation board user guidelines Introduction This application note describes the DEMO

More information

RN0046 Release note. 1 Introduction. SimpleMAC library for STM32W108xx kits. About this release note

RN0046 Release note. 1 Introduction. SimpleMAC library for STM32W108xx kits. About this release note Release note SimpleMAC library for STM32W108xx kits 1 Introduction About this release note This release note is related to the SimpleMAC library which supports all the available STM32W108xx kits. This

More information

AN4321 Application note

AN4321 Application note Application note Getting started with the SPC56L-Discovery Introduction SPC56L-Discovery evaluation kit is based on the 32-bit microcontrollers SPC56EL70L5. The SPC56L-Discovery is an evaluation board

More information

ST19NP18-TPM-I2C Trusted Platform Module (TPM) with I²C Interface Features

ST19NP18-TPM-I2C Trusted Platform Module (TPM) with I²C Interface Features Trusted Platform Module (TPM) with I²C Interface Data brief Features Single-chip Trusted Platform Module (TPM) Embedded TPM 1.2 firmware I²C communication interface (Slave mode) Architecture based on ST19N

More information

AN3988 Application note

AN3988 Application note Application note Clock configuration tool for STM32F40x/41x microcontrollers Introduction This application note presents the clock system configuration tool for the STM32F4xx microcontroller family. The

More information

STICE CF/Stice_Connect AD/Stice_Connect AS/Stice_Connect

STICE CF/Stice_Connect AD/Stice_Connect AS/Stice_Connect STICE CF/Stice_Connect AD/Stice_Connect AS/Stice_Connect Full-featured cost-effective emulation system for ST microcontrollers Data brief Features Emulation system Real-time emulation of STM8 MCUs (CPU

More information

Obsolete Product(s) - Obsolete Product(s)

Obsolete Product(s) - Obsolete Product(s) 8 line low capacitance EMI filter and ESD protection Main product characteristics Where EMI filtering in ESD sensitive equipment is required: LCD and camera for mobile phones Computers and printers Communication

More information

AN2061 APPLICATION NOTE

AN2061 APPLICATION NOTE APPLICATION NOTE EEPROM Emulation with ST10F2xx Description External EEPROMs are often used in automotive applications to store adaptative/evolutive data. On the other hand, the Microcontroller used in

More information

AN2734 Application note S-Touch design procedure Introduction

AN2734 Application note S-Touch design procedure Introduction Application note S-Touch design procedure Introduction The purpose of this application note is to provide the system/hardware engineers enough ground knowledge to start the design of capacitive touch inferface

More information

AN4274 Application note

AN4274 Application note Application note The serial communication driver between the ST7580 and the STM32Fx By Vincenzo Mormina Introduction This document describes the serial communication driver between the ST7580 and the STM32Fx.

More information

Getting started with DfuSe USB device firmware upgrade STMicroelectronics extension

Getting started with DfuSe USB device firmware upgrade STMicroelectronics extension User manual Getting started with DfuSe USB device firmware upgrade STMicroelectronics extension Introduction This document describes the demonstration user interface that was developed to illustrate use

More information

AN3975 Application note

AN3975 Application note Application note Transparent serial link over ST7590 OFDM PRIME modem 1 Introduction Nowadays, a lot of power meter manufacturers or smart grid providers are switching from simple networks like RS845 to

More information

ST21NFCB. Near field communication controller. Features. RF communications. Hardware features. Communication interfaces. Electrical characteristics

ST21NFCB. Near field communication controller. Features. RF communications. Hardware features. Communication interfaces. Electrical characteristics Near field communication controller Data brief Features NFC operating modes supported: Card emulation Reader / Writer Peer-to-peer communication Hardware features FBGA WFBGA 64-pin 36 Kbytes of EEPROM

More information

STEVAL-IHM028V1. 2 kw 3-phase motor control demonstration board featuring the IGBT intelligent power module STGIPS20K60. Features.

STEVAL-IHM028V1. 2 kw 3-phase motor control demonstration board featuring the IGBT intelligent power module STGIPS20K60. Features. Features 2 kw 3-phase motor control demonstration board featuring the IGBT intelligent power module STGIPS20K60 Data brief Complete solution for a 2 kw power inverter HV supply mode: voltage 90 VAC to

More information

Distributed by: www.jameco.com 1-800-831-4242 The content and copyrights of the attached material are the property of its owner. ST7xxxx-SK/RAIS Raisonance s complete, low-cost starter kits for ST7 The

More information

TN0189 Technical note

TN0189 Technical note Technical note STM8 bootloader frequently asked questions 1 Introduction All STM8A, STM8L, and STM8S devices with a Flash memory space greater than 16 Kbytes have a ROM bootloader: STM8AF51xx STM8AF61xx

More information

EMIF01-SMIC01F2 IPAD. Single line EMI filter including ESD protection. Main application. Description. Benefits. Pin configuration (Bump side view)

EMIF01-SMIC01F2 IPAD. Single line EMI filter including ESD protection. Main application. Description. Benefits. Pin configuration (Bump side view) IPAD Single line EMI filter including ESD protection Main application Single ended microphone in mobile phones and portable devices Description The is a highly integrated device designed to suppress EMI/RFI

More information

AN3155 Application note

AN3155 Application note Application note USART protocol used in the STM32 bootloader Introduction This application note describes the USART protocol used in the STM32 microcontroller bootloader. It details each supported command.

More information

STM32 embedded target for MATLAB and Simulink release 3.1. Summary for STM32 embedded target for MATLAB and Simulink release 3.1:

STM32 embedded target for MATLAB and Simulink release 3.1. Summary for STM32 embedded target for MATLAB and Simulink release 3.1: Release note STM32 embedded target for MATLAB and Simulink release 3.1 Introduction This release note is related to STM32 embedded target for MATLAB and Simulink (STM32- MAT/TARGET). It is updated periodically

More information

STM8-SK/RAIS STM8-D/RAIS ST7-SK/RAIS ST7-D/RAIS

STM8-SK/RAIS STM8-D/RAIS ST7-SK/RAIS ST7-D/RAIS STM8-SK/RAIS STM8-D/RAIS ST7-SK/RAIS ST7-D/RAIS Features Raisonance s complete, low-cost starter kits for STM8 and ST7 Embedded RLink USB interface to host PC In-circuit debugging and programming Application

More information

AN3140 Application note

AN3140 Application note Application note How to configure the SPEAr3xx general purpose timers (GPTs) Introduction This application note provides information about how to configure the general purpose timers (GPTs) integrated

More information

AN2792 Application note

AN2792 Application note Application note STM8A easy programmer 1 Introduction This application note describes the easy programmer which is a low cost solution allowing the content of the STM8A Flash program memory to be updated

More information

STM8L-PRIMER STM32-PRIMER STMPRIMER

STM8L-PRIMER STM32-PRIMER STMPRIMER STM8L-PRIMER STM32-PRIMER STMPRIMER Raisonance STM32 and STM8 Primers for fun, easy evaluation and development with STM32 and STM8 Features Data brief The versatile EvoPrimer range includes: In-circuit

More information

ST33F1M, ST33F1M0, ST33F896, ST33F768, ST33F640, ST33F512

ST33F1M, ST33F1M0, ST33F896, ST33F768, ST33F640, ST33F512 ST33F1M, ST33F1M0, ST33F896, ST33F768, ST33F640, ST33F512 Secure MCU with 32-bit ARM SC300 CPU, SWP interface, NESCRYPT cryptoprocessor and high-density Flash memory Data brief Micromodule DFN8 package

More information

AN3001 Application note

AN3001 Application note Application note Demonstration board user guidelines for the TS4657 single supply stereo digital audio line driver Introduction This application note focuses on the TS4657 demonstration board, designed

More information

EMIF02-SPK02F2. 2-line IPAD, EMI filter and ESD protection. Features. Application. Description. Complies with the following standards

EMIF02-SPK02F2. 2-line IPAD, EMI filter and ESD protection. Features. Application. Description. Complies with the following standards 2-line IPAD, EMI filter and ESD protection Datasheet production data Features Packaged in lead-free Flip Chip Very low resistance: 0.35 Ω High attenuation: -45 db at 900 MHz Very low PCB space consumption:

More information

AN3174 Application note

AN3174 Application note Application note Implementing an RC5 infrared remote control receiver with the STM32F10xx microcontrollers Introduction Nowadays, almost all audio and video equipment can be controlled using an infrared

More information

AN2548 Application note

AN2548 Application note Application note Using the STM32F101xx and STM32F103xx controller 1 Introduction This application note describes how to use the STM32F101xx and STM32F103xx direct memory access () controller. The STM32F101xx

More information

AN2860 Application note

AN2860 Application note Application note EMC guidelines for STM8 microcontrollers Introduction To meet the demand for higher performance, complexity and cost reduction, the semiconductor industry develops microcontrollers with

More information

EMIF02-MIC01F2 2-line IPAD, EMI filter including ESD protection Features Application Description Complies with the standards:

EMIF02-MIC01F2 2-line IPAD, EMI filter including ESD protection Features Application Description Complies with the standards: 2-line IPAD, EMI filter including ESD protection Features 2-line symetrical low-pass filter Lead-free package High-density capacitor High-efficiency EMI filtering Very small PCB footprint: 1.42 mm x 1.92

More information

AN4440 Application note

AN4440 Application note Application note RFFE HVDAC control Pascal Paillet Introduction The purpose of this application note is to familiarize mobile phone designers with RFFE HVDAC control. Common tasks are explained and more

More information

STMicroelectronics. STxP70-4 assembler. User manual Rev A. October

STMicroelectronics. STxP70-4 assembler. User manual Rev A. October STMicroelectronics STxP70-4 assembler User manual 8229631 Rev A October 2009 www.st.com BLANK User manual STxP70-4 assembler Introduction The STxP70-4 version of the assembler is based upon the GNU assembler

More information

UM0212 User manual. STOTG04 USB OTG full-speed transceiver demonstration board. Introduction

UM0212 User manual. STOTG04 USB OTG full-speed transceiver demonstration board. Introduction UM0 User manual STOTG04 USB OTG full-speed transceiver demonstration board Introduction This manual explains how to use and take full advantage of the STOTG04 universal serial bus (USB) on-the-go (OTG)

More information

SMP75. Trisil for telecom equipment protection. Features. Description. Applications. Benefits

SMP75. Trisil for telecom equipment protection. Features. Description. Applications. Benefits Trisil for telecom equipment protection Features bidirectional crowbar protection voltage: 8 V low leakage current: I R = 2 µa max holding current: I H = 15 ma min repetitive peak pulse current: I PP =

More information

UM1719 User manual. The STPM3x evaluation software. Introduction

UM1719 User manual. The STPM3x evaluation software. Introduction User manual The STPM3x evaluation software Introduction The STPM3x evaluation software is a graphical user interface to read, configure and calibrate the STPM3x energy metering ICs, suitable for parallel

More information

AN4152 Application note

AN4152 Application note Application note Clock configuration tool for STM32F302xx/STM32F303xx/STM32F31xxx microcontrollers Introduction This application note presents the clock system configuration tool for the STM32F302xx/STM32F303xx/STM32F31xxx

More information

AN2408 Application note

AN2408 Application note Application note 900mA standalone linear Li-Ion battery charger with thermal regulation Introduction One way to minimize the size and complexity of a battery charger is to use a linear-type charger. The

More information

AN2768 Application note LIS331DL 3-axis digital MEMS accelerometer: translates finger taps into actions Introduction

AN2768 Application note LIS331DL 3-axis digital MEMS accelerometer: translates finger taps into actions Introduction Application note LIS331DL 3-axis digital MEMS accelerometer: translates finger taps into actions Introduction This document is intended to provide application information for the LIS331DL low-voltage 3-axis

More information

Main components 1 A, high efficiency adjustable single inductor dual mode buckboost DC-DC converter

Main components 1 A, high efficiency adjustable single inductor dual mode buckboost DC-DC converter DN0007 Design note STBB1 buck-boost converter used as a 500mA LED driver with 1.8VDC-5.5VDC Vin Designs from our labs describe tested circuit designs from ST labs which provide optimized solutions for

More information

AN2606 Application note

AN2606 Application note Application note STM32F101xx, STM32F102xx and STM32F103xx system memory boot mode Introduction This application note describes the bootloader stored in the system memory of the STM32F101xx, STM32F102xx

More information

UM1008 User manual. Demonstration kit for the ST7570 power line modem with graphical user interface. Introduction

UM1008 User manual. Demonstration kit for the ST7570 power line modem with graphical user interface. Introduction User manual Demonstration kit for the ST7570 power line modem with graphical user interface Introduction The ST7570 GUI is a software tool that allows interfacing with one or more STMicroelectronics power

More information

How to interpret the LPS331AP pressure and temperature readings. Main components mbar absolute barometer with digital output

How to interpret the LPS331AP pressure and temperature readings. Main components mbar absolute barometer with digital output DT Design tip How to interpret the LPSAP pressure and temperature readings By Tom Bocchino and Boon-Nam Poh LPSAP Main components - mbar absolute barometer with digital output Purpose and benefits Description

More information