| 数据搜索系统,热门电子元器件搜索 |
|
LTC2400CS8 数据表(PDF) 31 Page - Linear Technology |
|
|
|||||||||||||||||||||||||||||
LTC2400CS8 数据表(HTML) 31 Page - Linear Technology |
|
31 / 40 page ![]() 31 LTC2400 Figure 32. This BASIC Stamp Code is an Example of How Easy it is to Retrieve Data from the LTC2400 ADlo.bit0 = in0 'and sample data line low SCK next high CS 'Disable the LTC2400 ADhi = (ADhi<<4)+((ADlo&$F000)>>12) debug ?ADhi 'Discard the lower eight bits goto Start 'and display (debug command). ShiftL Temp = ADlo.bit15 'This routine simply ADlo = ADlo<<1 'performs a 1 bit ADhi = ADhi<<1 'left shift on two ADhi.bit0 = Temp '16 bit variables return TYPICAL APPLICATIONS Figure 33. Connecting the LTC2400 to a 68HC11 MCU Using the SPI Serial Interface LTC2400 SCK SDO CS 7 6 5 SCK (PD4) MISO (PD2) SS (PD5) 68HC11 2400 F33 The listing in Figure 34 is a simple assembler routine for the 68HC11 microcontroller. It uses PORT D, configuring it for SPI data transfer between the controller and the LTC2400. Figure 33 shows the simple 3-wire SPI connection. The code begins by declaring variables and allocating four memory locations to store the 32-bit conversion result. This is followed by initializing PORT D’s SPI configuration. The program then enters the main sequence. It activates the LTC2400’s serial interface by setting the SS output low, sending a logic low to CS. It next waits in a loop for a logic low on the data line, signifying end-of-conversion. After the loop is satisfied, four SPI transfers are com- pleted, retrieving the conversion. The main sequence ends by setting SS high. This places the LTC2400’s serial interface in a high impedance state and initiates another conversion. ***************************************************** * This example program transfers the LTC2400's 32-bit output * * conversion result into four consecutive 8-bit memory locations. * ***************************************************** *68HC11 register definition PORTD EQU $1008 Port D data register * " – , – , SS* ,CSK ;MOSI,MISO,TxD ,RxD" DDRD EQU $1009 Port D data direction register SPSR EQU $1028 SPI control register * "SPIE,SPE ,DWOM,MSTR;SPOL,CPHA,SPR1,SPR0" SPSR EQU $1029 SPI status register * "SPIF,WCOL, – ,MODF; – , – , – , – " SPDR EQU $102A SPI data register; Read-Buffer; Write-Shifter * * RAM variables to hold the LTC2400's 32 conversion result |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 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 |