參數(shù)資料
型號(hào): PICDEM2
廠商: Microchip Technology Inc.
英文描述: simple board
中文描述: 簡(jiǎn)潔的主板
文件頁數(shù): 21/60頁
文件大小: 1037K
代理商: PICDEM2
PICDEM 2 User
s Guide
DS30374D-page 16
2001 Microchip Technology Inc.
5.1 SSP Module
This section presents the flowcharts to implement a software I
2
C master
mode in hardware. For MSSP operation, refer to Section 5.2.
5.1.1
Main Routine
The main routine is actually preceded by several register file, bit and vector
assignments (Figure 5.2). The program begins by configuring PORTB as
outputs and PORTC as inputs. The output data value will be read from
PORTB, so it is initialized to one.
PORTC is cleared to set SCL and SCA low when not in tri-state. This is
important as I
2
C is an open-drain bus. That is, only the zero values are
actually driven to the bus. Ones are transmitted by making the pin an input
(tristate) and allowing the pullup resistor to pull the line high. Data is
transmitted in this manner by initializing the SCL and SDA port pins to zero
and then writing the output value to the corresponding TRIS bit. A one written
to the bit causes the pin to tristate pulled high and a zero causes it to become
an output, driven low.
Interrupts are not used in this program, so they are disabled. Also, the SSP is
configured to enable I
2
C master mode.
The write/read loop begins with the initialization of the EEPROM address to
00h, and the device address to A0h. Then the write loop executes by writing
the output data value to each address in the EEPROM (Figure 5.3). After the
write loop, the EEPROM address and device address are re-initialized for
read. The read loop executes by reading data values for each EEPROM
address and verifying their accuracy (Figure 5.4).
After the read loop, the output data value is incremented by one and this
value displayed, via PORTB, on the LEDs. Then the write/read loop begins
again.
If an error is encountered when writing or reading the EEPROM, or if an
EEPROM value read is incorrect, the program jumps to the error loop, which
flashes the LEDs (Figure 5.5).
相關(guān)PDF資料
PDF描述
PIP500 TRANSIENT ABSORPTION ZENER
PIP440 7,500 & 15,000 Watt TVS Module
PIP500 STEEL BOX
PIP60 7,500 & 15,000 Watt TVS Module
PIP24 Circular Connector; Body Material:Aluminum Alloy; Series:KPSE08; No. of Contacts:12; Connector Shell Size:14; Connecting Termination:Crimp; Circular Shell Style:Right Angle Plug; Circular Contact Gender:Socket RoHS Compliant: No
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
PICDEMPIC18 制造商:MICROCHIP 制造商全稱:Microchip Technology 功能描述:PICDEMPIC18 EXPLORER DEMONSTRATION BOARD USERa??S GUIDE
PICE-52-03-ID2-D40 功能描述:EMULATOR 8051 64K 40MHZ 40-DIP RoHS:是 類別:編程器,開發(fā)系統(tǒng) >> 內(nèi)電路編程器、仿真器以及調(diào)試器 系列:- 產(chǎn)品變化通告:Development Systems Discontinuation 19/Jul/2010 標(biāo)準(zhǔn)包裝:1 系列:* 類型:* 適用于相關(guān)產(chǎn)品:* 所含物品:*
PICE-52-03-ID2-L44 功能描述:EMULATOR 8051 64K 40MHZ 44-PLCC RoHS:是 類別:編程器,開發(fā)系統(tǒng) >> 內(nèi)電路編程器、仿真器以及調(diào)試器 系列:- 產(chǎn)品變化通告:Development Systems Discontinuation 19/Jul/2010 標(biāo)準(zhǔn)包裝:1 系列:* 類型:* 適用于相關(guān)產(chǎn)品:* 所含物品:*
PICE-52-05-ID2-D40 功能描述:EMULATOR 8051 1M 40MHZ 40-DIP RoHS:是 類別:編程器,開發(fā)系統(tǒng) >> 內(nèi)電路編程器、仿真器以及調(diào)試器 系列:- 產(chǎn)品變化通告:Development Systems Discontinuation 19/Jul/2010 標(biāo)準(zhǔn)包裝:1 系列:* 類型:* 適用于相關(guān)產(chǎn)品:* 所含物品:*
PICE-52-05-ID2-L44 功能描述:EMULATOR 8051 1M 40MHZ 44-PLCC RoHS:是 類別:編程器,開發(fā)系統(tǒng) >> 內(nèi)電路編程器、仿真器以及調(diào)試器 系列:- 產(chǎn)品變化通告:Development Systems Discontinuation 19/Jul/2010 標(biāo)準(zhǔn)包裝:1 系列:* 類型:* 適用于相關(guān)產(chǎn)品:* 所含物品:*