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

X  

AN1753 Datasheet(PDF) 9 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) 9 Page - STMicroelectronics

Back Button AN1753 Datasheet HTML 5Page - STMicroelectronics AN1753 Datasheet HTML 6Page - STMicroelectronics AN1753 Datasheet HTML 7Page - STMicroelectronics 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 Next Button
Zoom Inzoom in Zoom Outzoom out
 9 / 22 page
background image
DocID9986 Rev 2
9/22
AN1753
UART implementation
4
UART implementation
4.1
Baud rate definition
The Autoreload timer is used to generate the baud rate. The autoreload timer clock
(fCOUNTER) is the same as the fcpu clock, which is an 8 MHz internal clock.
The example below describes how this baud is generated:
- baudrate = 2400
- fcpu = 8MHz (so clock period is 125 ns)
- In the application fCOUNTER = fcpu
So to get 2400 baud the “Prescaler” required is,
Prescaler = fcpu / baud
Prescaler = 8 * 10
6 / 2400
= 0.0033333333 * 10
6
= 3333.33 decimal
= D05 Hex (= 1 bit delay count)
So in software DCRx will be
DCR0H = 0D + CNTRH
DCR0L = 05 + CNTRL
to generate one bit delay when 2400 baud is required
For half bit period “Prescaler” is,
Prescaler = one bit / 2
= 1666.66 (decimal)
= 682 Hex (= 1/2 bit delay)
DCR0H = 06 + CNTRH
DCR0L = 82 + CNTRL
The software provided with this application note has been functionally tested in the range
2400 to 19200 baud.
4.2
Majority-voting system
Compared to the transmit section, the receive section is complex. Thus, to avoid possible
errors in detecting the exact bit status because of line noise, etc., this program uses a
majority-voting system. When the ST7LITE0 is in receive mode, it reads (samples) each bit
three times in the middle of the bit time. To determine its exact state, it compares the
number of 1’s with the number of 0’s. If there are more ‘1‘s than ‘0‘s, the bit received is a ‘1‘,
else it is a ‘0‘. (see Figure 3)
Figure 3. Majority-voting system
This section is only used for the receive part. You can change it to suit your requirements.
012
3
4
5
67
1st sample
2nd sample
3rd sample
START
STOP



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