Differences

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

Link to this comparison view

pm:prj2023:avaduva:testerethernetcable [2023/05/22 12:12]
vlad.tunaru [Software Design]
pm:prj2023:avaduva:testerethernetcable [2023/05/22 13:06] (current)
vlad.tunaru [Bibliography]
Line 49: Line 49:
  
 {{:​pm:​prj2023:​avaduva:​schema.png?​600|}} {{:​pm:​prj2023:​avaduva:​schema.png?​600|}}
 +{{:​pm:​prj2023:​avaduva:​wewe_vlad.jpg?​450|}}
 ===== Software Design ===== ===== Software Design =====
  
  
-<note tip> 
 For this project, the following resources of the microcontroller were used: For this project, the following resources of the microcontroller were used:
 +
 • 1 general-purpose pin set as an output for an LED (PD6) • 1 general-purpose pin set as an output for an LED (PD6)
 +
 • 1 general-purpose pin set as an input for a button (PD5) • 1 general-purpose pin set as an input for a button (PD5)
 +
 • Alphanumeric LCD display with HD44780 driver configured on port C • Alphanumeric LCD display with HD44780 driver configured on port C
 +
 • 16 pins used as IN/OUT for cable continuity testing • 16 pins used as IN/OUT for cable continuity testing
 +
 The testing program uses 1 port with 8 bits for signal transmission and another port for reception, utilizing PORTA and PORTB, one defined as an input and the other as an output. The testing program uses 1 port with 8 bits for signal transmission and another port for reception, utilizing PORTA and PORTB, one defined as an input and the other as an output.
 Two arrays are used to store the display sequences for individual LED display or continuous display. For continuity testing, the individual display sequence is used, and the received result at the reception port is stored in the reception[8] array, thus preserving the order in which the test signal was received. By comparing the reception[8] array with three other arrays storing the correct sequences, the type of cable tested (crossover, rollover, straight) can be determined. If none of these patterns match, the cable is declared defective. The display of the detected cable type is done through an LCD display along with a map indicating the defective or good wires. Two arrays are used to store the display sequences for individual LED display or continuous display. For continuity testing, the individual display sequence is used, and the received result at the reception port is stored in the reception[8] array, thus preserving the order in which the test signal was received. By comparing the reception[8] array with three other arrays storing the correct sequences, the type of cable tested (crossover, rollover, straight) can be determined. If none of these patterns match, the cable is declared defective. The display of the detected cable type is done through an LCD display along with a map indicating the defective or good wires.
  
-for(i=0;​i<​=7;​i++){ // iterate through each bit of the test port and turn it on +      ​for(i=0;​i<​=7;​i++){ // iterate through each bit of the test port and turn it on 
-PORTA = afisare_single[i];​ +      PORTA = afisare_single[i];​ 
-}+      }
  
 This code snippet activates the pins on the test port. The logical signal 1 will pass through the cable and reach the reception port. Depending on the order in which it arrives, the values will be stored in an array to identify the type of cable. This code snippet activates the pins on the test port. The logical signal 1 will pass through the cable and reach the reception port. Depending on the order in which it arrives, the values will be stored in an array to identify the type of cable.
  
-if(PINB > 0) {  // if something is detected at input on port B+    ​if(PINB > 0) {  // if something is detected at input on port B
     if(IN1 == 1) receptie[i] = 1;   // write the corresponding value for the detected pin     if(IN1 == 1) receptie[i] = 1;   // write the corresponding value for the detected pin
     else if(IN2 == 1) receptie[i] = 2;     else if(IN2 == 1) receptie[i] = 2;
Line 76: Line 81:
     else if(IN7 == 1) receptie[i] = 7;  ​     else if(IN7 == 1) receptie[i] = 7;  ​
     else if(IN8 == 1) receptie[i] = 8;     else if(IN8 == 1) receptie[i] = 8;
-}  // end if detection+    ​}  // end if detection
 The received values are stored in the receptie[] array, preserving the order of each measured pin number. This array can be directly used to display the values on the LCD screen. The received values are stored in the receptie[] array, preserving the order of each measured pin number. This array can be directly used to display the values on the LCD screen.
-if(receptie[i] == straight[i]) sum++; +    ​if(receptie[i] == straight[i]) sum++; 
-if(sum == 8) {   // if all 8 wires are connected+    if(sum == 8) {   // if all 8 wires are connected
     lcd_puts("​Defect ​  "​);​     lcd_puts("​Defect ​  "​);​
     for(i=0;​i<​=7;​i++){ ​    // print the reception vector     for(i=0;​i<​=7;​i++){ ​    // print the reception vector
Line 86: Line 91:
         lcd_puts(buffer); ​           lcd_puts(buffer); ​  
     }     }
-}+    ​}
  
 The checking for each type of cable is done by testing each value in the received vector. If all 8 values are correct, it means that all wires are good and the respective configuration has been detected. If not all values are correct, another configuration is tested, and if no cable is identified, it will be declared defective. For a defective cable, the detected order is still displayed to identify the interrupted wires. The checking for each type of cable is done by testing each value in the received vector. If all 8 values are correct, it means that all wires are good and the respective configuration has been detected. If not all values are correct, another configuration is tested, and if no cable is identified, it will be declared defective. For a defective cable, the detected order is still displayed to identify the interrupted wires.
Line 97: Line 102:
  
 Resistors R1-R8 maintain the input potential at logical low (0) in case the wire is interrupted. Otherwise, the measured potential could be affected by external disturbances or user handling, etc. The resistor values are not critical and were selected to consume as little current as possible from the microcontroller'​s pins, resulting in a current of 60uA for an 82k resistor. Resistors R1-R8 maintain the input potential at logical low (0) in case the wire is interrupted. Otherwise, the measured potential could be affected by external disturbances or user handling, etc. The resistor values are not critical and were selected to consume as little current as possible from the microcontroller'​s pins, resulting in a current of 60uA for an 82k resistor.
-</​note>​ 
  
-===== Rezultate Obţinute ===== 
  
-<note tip> 
-Care au fost rezultatele obţinute în urma realizării proiectului vostru. 
-</​note>​ 
  
-===== Concluzii ​=====+===== Results ​===== 
 + 
 +{{:​pm:​prj2023:​avaduva:​final_vlad.jpg?​450|}} 
 +===== Conclusions ===== 
 + 
  
 +In conclusion, this project has helped us gain a better understanding of how to design, implement, and develop the necessary software for a device. We have learned valuable insights into working with microcontrollers,​ utilizing various input and output pins, interfacing with LCD displays, and performing cable continuity testing. Through this project, we have enhanced our skills in hardware design, programming,​ and troubleshooting. It has been a valuable learning experience that has equipped us with practical knowledge for future projects in device development.
 ===== Download ===== ===== Download =====
  
-<note warning>​ +{{:pm:​prj2023:​avaduva:​soft.zip|}}
-O arhivă (sau mai multe dacă este cazul) cu fişierele obţinute în urma realizării proiectuluisurse, scheme, etc. Un fişier README, un ChangeLog, un script de compilare şi copiere automată pe uC crează întotdeauna o impresie bună ;-).+
  
-Fişierele se încarcă pe wiki folosind facilitatea **Add Images or other files**. Namespace-ul în care se încarcă fişierele este de tipul **:​pm:​prj20??:​c?​** sau **:​pm:​prj20??:​c?:​nume_student** (dacă este cazul). **Exemplu:​** Dumitru Alin, 331CC -> **:​pm:​prj2009:​cc:​dumitru_alin**. 
-</​note>​ 
  
-===== Jurnal ​=====+===== Bibliography ​=====
  
-<note tip> +https://en.wikipedia.org/​wiki/Category_5_cable  ​
-Puteți avea și o secțiune de jurnal în care să poată urmări asistentul de proiect progresul proiectului. +
-</note>+
  
-===== Bibliografie/Resurse =====+https://​www.cnet.com/​culture/​how-to-make-your-own-ethernet-cable/ ​ Datasheet ATMEGA16  ​
  
-<​note>​ 
-Listă cu documente, datasheet-uri,​ resurse Internet folosite, eventual grupate pe **Resurse Software** şi **Resurse Hardware**. 
-</​note>​ 
  
 <​html><​a class="​media mediafile mf_pdf"​ href="?​do=export_pdf">​Export to PDF</​a></​html>​ <​html><​a class="​media mediafile mf_pdf"​ href="?​do=export_pdf">​Export to PDF</​a></​html>​
pm/prj2023/avaduva/testerethernetcable.1684746759.txt.gz · Last modified: 2023/05/22 12:12 by vlad.tunaru
CC Attribution-Share Alike 3.0 Unported
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