59 #define SW_I2C_FREQUENCY 400 70 char*
descr[] = {
"SCK - MISO",
"MOSI - MISO",
"CS - MISO",
"IO2 - AD0",
"IO3~ - AD1",
"IO4 - AD2",
"IO5 - AD3"};
80 const uint8_t
readback[7] = {12, 12, 12 , 0, 1, 2, 3};
86 Serial.println(
"*****************************************************************");
87 Serial.println(
"* DC2741 production program test *");
88 Serial.println(
"* *");
89 Serial.println(
"* Set the baud rate to 115200 select the newline terminator. *");
90 Serial.println(
"* *");
91 Serial.println(
"*****************************************************************");
112 Serial.begin(115200);
120 unsigned char ackaddr;
121 unsigned char ack_count;
122 unsigned char fail_count;
125 Serial.println(
"\nSend any character to start the test. (Press enter in Arduino Serial Monitor.)");
127 Serial.println(
"Testing...");
133 for (address = 0; address < 128; address++)
142 Serial.print(
"Acknowledge received from address : 0x");
143 Serial.print(address, HEX);
144 Serial.print(
" (7 bit) 0x:");
145 Serial.print(address<<1, HEX);
146 Serial.println(
" (8-bit)");
151 Serial.println(
"Didn't find an EEPROM at address 0x50, FAIL");
161 if(digitalRead(
readback[i]) == HIGH)
163 Serial.print(
"Fail test low: ");
168 Serial.print(
"Pass test low: ");
171 Serial.println(
descr[i]);
176 Serial.print(
"Fail test high: ");
181 Serial.print(
"Pass test high: ");
184 Serial.println(
descr[i]);
195 Serial.print(
"Voltage: ");
196 Serial.println(voltage);
199 Serial.print(
"Fail test high: ");
204 Serial.print(
"Pass test high: ");
207 Serial.println(
descr[i]);
213 Serial.print(
"Voltage: ");
214 Serial.println(voltage);
217 Serial.print(
"Fail test low: ");
222 Serial.print(
"Pass test low: ");
224 Serial.println(
descr[i]);
229 Serial.println(
"All tests PASS!!");
230 Serial.println(
"All tests PASS!!");
231 Serial.println(
"All tests PASS!!");
235 Serial.println(
"Board FAILS!!");
236 Serial.println(
"Board FAILS!!");
237 Serial.print(
"Error Count: ");
238 Serial.println(fail_count);
#define output_high(pin)
Set "pin" high.
const uint8_t stimulus[7]
Header File for Linduino Libraries and Demo Code.
void i2c_stop()
Write stop bit to the hardware I2C port.
int8_t i2c_start()
Write start bit to the hardware I2C port.
int8_t i2c_write(uint8_t data)
Send a data byte to hardware I2C port.
#define output_low(pin)
Set "pin" low.
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
void quikeval_SPI_connect()
Connect SPI pins to QuikEval connector through the Linduino MUX. This will disconnect I2C...
static void print_title()
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
void quikeval_I2C_connect(void)
Switch MUX to connect I2C pins to QuikEval connector.
const uint8_t readback[7]
#define QUIKEVAL_CS
QuikEval CS pin (SPI chip select on QuikEval connector pin 6) connects to Arduino SS pin...