Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:multiasm:exercisesbook:avr:sut [2026/04/30 16:52] – [Communication] pczekalskien:multiasm:exercisesbook:avr:sut [2026/05/04 14:50] (current) – [Visualising Instruction Execution Time Using an Oscilloscope] pczekalski
Line 341: Line 341:
 <note tip>Nodes are interconnected in pairs: 1-2, 3-4, 5-6, 7-8, 9-10. Scenarios for data transmission between MCUs require booking and the use of correct nodes for sending and receiving messages.</note> <note tip>Nodes are interconnected in pairs: 1-2, 3-4, 5-6, 7-8, 9-10. Scenarios for data transmission between MCUs require booking and the use of correct nodes for sending and receiving messages.</note>
  
-===== Laboratory Scenarios ===== +==== Visualising Instruction Execution Time Using an Oscilloscope ==== 
-Below are hands-on lab scenarios intended for use with the [[https://iot.aei.polsl.pl|VREL NextGen system]] (access via browser; no need to install the toolchain or any other software).+Let's try to visualise how code operates the GPIONaturally, in the remote lab, it is not possible to do it remotely, so here we present some desk-based experiments.\\ 
 +The ''LAT_PIN'' is GPIO4, and an oscilloscope is connected to it. 
 +In the function that displays single digit, there is a section that loads a binary mask into the internal registers, enabling the LED segments that constitute the digit to be turned on and offIt is: 
 +<code asm> 
 +... 
 +    sbi LAT_PORT, LAT_PIN 
 +    cbi LAT_PORT, LAT_PIN 
 +... 
 +</code>
  
-  * +The figures {{ref>arduinounodigitoscilloscope1}} and {{ref>arduinounodigitoscilloscope2}} present the ''LAT_PIN'' signal, called periodically during the display of the consecutive digits (they represent the same signal but differ by the oscilloscope time base for better observation).\\ 
 +''SBI'' causes the signal to rise, while ''CBI'' to fall. Thus, the HIGH time is the exact time during which the CBI instruction executes. It takes about 120-130ns.\\ 
 +The Arduino Uno operates at 16 MHz, so each cycle is 1/16000000 s, which is about 63 ns. According to the documentation, ''CBI'' takes 2 cycles, which is ~126ns.
  
 +<figure arduinounodigitoscilloscope1>
 +{{:en:multiasm:exercisesbook:avr:pic_1054.png?300|}}
 +<caption>''LAT_PIN'' signal (50ns time base)</caption>
 +</figure>
  
 +<figure arduinounodigitoscilloscope2>
 +{{:en:multiasm:exercisesbook:avr:pic_1055.png?300|}}
 +<caption>''LAT_PIN'' signal (25ns time base)</caption>
 +</figure>
en/multiasm/exercisesbook/avr/sut.1777557155.txt.gz · Last modified: by pczekalski
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0