| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

DC2875A.ino
Go to the documentation of this file.
1 /*!
2 Linear Technology DC2875A Demonstration Board
3 LTC2971: Power System Management for High Voltage Systems
4
5 @verbatim
6
7 NOTES
8 Setup:
9 Set the terminal baud rate to 115200 and select the newline terminator.
10
11 @endverbatim
12
13 https://www.analog.com/en/products/LTC2971.html
14
15 https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/DC2875A.html
16
17
18 Copyright 2019(c) Analog Devices, Inc.
19
20 All rights reserved.
21
22 Redistribution and use in source and binary forms, with or without
23 modification, are permitted provided that the following conditions are met:
24 - Redistributions of source code must retain the above copyright
25 notice, this list of conditions and the following disclaimer.
26 - Redistributions in binary form must reproduce the above copyright
27 notice, this list of conditions and the following disclaimer in
28 the documentation and/or other materials provided with the
29 distribution.
30 - Neither the name of Analog Devices, Inc. nor the names of its
31 contributors may be used to endorse or promote products derived
32 from this software without specific prior written permission.
33 - The use of this software may or may not infringe the patent rights
34 of one or more patent holders. This license does not release you
35 from the requirement that you obtain separate licenses from these
36 patent holders to use this software.
37 - Use of the software either in source or binary form, must be run
38 on or directly connected to an Analog Devices Inc. component.
39
40 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
41 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
42 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
43 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
44 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
45 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
46 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
47 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
48 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
49 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
50 */
51
52 /*! @file
53 @ingroup LTC2971
54 */
55
56 #include <Arduino.h>
57 #include <stdint.h>
58 #include "Linduino.h"
59 #include "UserInterface.h"
60 #include "LT_Wire.h"
61 #include "LT_PMBus.h"
62 #include "LT_SMBusPec.h"
63 #include "LT_PMBusMath.h"
64 #include "LT_SMBus.h"
65 #include "LT_I2CBus.h"
66 #include "LT_SMBusGroup.h"
67 #include "LT_FaultLog.h"
68 #include "LT_SMBusNoPec.h"
69 #include "LT_SMBusBase.h"
70
71 #define LTC2971_0_I2C_ADDRESS 0x5C
72 #define LTC2971_1_I2C_ADDRESS 0x5D
73 //#define SCALING_FACTOR_CH3 -1.0
74 #define MFR_PG_CONFIG_ORIGINAL 0xC046
75 #define MFR_PG_CONFIG_WRITE_PG 0xC044
76
77 // Global variables
78 static uint8_t ltc2971_0_i2c_address;
79 static uint8_t ltc2971_1_i2c_address;
80 static LT_PMBusMath *math = new LT_PMBusMath();
81 static LT_SMBus *smbus = new LT_SMBusPec();
82 static LT_PMBus *pmbus = new LT_PMBus(smbus);
83
84 //! Initialize Linduino
85 void setup()
86 {
87 Serial.begin(115200); //! Initialize the serial port to the PC
88 print_title();
89 ltc2971_0_i2c_address = LTC2971_0_I2C_ADDRESS;
90 ltc2971_1_i2c_address = LTC2971_1_I2C_ADDRESS;
91
92 print_prompt();
93 }
94
95 //! Repeats Linduino loop
96 //! @return void
97 void loop()
98 {
99 uint8_t user_command;
100 uint8_t res;
101 uint8_t model[7];
102 uint8_t revision[10];
103 uint8_t *addresses = NULL;
104
105 if (Serial.available()) //! Checks for user input
106 {
107 user_command = read_int(); //! Reads the user command
108 if (user_command != 'm')
109 Serial.println(user_command);
110
111 switch (user_command) //! Prints the appropriate submenu
112 {
113 case 1:
114 menu_1_input_telemetry(); // Print single-ended voltage menu
115 break;
116 case 2:
117 menu_2_output_telemetry();
118 break;
119 case 3:
120 print_all_status();
121 break;
122 case 4:
123 menu_3_pg_commands();
124 break;
125 case 5:
126 menu_4_margin_commands();
127 break;
128 case 6:
129 menu_5_pec_commands();
130 break;
131 case 7:
132 sequence_off_on();
133 break;
134 case 8:
135 addresses = smbus->probe(0);
136 while (*addresses != 0)
137 {
138 Serial.print(F("ADDR 0x"));
139 Serial.println(*addresses++, HEX);
140 }
141 break;
142 case 9 :
143 pmbus->startGroupProtocol();
144 pmbus->restoreFromNvm(ltc2971_0_i2c_address);
145 pmbus->restoreFromNvm(ltc2971_1_i2c_address);
146 pmbus->executeGroupProtocol();
147 break;
148 default:
149 Serial.println(F("Incorrect Option"));
150 break;
151 }
152 print_prompt();
153 }
154
155 }
156
157 // Function Definitions
158
159 //! Prints the title block when program first starts.
160 void print_title()
161 {
162 Serial.print(F("\n*****************************************************************\n"));
163 Serial.print(F("* DC2875A Hello World Demonstration Program *\n"));
164 Serial.print(F("* *\n"));
165 Serial.print(F("* This program demonstrates how to send and receive data from *\n"));
166 Serial.print(F("* the LTC2875A demo board. *\n"));
167 Serial.print(F("* *\n"));
168 Serial.print(F("* Set the baud rate to 115200 and select the newline terminator.*\n"));
169 Serial.print(F("* *\n"));
170 Serial.print(F("*****************************************************************\n"));
171 }
172
173 //! Prints main menu.
174 void print_prompt()
175 {
176 Serial.println();
177 Serial.print(F(" 1-Read Input Telemetry\n"));
178 Serial.print(F(" 2-Read Output Telemetry\n"));
179 Serial.print(F(" 3-Read All Status\n"));
180 Serial.print(F(" 4-PG Commands\n"));
181 Serial.print(F(" 5-Margin Commands\n"));
182 Serial.print(F(" 6-PEC Options\n"));
183 Serial.print(F(" 7-Sequence Off/On\n"));
184 Serial.print(F(" 8-Bus Probe\n"));
185 Serial.print(F(" 9-Reset\n"));
186 Serial.print(F("\nEnter a command:"));
187 }
188
189 //! Prints a warning if the demo board is not detected.
190 void print_warning_prompt()
191 {
192 Serial.println(F("\nWarning: Demo board not detected. Linduino will attempt to proceed."));
193 }
194
195
196
197 //! Print all output voltages
198 void print_all_output_voltages()
199 {
200 float voltage;
201 float scaled_voltage;
202 uint8_t page;
203
204 for (page = 0; page < 2; page++)
205 {
206 pmbus->setPage(ltc2971_0_i2c_address, page);
207 voltage = pmbus->readVout(ltc2971_0_i2c_address, false);
208 /*scaled_voltage = voltage*scaling;*/
209 Serial.print(F(" LTC2971:U0:CH"));
210 Serial.print(page, DEC);
211 Serial.print(F(" VOUT = "));
212 Serial.print(voltage, DEC);
213 /*Serial.print(F("V (Scaled "));
214 Serial.print(scaled_voltage, DEC); */
215 Serial.println(F(" V"));
216 }
217
218 for (page = 0; page < 2; page++)
219 {
220 pmbus->setPage(ltc2971_1_i2c_address, page);
221 voltage = pmbus->readVout(ltc2971_1_i2c_address, false);
222 Serial.print(F(" LTC2971:U1:CH"));
223 Serial.print(page, DEC);
224 Serial.print(F(" VOUT = "));
225 Serial.print(voltage, DEC);
226 Serial.println(F(" V"));
227 }
228
229 //Serial.println();
230 }
231
232
233
234 //! Print all input voltages
235 //! @return void
236 void print_all_input_voltages()
237 {
238 float voltage;
239
240 voltage = pmbus->readVin(ltc2971_0_i2c_address, false);
241 Serial.print(F(" LTC2971:U0 VIN = "));
242 Serial.print(voltage, DEC);
243 Serial.println(F(" V"));
244 voltage = pmbus->readVin(ltc2971_1_i2c_address, false);
245 Serial.print(F(" LTC2971:U1 VIN = "));
246 Serial.print(voltage, DEC);
247 Serial.println(F(" V"));
248
249 }
250
251 //! Print all output currents
252 //! @return void
253 void print_all_output_currents()
254 {
255 float current;
256 uint8_t page;
257
258 for (page = 0; page < 2; page++)
259 {
260 pmbus->setPage(ltc2971_0_i2c_address, page);
261 current = pmbus->readIout(ltc2971_0_i2c_address, false);
262 Serial.print(F(" LTC2971:U0:CH"));
263 Serial.print(page, DEC);
264 Serial.print(F(" IOUT = "));
265 Serial.print(current, DEC);
266 Serial.println(F(" A"));
267 }
268
269 for (page = 0; page < 2; page++)
270 {
271 pmbus->setPage(ltc2971_1_i2c_address, page);
272 current = pmbus->readIout(ltc2971_1_i2c_address, false);
273 Serial.print(F(" LTC2971:U1:CH"));
274 Serial.print(page, DEC);
275 Serial.print(F(" IOUT = "));
276 Serial.print(current, DEC);
277 Serial.println(F(" A"));
278 }
279 }
280
281 //! Print all input currents
282 //! @return void
283 void print_all_input_currents()
284 {
285 float current;
286
287 current = pmbus->readIin(ltc2971_0_i2c_address, false);
288 Serial.print(F(" LTC2971:U0 Iin = "));
289 Serial.print(current, DEC);
290 Serial.println(F(" A"));
291 current = pmbus->readIin(ltc2971_1_i2c_address, false);
292 Serial.print(F(" LTC2971:U1 Iin = "));
293 Serial.print(current, DEC);
294 Serial.println(F(" A"));
295 }
296
297
298
299 //! Print all output power
300 //! @return void
301 void print_all_output_power()
302 {
303 float power;
304 uint8_t page;
305
306 for (page = 0; page < 2; page++)
307 {
308 pmbus->setPage(ltc2971_0_i2c_address, page);
309 power = pmbus->readPout(ltc2971_0_i2c_address, false);
310 Serial.print(F(" LTC2971:U0:CH"));
311 Serial.print(page, DEC);
312 Serial.print(F(" POUT = "));
313 Serial.print(power, DEC);
314 Serial.println(F(" W"));
315 }
316
317 for (page = 0; page < 2; page++)
318 {
319 pmbus->setPage(ltc2971_1_i2c_address, page);
320 power = pmbus->readPout(ltc2971_1_i2c_address, false);
321 Serial.print(F(" LTC2971:U1:CH"));
322 Serial.print(page, DEC);
323 Serial.print(F(" POUT = "));
324 Serial.print(power, DEC);
325 Serial.println(F(" W"));
326 }
327 }
328
329
330
331 //! Print all input power
332 //! @return void
333 void print_all_input_power()
334 {
335 float power;
336
337 power = pmbus->readPin(ltc2971_0_i2c_address, false);
338 Serial.print(F(" LTC2971:U0 Pin = "));
339 Serial.print(power, DEC);
340 Serial.println(F(" W"));
341 power = pmbus->readPin(ltc2971_1_i2c_address, false);
342 Serial.print(F(" LTC2971:U1 Pin = "));
343 Serial.print(power, DEC);
344 Serial.println(F(" W"));
345 }
346
347
348 //! Print all status bytes and words
349 //! @return void
350 void print_all_status()
351 {
352 uint8_t b;
353 uint16_t w;
354 uint8_t page;
355
356 for (page = 0; page < 2; page++)
357 {
358 Serial.print(F("U0:CH"));
359 Serial.println(page, DEC);
360 pmbus->setPage(ltc2971_0_i2c_address, page);
361 b = pmbus->readStatusByte(ltc2971_0_i2c_address);
362 Serial.print(F(" LTC2971 STATUS BYTE 0x"));
363 Serial.println(b, HEX);
364 w = pmbus->readStatusWord(ltc2971_0_i2c_address);
365 Serial.print(F(" LTC2971 STATUS WORD 0x"));
366 Serial.println(w, HEX);
367 }
368
369 for (page = 0; page < 2; page++)
370 {
371 Serial.print(F("U1:CH"));
372 Serial.println(page, DEC);
373 pmbus->setPage(ltc2971_1_i2c_address, page);
374 b = pmbus->readStatusByte(ltc2971_1_i2c_address);
375 Serial.print(F(" LTC2971 STATUS BYTE 0x"));
376 Serial.println(b, HEX);
377 w = pmbus->readStatusWord(ltc2971_1_i2c_address);
378 Serial.print(F(" LTC2971 STATUS WORD 0x"));
379 Serial.println(w, HEX);
380 }
381 }
382
383
384
385 //! Print all PG states
386 //! @return void
387 void print_all_pg()
388 {
389 uint16_t pg_status;
390
391 pg_status = smbus->readWord(ltc2971_0_i2c_address, 0xE5);
392 pg_status &= 0x03;
393 Serial.print(F(" PG0 = LOGIC"));
394 if (pg_status & 0x01)
395 {
396 Serial.print(F(" HIGH\n"));
397 }
398 else
399 {
400 Serial.print(F(" LOW\n"));
401 }
402 Serial.print(F(" PG1 = LOGIC"));
403 if (pg_status & 0x02)
404 {
405 Serial.print(F(" HIGH\n"));
406 }
407 else
408 {
409 Serial.print(F(" LOW\n"));
410 }
411
412 pg_status = smbus->readWord(ltc2971_1_i2c_address, 0xE5);
413 pg_status &= 0x03;
414 Serial.print(F(" PG2 = LOGIC"));
415 if (pg_status & 0x01)
416 {
417 Serial.print(F(" HIGH\n"));
418 }
419 else
420 {
421 Serial.print(F(" LOW\n"));
422 }
423 Serial.print(F(" PG3 = LOGIC"));
424 if (pg_status & 0x02)
425 {
426 Serial.print(F(" HIGH\n"));
427 }
428 else
429 {
430 Serial.print(F(" LOW\n"));
431 }
432 }
433
434
435
436 //! Toggle PG0
437 //! @return void
438 void toggle_pg0()
439 {
440
441 pmbus->setPage(ltc2971_0_i2c_address, 0);
442 smbus->writeWord(ltc2971_0_i2c_address, 0xCB, MFR_PG_CONFIG_WRITE_PG); //! enable writing to pg register
443 smbus->writeByte(ltc2971_0_i2c_address, 0xCE, 0x00); //! force pg low
444 delay(1000);
445 smbus->writeByte(ltc2971_0_i2c_address, 0xCE, 0x01); //! return pg to hi-z
446 smbus->writeWord(ltc2971_0_i2c_address, 0xCB, MFR_PG_CONFIG_ORIGINAL); //! return register to original state
447 }
448
449 //! Toggle PG0
450 //! @return void
451 void toggle_pg1()
452 {
453 pmbus->setPage(ltc2971_0_i2c_address, 1);
454 smbus->writeWord(ltc2971_0_i2c_address, 0xCB, MFR_PG_CONFIG_WRITE_PG);
455 smbus->writeByte(ltc2971_0_i2c_address, 0xCE, 0x00);
456 delay(1000);
457 smbus->writeByte(ltc2971_0_i2c_address, 0xCE, 0x01);
458 smbus->writeWord(ltc2971_0_i2c_address, 0xCB, MFR_PG_CONFIG_ORIGINAL);
459 }
460
461 //! Toggle PG2
462 //! @return void
463 void toggle_pg2()
464 {
465 pmbus->setPage(ltc2971_1_i2c_address, 0);
466 smbus->writeWord(ltc2971_1_i2c_address, 0xCB, MFR_PG_CONFIG_WRITE_PG);
467 smbus->writeByte(ltc2971_1_i2c_address, 0xCE, 0x00);
468 delay(1000);
469 smbus->writeByte(ltc2971_1_i2c_address, 0xCE, 0x01);
470 smbus->writeWord(ltc2971_1_i2c_address, 0xCB, MFR_PG_CONFIG_ORIGINAL);
471 }
472
473 //! Toggle PG3
474 //! @return void
475 void toggle_pg3()
476 {
477 pmbus->setPage(ltc2971_1_i2c_address, 1);
478 smbus->writeWord(ltc2971_1_i2c_address, 0xCB, MFR_PG_CONFIG_WRITE_PG);
479 smbus->writeByte(ltc2971_1_i2c_address, 0xCE, 0x00);
480 delay(1000);
481 smbus->writeByte(ltc2971_1_i2c_address, 0xCE, 0x01);
482 smbus->writeWord(ltc2971_1_i2c_address, 0xCB, MFR_PG_CONFIG_ORIGINAL);
483 }
484
485 //! Sequence off then on
486 //! @return void
487 void sequence_off_on()
488 {
489 pmbus->sequenceOffGlobal();
490 delay (2000);
491 pmbus->sequenceOnGlobal();
492 }
493
494 //! Margin high
495 //! @return void
496 void margin_high()
497 {
498 pmbus->marginHighGlobal();
499 }
500
501 //! Margin low
502 //! @return void
503 void margin_low()
504 {
505 pmbus->marginLowGlobal();
506 }
507
508
509
510 //! Go to nominal
511 //! @return void
512 void margin_off()
513 {
514 pmbus->sequenceOnGlobal();
515 }
516
517 //! Display menu 1
518 //! @return void
519 void menu_1_input_telemetry()
520 {
521 uint8_t user_command;
522
523 do
524 {
525 //! Displays the Input Telemetry menu
526 Serial.println();
527 Serial.print(F(" 1-Read Input Voltages\n"));
528 Serial.print(F(" 2-Read Input Currents\n"));
529 Serial.print(F(" 3-Read Input Power\n"));
530 Serial.print(F(" 4-Read All Input Telemetry\n"));
531 Serial.print(F(" m-Main Menu\n"));
532 Serial.print(F("\nEnter a command: "));
533
534 user_command = read_int(); //! Reads the user command
535 if (user_command == 'm') // Print m if it is entered
536 {
537 Serial.print(F("m\n"));
538 }
539 else
540 Serial.println(user_command); // Print user command
541
542 switch (user_command)
543 {
544 case 1:
545 print_all_input_voltages();
546 break;
547 case 2:
548 print_all_input_currents();
549 break;
550 case 3:
551 print_all_input_power();
552 break;
553 case 4:
554 Serial.println();
555 print_all_input_voltages();
556 Serial.println();
557 print_all_input_currents();
558 Serial.println();
559 print_all_input_power();
560 break;
561 default:
562 if (user_command != 'm')
563 Serial.println(F("Invalid Selection"));
564 break;
565 }
566 }
567 while (user_command != 'm');
568 }
569
570 //! Display menu 2
571 //! @return void
572 void menu_2_output_telemetry()
573 {
574 uint8_t user_command;
575
576 do
577 {
578 //! Displays the Ouput Telemetry menu
579 Serial.println();
580 Serial.print(F(" 1-Read Output Voltages\n"));
581 Serial.print(F(" 2-Read Output Currents\n"));
582 Serial.print(F(" 3-Read Output Power\n"));
583 Serial.print(F(" 4-Read All Output Telemetry\n"));
584 Serial.print(F(" m-Main Menu\n"));
585 Serial.print(F("\nEnter a command: "));
586
587 user_command = read_int(); //! Reads the user command
588 if (user_command == 'm') // Print m if it is entered
589 {
590 Serial.print(F("m\n"));
591 }
592 else
593 Serial.println(user_command); // Print user command
594
595 switch (user_command)
596 {
597 case 1:
598 print_all_output_voltages();
599 break;
600 case 2:
601 print_all_output_currents();
602 break;
603 case 3:
604 print_all_output_power();
605 break;
606 case 4:
607 Serial.println();
608 print_all_output_voltages();
609 Serial.println();
610 print_all_output_currents();
611 Serial.println();
612 print_all_output_power();
613 break;
614 default:
615 if (user_command != 'm')
616
617 Serial.println(F("Invalid Selection"));
618 break;
619 }
620 }
621 while (user_command != 'm');
622 }
623
624 //! Display menu 3
625 //! @return void
626 void menu_3_pg_commands()
627 {
628 uint8_t user_command;
629
630 do
631 {
632 //! Displays the PG Command menu
633 Serial.println();
634 Serial.print(F(" 1-Read All PG States\n"));
635 Serial.print(F(" 2-Force PG0 Low (1 sec)\n"));
636 Serial.print(F(" 3-Force PG1 Low (1 sec)\n"));
637 Serial.print(F(" 4-Force PG2 Low (1 sec)\n"));
638 Serial.print(F(" 5-Force PG3 Low (1 sec)\n"));
639 Serial.print(F(" m-Main Menu\n"));
640 Serial.print(F("\nEnter a command: "));
641
642 user_command = read_int(); //! Reads the user command
643 if (user_command == 'm') // Print m if it is entered
644 {
645 Serial.print(F("m\n"));
646 }
647 else
648 Serial.println(user_command); // Print user command
649
650 switch (user_command)
651 {
652 case 1:
653 print_all_pg();
654 break;
655 case 2:
656 toggle_pg0();
657 break;
658 case 3:
659 toggle_pg1();
660 break;
661 case 4:
662 toggle_pg2();
663 break;
664 case 5:
665 toggle_pg3();
666 break;
667 default:
668 if (user_command != 'm')
669 Serial.println(F("Invalid Selection"));
670 break;
671 }
672 }
673 while (user_command != 'm');
674 }
675
676
677 //! Display menu 4
678 //! @return void
679 void menu_4_margin_commands()
680 {
681 uint8_t user_command;
682
683 do
684 {
685 //! Displays the Margin menu
686 Serial.println();
687 Serial.print(F(" 1-Margin High\n"));
688 Serial.print(F(" 2-Margin Low\n"));
689 Serial.print(F(" 3-Margin Off\n"));
690 Serial.print(F(" m-Main Menu\n"));
691 Serial.print(F("\nEnter a command: "));
692
693 user_command = read_int(); //! Reads the user command
694 if (user_command == 'm') // Print m if it is entered
695 {
696 Serial.print(F("m\n"));
697 }
698 else
699 Serial.println(user_command); // Print user command
700
701 switch (user_command)
702 {
703 case 1:
704 margin_high();
705 delay(500);
706 print_all_output_voltages();
707 break;
708 case 2:
709 margin_low();
710 delay(500);
711 print_all_output_voltages();
712 break;
713 case 3:
714 margin_off();
715 delay(500);
716 print_all_output_voltages();
717 break;
718 default:
719 if (user_command != 'm')
720 Serial.println(F("Invalid Selection"));
721 break;
722 }
723 }
724 while (user_command != 'm');
725 }
726
727
728 //! Display menu 5
729 //! @return void
730 void menu_5_pec_commands()
731 {
732 uint8_t user_command;
733
734 do
735 {
736 //! Displays the PEC menu
737 Serial.println();
738 Serial.print(F(" 1-PEC On\n"));
739 Serial.print(F(" 2-PEC Off\n"));
740 Serial.print(F(" m-Main Menu\n"));
741 Serial.print(F("\nEnter a command: "));
742
743 user_command = read_int(); //! Reads the user command
744 if (user_command == 'm') // Print m if it is entered
745 {
746 Serial.print(F("m\n"));
747 }
748 else
749 Serial.println(user_command); // Print user command
750
751 switch (user_command)
752 {
753 case 1:
754 pmbus->enablePec(ltc2971_0_i2c_address);
755 pmbus->enablePec(ltc2971_1_i2c_address);
756 delete smbus;
757 delete pmbus;
758 smbus = new LT_SMBusPec();
759 pmbus = new LT_PMBus(smbus);
760 Serial.print(F("\n PEC Enabled"));
761 break;
762 case 2:
763 pmbus->enablePec(ltc2971_0_i2c_address);
764 pmbus->enablePec(ltc2971_1_i2c_address);
765 delete smbus;
766 delete pmbus;
767 smbus = new LT_SMBusNoPec();
768 pmbus = new LT_PMBus(smbus);
769 Serial.print(F("\n PEC Disabled"));
770 break;
771 default:
772 if (user_command != 'm')
773 Serial.println(F("Invalid Selection"));
774 break;
775 }
776 }
777 while (user_command != 'm');
778 }
LT_PMBus::readPout
float readPout(uint8_t address, bool polling)
Get the measured output power.
Definition: LT_PMBus.cpp:1963
menu_1_input_telemetry
static void menu_1_input_telemetry()
Display menu 1.
Definition: DC2875A.ino:519
user_command
unsigned char user_command
Definition: Serial_EEPROM_Test.ino:75
print_title
static void print_title()
Prints the title block when program first starts.
Definition: DC2875A.ino:160
LT_SMBus.h
LTC SMBus Support: API for a shared SMBus layer.
LT_SMBusGroup.h
LTC SMBus Support: Implementation for a shared SMBus layer.
LT_SMBusPec.h
LTC SMBus Support: Implementation for a shared SMBus layer.
MFR_PG_CONFIG_ORIGINAL
#define MFR_PG_CONFIG_ORIGINAL
Definition: DC2875A.ino:74
LT_PMBus::readStatusByte
uint8_t readStatusByte(uint8_t address)
Get the status byte.
Definition: LT_PMBus.cpp:2423
toggle_pg2
static void toggle_pg2()
Toggle PG2.
Definition: DC2875A.ino:463
sequence_off_on
static void sequence_off_on()
Sequence off then on.
Definition: DC2875A.ino:487
Linduino.h
Header File for Linduino Libraries and Demo Code.
LT_PMBus::enablePec
void enablePec(uint8_t address)
Enable pec for all transactions.
Definition: LT_PMBus.cpp:3173
LT_SMBusNoPec
Definition: LT_SMBusNoPec.h:60
print_all_input_power
static void print_all_input_power()
Print all input power.
Definition: DC2875A.ino:333
math
static LT_PMBusMath * math
Definition: DC2875A.ino:80
LTC2971_0_I2C_ADDRESS
#define LTC2971_0_I2C_ADDRESS
Definition: DC2875A.ino:71
print_all_pg
static void print_all_pg()
Print all PG states.
Definition: DC2875A.ino:387
LT_PMBus::readStatusWord
uint16_t readStatusWord(uint8_t address)
Get the status word.
Definition: LT_PMBus.cpp:2470
LT_PMBus::readIout
float readIout(uint8_t address, bool polling)
Get the measured output current.
Definition: LT_PMBus.cpp:1898
pmbus
static LT_PMBus * pmbus
Definition: DC2875A.ino:82
ltc2971_0_i2c_address
static uint8_t ltc2971_0_i2c_address
Definition: DC2875A.ino:78
print_prompt
static void print_prompt()
Prints main menu.
Definition: DC2875A.ino:174
LT_SMBus::writeWord
virtual void writeWord(uint8_t address, uint8_t command, uint16_t data)=0
SMBus write word command.
smbus
static LT_SMBus * smbus
Definition: DC2875A.ino:81
LT_SMBusPec
Definition: LT_SMBusPec.h:61
LT_Wire.h
TwoWire.h - TWI/I2C library for Arduino & Wiring Copyright (c) 2006 Nicholas Zambetti.
print_all_output_voltages
static void print_all_output_voltages()
Print all output voltages.
Definition: DC2875A.ino:198
LT_SMBus
Definition: LT_SMBus.h:61
print_all_status
static void print_all_status()
Print all status bytes and words.
Definition: DC2875A.ino:350
LT_PMBus::readPin
float readPin(uint8_t address, bool polling)
Get the measured input power.
Definition: LT_PMBus.cpp:2027
LT_PMBus::startGroupProtocol
void startGroupProtocol(void)
starts group protocol
Definition: LT_PMBus.cpp:3350
LTC2971_1_I2C_ADDRESS
#define LTC2971_1_I2C_ADDRESS
Definition: DC2875A.ino:72
LT_PMBus::readVout
float readVout(uint8_t address, bool polling)
Get the measured output voltage.
Definition: LT_PMBus.cpp:1598
print_all_output_power
static void print_all_output_power()
Print all output power.
Definition: DC2875A.ino:301
margin_off
static void margin_off()
Go to nominal.
Definition: DC2875A.ino:512
toggle_pg3
static void toggle_pg3()
Toggle PG3.
Definition: DC2875A.ino:475
LT_I2CBus.h
LT_I2CBus: Routines to communicate to I2C by Wire Library.
print_all_output_currents
static void print_all_output_currents()
Print all output currents.
Definition: DC2875A.ino:253
LT_FaultLog.h
LTC PMBus Support: Implementation for a LTC Fault Log.
LT_SMBus::writeByte
virtual void writeByte(uint8_t address, uint8_t command, uint8_t data)=0
SMBus write byte command.
menu_5_pec_commands
static void menu_5_pec_commands()
Display menu 5.
Definition: DC2875A.ino:730
print_warning_prompt
static void print_warning_prompt()
Prints a warning if the demo board is not detected.
Definition: DC2875A.ino:190
margin_low
static void margin_low()
Margin low.
Definition: DC2875A.ino:503
LT_PMBus::setPage
void setPage(uint8_t address, uint8_t page)
Set the page.
Definition: LT_PMBus.cpp:3156
LT_PMBus::marginLowGlobal
void marginLowGlobal(void)
Margin all rails low.
Definition: LT_PMBus.cpp:3078
ltc2971_1_i2c_address
static uint8_t ltc2971_1_i2c_address
Definition: DC2875A.ino:79
toggle_pg1
static void toggle_pg1()
Toggle PG0.
Definition: DC2875A.ino:451
LT_PMBus::sequenceOnGlobal
void sequenceOnGlobal(void)
Sequence on all rails.
Definition: LT_PMBus.cpp:2896
LT_SMBus::probe
virtual uint8_t * probe(uint8_t command)=0
SMBus bus probe.
menu_4_margin_commands
static void menu_4_margin_commands()
Display menu 4.
Definition: DC2875A.ino:679
setup
static void setup()
Initialize Linduino.
Definition: DC2875A.ino:85
LT_PMBus::readIin
float readIin(uint8_t address, bool polling)
Get the input current.
Definition: LT_PMBus.cpp:1805
LT_SMBusNoPec.h
LTC SMBus Support: Implementation for a shared SMBus layer.
toggle_pg0
static void toggle_pg0()
Toggle PG0.
Definition: DC2875A.ino:438
UserInterface.h
read_int
int32_t read_int()
Definition: UserInterface.cpp:93
LT_PMBus::sequenceOffGlobal
void sequenceOffGlobal(void)
Sequence off all rails.
Definition: LT_PMBus.cpp:2876
LT_PMBus::readVin
float readVin(uint8_t address, bool polling)
Get the input voltage.
Definition: LT_PMBus.cpp:1487
LT_PMBus::executeGroupProtocol
void executeGroupProtocol(void)
ends group protocol
Definition: LT_PMBus.cpp:3356
LT_PMBusMath
Definition: LT_PMBusMath.h:53
LT_PMBus::restoreFromNvm
void restoreFromNvm(uint8_t address)
Restore device from NVM.
Definition: LT_PMBus.cpp:2663
loop
static void loop()
Repeats Linduino loop.
Definition: DC2875A.ino:97
LT_PMBus.h
LTC PMBus Support.
voltage
static float voltage
Definition: DC2289AA.ino:71
MFR_PG_CONFIG_WRITE_PG
#define MFR_PG_CONFIG_WRITE_PG
Definition: DC2875A.ino:75
current
static uint16_t current
the current measurement from the LTC3335&#39;s counter test mode.
Definition: DC2343A.ino:114
LT_PMBus::marginHighGlobal
void marginHighGlobal(void)
Margin all rails high.
Definition: LT_PMBus.cpp:3068
LT_PMBusMath.h
LTC PMBus Support: Math conversion routines.
print_all_input_currents
static void print_all_input_currents()
Print all input currents.
Definition: DC2875A.ino:283
menu_2_output_telemetry
static void menu_2_output_telemetry()
Display menu 2.
Definition: DC2875A.ino:572
margin_high
static void margin_high()
Margin high.
Definition: DC2875A.ino:496
LT_SMBus::readWord
virtual uint16_t readWord(uint8_t address, uint8_t command)=0
SMBus read word command.
print_all_input_voltages
static void print_all_input_voltages()
Print all input voltages.
Definition: DC2875A.ino:236
menu_3_pg_commands
static void menu_3_pg_commands()
Display menu 3.
Definition: DC2875A.ino:626
LT_SMBusBase.h
LTC SMBus Support: Implementation for a shared SMBus layer.
LT_PMBus
PMBus communication.
Definition: LT_PMBus.h:370