test4_sum08_sol - ECE 3724 Summer 2008 Test #4 Reese You...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE 3724 Summer 2008 Test #4 –Reese You may use only the provided reference materials. You may use a calculator, either a four- function or a scientific calculator. You may not use a programmable calculator. Use the DELAY_MS(x), DELAY_US(x) functions for any software delays that you need. Part I: (80 pts) a. (8 pts). Figure 1 shows an I2C write transaction, followed by a read transaction, that reads a digital potentiometer. Using the I2C transaction functions in Figure 2b, write a C code fragment that implement these two transactions. The returned byte from the potentiometer in the read transaction should be stored in a variable named u8_potValue . Hint: This takes two lines of code. uint8 u8_potValue; write1I2C1(0xA0, 0xF9); read1I2C1(0xA1, &u8_potValue); b. (8 pts) Repeat Problem #1, except use the primitive operations in Figure 2a. Hint: this takes eight lines of code. uint8 u8_potValue; startI2C1(); putI2c1(0xA0); putI2c1(0xF9); stopI2C1(); startI2C1(); putI2c1(0xA1); u8_potValue = getI2c1(1); //send a NAK! stopI2C1();
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
c. (8 pts) Assume a PIC24 μ C wants to read and write data to TWO slave devices using the SPI port. Draw a wiring diagram that accomplishes this, label the signals as to their functions. Be sure to indicate how the PIC24 μ C distinguishes which device it is talking with. Use a PIO port to select the slave to talk to. d. (8 pts) Assume a PIC24 wants to read and write data to TWO slave devices using the I 2 C port. Draw a diagram that accomplishes this, label the signals as to their functions. Be sure to indicate how the PIC24 μ C distinguishes which device it is talking with. Uses different I2C addresses to select slave
Background image of page 2
e. (8 pts) Recall that the LM34DZ temperature sensor in your parts kits outputs 10 mV per degree Fahrenheit. Assume port LATB2/RB2 has been configured to be an OUTPUT and is initially LOW. Also assume that the ADC has been configured for 12-bit mode with a VREF of 3.3 V, and that the LM34DZ is connected to input AN0. Write a
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 10

test4_sum08_sol - ECE 3724 Summer 2008 Test #4 Reese You...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online