DataSheet.es    


PDF AN1096 Data sheet ( Hoja de datos )

Número de pieza AN1096
Descripción Using the C30 Compiler to Interface SPI Serial EEPROMs
Fabricantes Microchip 
Logotipo Microchip Logotipo



Hay una vista previa y un enlace de descarga de AN1096 (archivo pdf) en la parte inferior de esta página.


Total 12 Páginas

No Preview Available ! AN1096 Hoja de datos, Descripción, Manual

AN1096
Using the C30 Compiler to Interface SPI Serial EEPROMs
with dsPIC33F and PIC24F
Author: Martin Kvasnicka
Microchip Technology Inc.
INTRODUCTION
The 25XXX series serial EEPROMs from Microchip
Technology are SPI compatible and have maximum
clock frequencies ranging from 3 MHz to 20 MHz. Many
times when designing an application which utilizes a
serial EEPROM device, it may be beneficial to use a
microcontroller which does not feature a dedicated
protocol-specific serial port. This can be due to several
possible reasons, including size restrictions or costs. In
these instances, it is required of the designer to write
software routines capable of generating the proper
signals for communicating with the EEPROM device.
This application note provides assistance and source
code to ease the design process of interfacing a
Microchip dsPIC33F Digital Signal Controller to a
Microchip SPI serial EEPROM, without the use of a
hardware serial port.
Figure 1 describes the hardware schematic for the
interface between Microchip’s 25XXX series devices
and the dsPIC33F DSC or PIC24F PIC® microcontrol-
ler. The schematic shows the connections necessary
between the DSC or PIC MCU and the serial EEPROM
as tested, and the software was written assuming
these connections. The WP and HOLD pins are tied to
VCC through resistors, because the write-protect and
hold features are not used in the examples provided.
FIGURE 1:
CIRCUIT FOR dsPIC33F256GP710, PIC24FJ128GA010 AND 25XXX SERIES
DEVICES
100 Pin TQFP
dsPIC33FJ256GP710
PIC24FJ128GA010
SDA1/RG3
SCK1/INT0/RF6
SDI1/RF7
SDO1/RF8
U1RX/RF2
U1TX/RF3
CS 1
SO 2
WP 3
Vss 4
Vcc
8 Vcc
7 HOLD
6 SCK
5 SI
Note: CS, WP and HOLD pins should all have pull-up resistors (~10k-ohms).
© 2007 Microchip Technology Inc.
DS01096B-page 1

1 page




AN1096 pdf
AN1096
BYTE WRITE COMMAND (OPCODE,
ADDRESS AND DATA)
Figure 4 shows an example of the Write command.
First, the device is selected by bringing Chip Select low
(active). In this example, the Most Significant bit of the
address is a ‘1’. This bit is embedded in the opcode
(0x02 for a Write command), and so the value, 0x0A, is
sent. The Low Address byte (0x33) is sent next. Finally,
the data is clocked in, in this case, 0xCC. Once Chip
Select is toggled at the end of this command, the inter-
nal write cycle is initiated. After the write cycle has
begun, the WIP bit in the STATUS register can be
polled to check when the write finishes. If polling is not
used, a delay (~5ms) needs to be added to ensure the
write has finished. This code uses WIP polling.
A page write can be accomplished by continuing to
send data bytes to the device without toggling CS. Up
to 16 bytes can be written to the 25LC040A before a
write cycle is needed. Once CS is brought high after the
data bytes have been transmitted, then the write cycle
timer will begin and normal polling can be initiated.
The Page Write function provided in the firmware is
used to program 16 bytes of data, starting at address
0x150. Because page writes cannot cross page bound-
aries, care must be taken to avoid having data wrap
around to the beginning of the page and overwrite
existing data.
FIGURE 4:
BYTE WRITE COMMAND, ADDRESS AND DATA
CS
SCK
SI
SO
TWC
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
Instruction
Low Address Byte
Data Byte
0 0 0 0 A8 0 1 0 A7 A6 A5 A4 A3 A2 A1 A0 7 6 5 4 3 2 1 0
High-Impedance
© 2007 Microchip Technology Inc.
DS01096B-page 5

5 Page





AN1096 arduino
Note the following details of the code protection feature on Microchip devices:
• Microchip products meet the specification contained in their particular Microchip Data Sheet.
• Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding device
applications and the like is provided only for your convenience
and may be superseded by updates. It is your responsibility to
ensure that your application meets with your specifications.
MICROCHIP MAKES NO REPRESENTATIONS OR
WARRANTIES OF ANY KIND WHETHER EXPRESS OR
IMPLIED, WRITTEN OR ORAL, STATUTORY OR
OTHERWISE, RELATED TO THE INFORMATION,
INCLUDING BUT NOT LIMITED TO ITS CONDITION,
QUALITY, PERFORMANCE, MERCHANTABILITY OR
FITNESS FOR PURPOSE. Microchip disclaims all liability
arising from this information and its use. Use of Microchip
devices in life support and/or safety applications is entirely at
the buyer’s risk, and the buyer agrees to defend, indemnify and
hold harmless Microchip from any and all damages, claims,
suits, or expenses resulting from such use. No licenses are
conveyed, implicitly or otherwise, under any Microchip
intellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, Accuron,
dsPIC, KEELOQ, KEELOQ logo, microID, MPLAB, PIC,
PICmicro, PICSTART, PRO MATE, rfPIC and SmartShunt are
registered trademarks of Microchip Technology Incorporated
in the U.S.A. and other countries.
AmpLab, FilterLab, Linear Active Thermistor, Migratable
Memory, MXDEV, MXLAB, SEEVAL, SmartSensor and The
Embedded Control Solutions Company are registered
trademarks of Microchip Technology Incorporated in the
U.S.A.
Analog-for-the-Digital Age, Application Maestro, CodeGuard,
dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN,
ECONOMONITOR, FanSense, FlexROM, fuzzyLAB,
In-Circuit Serial Programming, ICSP, ICEPIC, Mindi, MiWi,
MPASM, MPLAB Certified logo, MPLIB, MPLINK, PICkit,
PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal,
PowerInfo, PowerMate, PowerTool, REAL ICE, rfLAB, Select
Mode, Smart Serial, SmartTel, Total Endurance, UNI/O,
WiperLock and ZENA are trademarks of Microchip
Technology Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated
in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
© 2007, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.
Microchip received ISO/TS-16949:2002 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and
Tempe, Arizona; Gresham, Oregon and design centers in California
and India. The Company’s quality system processes and procedures
are for its PIC® MCUs and dsPIC® DSCs, KEELOQ® code hopping
devices, Serial EEPROMs, microperipherals, nonvolatile memory and
analog products. In addition, Microchip’s quality system for the design
and manufacture of development systems is ISO 9001:2000 certified.
© 2007 Microchip Technology Inc.
DS01096B-page 11

11 Page







PáginasTotal 12 Páginas
PDF Descargar[ Datasheet AN1096.PDF ]




Hoja de datos destacado

Número de piezaDescripciónFabricantes
AN10935Using SDR/DDR SDRAM memoriesNXP Semiconductors
NXP Semiconductors
AN1096Using the C30 Compiler to Interface SPI Serial EEPROMsMicrochip
Microchip
AN10981GreenChip TEA1738 series fixed frequency flyback controllerNXP Semiconductors
NXP Semiconductors

Número de piezaDescripciónFabricantes
SLA6805M

High Voltage 3 phase Motor Driver IC.

Sanken
Sanken
SDC1742

12- and 14-Bit Hybrid Synchro / Resolver-to-Digital Converters.

Analog Devices
Analog Devices


DataSheet.es es una pagina web que funciona como un repositorio de manuales o hoja de datos de muchos de los productos más populares,
permitiéndote verlos en linea o descargarlos en PDF.


DataSheet.es    |   2020   |  Privacy Policy  |  Contacto  |  Buscar