Electronic Components Datasheet Search
  New Zealand  ▼
ALLDATASHEET.CO.NZ

X  

AN1753 Datasheet(PDF) 12 Page - STMicroelectronics

Part # AN1753
Description  Software UART using ST7LITE0 12-bit autoreload timer
PDF  22 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN1753 Datasheet(HTML) 12 Page - STMicroelectronics

Back Button AN1753 Datasheet HTML 8Page - STMicroelectronics AN1753 Datasheet HTML 9Page - STMicroelectronics AN1753 Datasheet HTML 10Page - STMicroelectronics AN1753 Datasheet HTML 11Page - STMicroelectronics AN1753 Datasheet HTML 12Page - STMicroelectronics AN1753 Datasheet HTML 13Page - STMicroelectronics AN1753 Datasheet HTML 14Page - STMicroelectronics AN1753 Datasheet HTML 15Page - STMicroelectronics AN1753 Datasheet HTML 16Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 12 / 22 page
background image
Functional software flow
AN1753
12/22
DocID9986 Rev 2
6
Functional software flow
The character format used is “ASCII”. Before starting a communication, you should
configure the communication parameters to your requirements. You can select the baud
rate, number of bits and stop bits in different combinations. However, for a correct
communication, the receiver must have a reception baud rate strictly equal to the
transmission baud rate of the transmitter. If not, the communication will be corrupted. So you
have to configure the “Hyperterminal” correctly.
To configure the device, you must set del_1bh, del_1bl, del_sampl, del_samph, STOP_BIT
and TxRx_data_lnth correctly in your software.
After power on, the ST7FLITE0 goes to transmit mode. It initiates the communication by
transmitting character “$” in ASCII format and then goes to receive mode. The PC then
receives this character on its serial port, which can be viewed in the Hyperterminal window.
You then have to press a key (character) to transmit. After pressing a character key, it gets
transmitted and the ST7LITE0 receives it. The ST7LITE0 then sends the same received
character to the PC. This sequence can be repeated continuously (see Figure 5).
6.1
Main software routines
The UART software consists of 4 main routines:
•
Tx_data
•
Rx_data
•
EI1_Interrupt
•
OPCOMP_int
Tx_data: This routine is used to transmit data in bit format stored in variable “TX_byte”. It
also takes care of the synchronization and of the output compare interrupt. The AT timer is
initialized to the application configuration inside this routine.
Rx_data: This routine is used to receive data on the input pin in bit format and stores it in
“RX_byte”. To detect a start bit, it initializes the PA7 pin in interrupt mode.
EI1_Interrupt: This “ei1” interrupt routine gets executed only once during receive data when
PA7 receives a start (high to low edge) bit. It also initiates the AT timer for a half bit duration.
OPCOMP_int: This routine gets executed in both transmit and receive modes. During a
Tx_dataroutine execution, it gets executed for each data bit transfer. It is actually used to
transmit data on the TxD (PA3) pin along with the start and stop bits.
In receive mode, it gets executed for each data bit received, including the start and stop bits.
The majority-voting system is implemented in the same section of code.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com