| Electronic Components Datasheet Search |
|
MCP3002T-I/P Datasheet(PDF) 15 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
MCP3002T-I/P Datasheet(HTML) 15 Page - Microchip Technology |
|
15 / 28 page ![]() © 2007 Microchip Technology Inc. DS21294C-page 15 MCP3002 6.0 APPLICATIONS INFORMATION 6.1 Using the MCP3002 with Microcontroller (MCU) SPI Ports With most microcontroller SPI ports, it is required to send groups of eight bits. It is also required that the microcon- troller SPI port be configured to clock out data on the fall- ing edge of clock and latch data in on the rising edge. Depending on how communication routines are used, it is very possible that the number of clocks required for communication will not be a multiple of eight. Therefore, it may be necessary for the MCU to send more clocks than are actually required. This is usually done by send- ing ‘leading zeros’ before the start bit, which are ignored by the device. As an example, Figure 6-1 and Figure 6- 2 show how the MCP3002 can be interfaced to a MCU with a hardware SPI port. Figure 6-1 depicts the opera- tion shown in SPI Mode 0,0, which requires that the SCLK from the MCU idles in the ‘low’ state, while Figure 6-2 shows the similar case of SPI Mode 1,1 where the clock idles in the ‘high’ state. As shown in Figure 6-1, the first byte transmitted to the A/D Converter contains one leading zero before the start bit. Arranging the leading zero this way produces the output 10 bits to fall in positions easily manipulated by the MCU. When the first 8 bits are transmitted to the device, the MSB data bit is clocked out of the A/D Con- verter on the falling edge of clock number 6. After the second eight clocks have been sent to the device, the receive register will contain the lowest order eight bits of the conversion results. Easier manipulation of the con- verted data can be obtained by using this method. FIGURE 6-1: SPI Communication with the MCP3002 using 8-bit segments (Mode 0,0: SCLK idles low). FIGURE 6-2: SPI Communication with the MCP3002 using 8-bit segments (Mode 1,1: SCLK idles high). 1 2 3 456 7 8 CS SCLK DIN X = Don’t Care Bits 9 10 11 121314 15 16 DOUT NULL BIT B9 B8 B7 B6 B5 B4 B3 B2 B1 B0 MCU latches data from A/D Converter Data is clocked out of A/D Converter on falling edges on rising edges of SCLK Don’t Care XX X X X XXX XXX B7 B6 B5 B4 B3 B2 B1 B0 B9 B8 0 XX X 1 Start Bit (Null) MCU Transmitted Data (Aligned with falling edge of clock) MCU Received Data (Aligned with rising edge of clock) MSBF SGL/ DIFF ODD/ SIGN Data stored into MCU receive register after transmission of first 8 bits Data stored into MCU receive register after transmission of second 8 bits XX X X 1234 5 6 7 8 CS SCLK DIN X = Don’t Care Bits 9 10 11 1213 1415 16 DOUT NULL BIT B9 B8 B6 B5 B4 B3 B2 B1 B0 HI-Z X XXX XX XX B7 B6 B5 B4 B3 B2 B1 B0 B9 B8 0 X X X MCU latches data from A/D Converter on rising edges of SCLK Data is clocked out of A/D Converter on falling edges (Null) MCU Transmitted Data (Aligned with falling edge of clock) MCU Received Data (Aligned with rising edge of clock) B7 Data stored into MCU receive register after transmission of first 8 bits Data stored into MCU receive register after transmission of second 8 bits XX X 1 Start Bit MSBF SGL/ DIFF ODD/ SIGN X X X Don’t Care |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |