You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: uart-polling/README.md
+33-20Lines changed: 33 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,25 +19,38 @@ Connect the board with host through USB to TTL converter (FTDI board in our case
19
19
| PA10 | Tx |
20
20
| Gnd | Gnd |
21
21
22
-

22
+

23
23
24
24
## Control flow
25
25
26
-

27
-
28
-
1. Program the reload value:\
29
-
The reload value can be loaded by setting `LOAD` register. This value is set to 1 less that the number of clock cycles needed for the interrupt as the timer counts both reload value as well as zero. e.g. If the SysTick interrupt is required every 100 clock pulses, set RELOAD to 99.
30
-
2. Clear current value:\
31
-
This register can be accessed using `VAL` variable. Bits *24:31* are reserved and 24 bit value can be read from bits *23:0*. Writing any value this register sets it to zero along with setting `COUNT_FLAG` to zero.
32
-
3. Configure SysTick and start:
33
-
1. Select clock source-\
34
-
Clock source can be set using `CLKSOURCE` bit (2) of `CTRL` register.\
35
-
0 - AHB/8\
36
-
1 - Processor Clock (AHB)
37
-
2. Enable Tick interrupt-\
38
-
To enable Tick interrupt set `TICKINT` bit (2) of `CTRL` register.
39
-
3. Start SysTick timer-\
40
-
`ENABLE` bit (0) of `CTRL` register enables the counter. When `ENABLE` is set to 1, the counter loads the `RELOAD` value from the `LOAD` register and then counts down. On reaching 0, it sets the `COUNTFLAG` to 1 and optionally asserts the `SysTick` depending on the value of `TICKINT`. It then loads the `RELOAD` value again, and begins counting.
26
+
The initialisation function accomplishes following tasks
27
+
28
+
1. Enables clock signal for USART1 peripheral as well as GPIO Port A, both are connected with APB2 bus.\
0 commit comments