전자부품 데이터시트 검색엔진
  Korean  ▼
ALLDATASHEET.CO.KR

X  

PICDEM2 데이터시트(PDF) 21 Page - Microchip Technology

부품명 PICDEM2
상세설명  simple board
PDF  60 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
제조업체  MICROCHIP [Microchip Technology]
홈페이지  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PICDEM2 데이터시트(HTML) 21 Page - Microchip Technology

Back Button PICDEM2 Datasheet HTML 17Page - Microchip Technology PICDEM2 Datasheet HTML 18Page - Microchip Technology PICDEM2 Datasheet HTML 19Page - Microchip Technology PICDEM2 Datasheet HTML 20Page - Microchip Technology PICDEM2 Datasheet HTML 21Page - Microchip Technology PICDEM2 Datasheet HTML 22Page - Microchip Technology PICDEM2 Datasheet HTML 23Page - Microchip Technology PICDEM2 Datasheet HTML 24Page - Microchip Technology PICDEM2 Datasheet HTML 25Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 21 / 60 page
background image
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 I2C 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 I2C 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 I2C 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).



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60


데이터시트 다운로드

Go To PDF Page


링크 URL



ALLDATASHEET 가 귀하에 도움이 되셨나요?  [ DONATE ] 

Alldatasheet는?   |   광고문의   |   운영자에게 연락하기   |   개인정보취급방침   |   링크 투 데이터시트    |   링크교환   |   제조사별 검색
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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