Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: MAXREFDES131_Qt_Demo MAX32630FTHR_iButton_uSD_Logger MAX32630FTHR_DS18B20_uSD_Logger MAXREFDES130_131_Demo ... more
OneWire_Masters/GPIO/owlink.asm@28:057bb14d3cee, 2016-03-29 (annotated)
- Committer:
- IanBenzMaxim
- Date:
- Tue Mar 29 09:55:25 2016 -0500
- Revision:
- 28:057bb14d3cee
Updated bit-bang master to use assembly counter for timing. Tested in IAR using High Speed and No Size Constraint optimizations.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
IanBenzMaxim | 28:057bb14d3cee | 1 | PROC_CLOCK_MHZ EQU 24 ; Processor clock in MHz |
IanBenzMaxim | 28:057bb14d3cee | 2 | OVERHEAD_TUNING EQU 21 ; Fraction where OverheadTime(us) = OVERHEAD_TUNING / PROC_CLOCK_MHZ |
IanBenzMaxim | 28:057bb14d3cee | 3 | ; Make PROC_CLOCK_MHZ and OVERHEAD_TUNING divisible by PROC_CYCLES_PER_LOOP for best results |
IanBenzMaxim | 28:057bb14d3cee | 4 | |
IanBenzMaxim | 28:057bb14d3cee | 5 | PIPELINE_REFILL_PROC_CYCLES EQU 1 ; ARM specifies 1-3 cycles for pipeline refill following a branch |
IanBenzMaxim | 28:057bb14d3cee | 6 | PROC_CYCLES_PER_LOOP EQU (2 + PIPELINE_REFILL_PROC_CYCLES) |
IanBenzMaxim | 28:057bb14d3cee | 7 | LOOPS_PER_US EQU (PROC_CLOCK_MHZ / PROC_CYCLES_PER_LOOP) ; Number of loop passes for a 1 us delay |
IanBenzMaxim | 28:057bb14d3cee | 8 | LOOPS_REMOVED_TUNING EQU (OVERHEAD_TUNING / PROC_CYCLES_PER_LOOP) |
IanBenzMaxim | 28:057bb14d3cee | 9 | |
IanBenzMaxim | 28:057bb14d3cee | 10 | SECTION owlink : CODE |
IanBenzMaxim | 28:057bb14d3cee | 11 | |
IanBenzMaxim | 28:057bb14d3cee | 12 | ; void ow_usdelay(unsigned int time_us) |
IanBenzMaxim | 28:057bb14d3cee | 13 | PUBLIC ow_usdelay |
IanBenzMaxim | 28:057bb14d3cee | 14 | ow_usdelay: |
IanBenzMaxim | 28:057bb14d3cee | 15 | mov R1, #LOOPS_PER_US |
IanBenzMaxim | 28:057bb14d3cee | 16 | mul R0, R0, R1 |
IanBenzMaxim | 28:057bb14d3cee | 17 | sub R0, R0, #LOOPS_REMOVED_TUNING |
IanBenzMaxim | 28:057bb14d3cee | 18 | loop: |
IanBenzMaxim | 28:057bb14d3cee | 19 | subs R0, R0, #1 |
IanBenzMaxim | 28:057bb14d3cee | 20 | bne loop |
IanBenzMaxim | 28:057bb14d3cee | 21 | bx R14 |
IanBenzMaxim | 28:057bb14d3cee | 22 | |
IanBenzMaxim | 28:057bb14d3cee | 23 | END |