Truncated match.
PICList
Thread
'EEPROM'
1997\04\22@032206
by
David BALDWIN
Sorry, I forgot to ask about code for serial EEPROM: 93LC56 from
Microchip. Thanks.
--
_____________
\ / David BALDWIN
\ ALCATEL / Design engineer
\TELECOM/
\ / SdM (Societe de Microelectronique)
\ /
\ / B.P. 4205 Phone : +32 (0)71 442932
V B-6000 Charleroi Fax : +32 (0)71 442905
(Belgium) spam_OUTbaldwinTakeThisOuT
etca.alcatel.be
'EEPROM'
1997\12\03@112942
by
WF AUTOMACAO
Are still the PIC16C84/PIC16F84... the only Microchip's IC that
have EEPROM program?
Miguel.
1997\12\03@132749
by
obo (Ingenieria Fotonica)
At 13:38 3/12/97 -0800, you wrote:
>Are still the PIC16C84/PIC16F84... the only Microchip's IC that
>have EEPROM program?
>
Ahh! good question, Miguel. I was wondering the same. I think that they
have just released a 12CExxx PIC with 16 bytes of EEPROM data, but with no
EEPROM program memory.
They have a "future products catalog" with a lot of Flash PICs, but I don't
know how far this "future" is...
Adolfo.
-----------------------------------------------------------------------
| Adolfo Cobo Garcia - UNIVERSIDAD DE CANTABRIA |
| E.T.S.I.I. y Telecomunicacion, Grupo de Ingenieria Fotonica |
| Avda. Los Castros s/n E-39005 Santander SPAIN |
| Tfno. +34-42-201539 Fax +34-42-201873 Email: .....acoboKILLspam
@spam@teisa.unican.es |
-----------------------------------------------------------------------
1997\12\03@145027
by
Steve Smith
In a message dated 03/12/97 16:31:26, you write:
<<
Are still the PIC16C84/PIC16F84... the only Microchip's IC that
have EEPROM program?
Miguel.
>>
You forgot the 'F83 same as 'F84 but half as big.........
Yes until next year Q4 (information current on 16-11-97)
Have you fixed your keyboard ?
sTEVE (fOR cLARITY)...............
'EEPROM'
1998\03\06@203109
by
Chris A Brainerd
I'm working on a project where I need to hook up an EEPROM chip to a
PIC16C84 and I need to know how the interface works between the PIC and
the EEPROM probably XI2C Bus. If anyone can explain how it works, or
knows a webpage or something that explains it I would appreciate it.
Thanks.
Chris
_____________________________________________________________________
I'm, like, a product, OK, of american, you know, education, all right?
DJ_Ramen
KILLspamjuno.com
_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]
1998\03\10@174420
by
Ron Kreymborg
|
Chris
Have a look at an article on my web page that describes a Microchip
24LC16B I2C serial ram chip driver.
http://www.shm.monash.edu.au/~r.kreymborg/pic/24lc16.html
Ron
On Sat, 7 Mar 1998, Chris A Brainerd wrote:
{Quote hidden}> I'm working on a project where I need to hook up an EEPROM chip to a
> PIC16C84 and I need to know how the interface works between the PIC and
> the EEPROM probably XI2C Bus. If anyone can explain how it works, or
> knows a webpage or something that explains it I would appreciate it.
> Thanks.
>
> Chris
>
>
> _____________________________________________________________________
> I'm, like, a product, OK, of american, you know, education, all right?
>
.....DJ_RamenKILLspam
.....juno.com
>
> _____________________________________________________________________
> You don't need to buy Internet access to use free Internet e-mail.
> Get completely free e-mail from Juno at
http://www.juno.com
> Or call Juno at (800) 654-JUNO [654-5866]
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ron Kreymborg Computer Systems Manager
Monash University CRC for Southern Hemisphere Meteorology
Wellington Road
Clayton, VIC 3168 Phone : 061-3-9905-9671
Australia Fax : 061-3-9905-9689
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1998\03\16@180646
by
Thomas Fleckenstein
Hi,
I am new to the Pic and I would like to ask you for help:
My project:
I will use a 16C84 Pic to read data from a data acquisition unit. This data
acquisition unit sends every 60 seconds data through a serial port.
I would like to read the data with a PIC and than store these data in a external
EEPROM via IIC bus. I am planning to use the new 24AAxx chip
with 256k memory.This EEPROM should function as a ringbuffer. The data from the
serial port will be stored and when the memory is full,
it should start overwrite the datas and so on. I will connect also a RS232
transceiver chip to the PIC so that I can read the data in the EEPROM
through a mobile telephone.
I need to know:
1. How does the IIC routine has to look like.
2. How can I design a ringbuffer with a eeprom connected via IIC bus.
Thanks in advance for your help.
Best Regards,
Thomas
1998\03\17@092310
by
Charles Laforge
Hi
Look around carefully. Some serial eeprom will take care of the
"ringbuffer". When you reach the end of memory it will start writing at
the beginning. I don't have any details but I think the 24LCXX and the
rest of that family do it. I have some 24C256 from Atmel and I think
they do it too. Look around and I'm sure you'll find the answer. If
you don't give me a shout and i will try to help.
Charles
<SNIP!>
with 256k memory.This EEPROM should function as a ringbuffer. The data
from the serial port will be stored and when the memory is full,
it should start overwrite the datas and so on. I will connect also a
<SNIP!>
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
1998\03\17@201147
by
Chris A Brainerd
|
Do you know somewhere I could buy Atmel 24C256's in low quantities (a
few)?
Chris
_____________________________________________________________________
I'm, like, a product, OK, of american, you know, education, all right?
EraseMEDJ_Ramenspam_OUT
TakeThisOuTjuno.com
On Tue, 17 Mar 1998 06:06:01 PST Charles Laforge <cjoachim
spam_OUTHOTMAIL.COM>
writes:
{Quote hidden}>Hi
>
>Look around carefully. Some serial eeprom will take care of the
>"ringbuffer". When you reach the end of memory it will start writing
>at
>the beginning. I don't have any details but I think the 24LCXX and
>the
>rest of that family do it. I have some 24C256 from Atmel and I think
>they do it too. Look around and I'm sure you'll find the answer. If
>you don't give me a shout and i will try to help.
>
>Charles
>
><SNIP!>
>
>with 256k memory.This EEPROM should function as a ringbuffer. The data
>from the serial port will be stored and when the memory is full,
>it should start overwrite the datas and so on. I will connect also a
>
><SNIP!>
>
>______________________________________________________
>Get Your Private, Free Email at
http://www.hotmail.com
>
_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]
1998\03\18@194920
by
Mike Keitz
|
On Mon, 16 Mar 1998 20:45:07 -0200 Thomas Fleckenstein
<@spam@rakelogthomasKILLspam
VORTEX.IS> writes:
[...]
Not many people have answered this so here goes.
>I need to know:
>1. How does the IIC routine has to look like.
For just controlling an EEPROM, you don't need a full IIC implementation.
The parts about multiple-master arbitration and the slave making the
master wait by holding clock low don't apply. The timing charts in the
EEPROM data sheet are about all you need to know. Since the SCL pin on
an EEPROM is always an input, it's OK to just use a PIC pin always as an
output to drive it. But you do need a pull-up resistor on the SDA pin
and be sure the PIC only drives it low when apropriate.
>2. How can I design a ringbuffer with a eeprom connected via IIC bus.
There's nothing too magic about this, just write bytes in sequence and
wrap around at the end. The problem is you also need to store pointers
to the start and end of the data to find it again. Storing the pointers
in fixed locations in EEPROM will cause these locations to wear out much
faster than the rest of the chip, since they are written every time data
is stored. If it's OK for the buffer to become empty when power is lost,
just keep the pointers in PIC RAM. When the power comes on again, set
them to a "random" value so the first bytes in EEPROM aren't reused over
and over again.
I think a good way to keep the buffer state permanently would be to store
special marker bytes or sequences of bytes (that are certain not to occur
in the actual data) to indicate the start and end of the valid data. To
add data, the PIC would scan for the marker, overwrite it with new data,
and write a new marker. This way the wear on the EEPROM is better (more
evenly) distributed.
_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]
1998\03\22@131911
by
Thomas Fleckenstein
|
Hi Charles,
Thanks for your help. I saw some EEPROMS in the Digikey catalog, advertised as
"smart EEPROM" . Are these the ones that you are suggesting?
Best Regards,
Thomas
Charles Laforge wrote:
{Quote hidden}> Hi
>
> Look around carefully. Some serial eeprom will take care of the
> "ringbuffer". When you reach the end of memory it will start writing at
> the beginning. I don't have any details but I think the 24LCXX and the
> rest of that family do it. I have some 24C256 from Atmel and I think
> they do it too. Look around and I'm sure you'll find the answer. If
> you don't give me a shout and i will try to help.
>
> Charles
>
> <SNIP!>
>
> with 256k memory.This EEPROM should function as a ringbuffer. The data
> from the serial port will be stored and when the memory is full,
> it should start overwrite the datas and so on. I will connect also a
>
> <SNIP!>
>
> ______________________________________________________
> Get Your Private, Free Email at
http://www.hotmail.com
1998\03\22@131915
by
Thomas Fleckenstein
|
Hi Mike,
Thank you very much for your help.
could you send me a example code for the ringbuffer ?
Best Regards,
Thomas
Mike Keitz wrote:
{Quote hidden}> On Mon, 16 Mar 1998 20:45:07 -0200 Thomas Fleckenstein
> <
KILLspamrakelogthomasKILLspam
VORTEX.IS> writes:
> [...]
> Not many people have answered this so here goes.
>
> >I need to know:
> >1. How does the IIC routine has to look like.
>
> For just controlling an EEPROM, you don't need a full IIC implementation.
> The parts about multiple-master arbitration and the slave making the
> master wait by holding clock low don't apply. The timing charts in the
> EEPROM data sheet are about all you need to know. Since the SCL pin on
> an EEPROM is always an input, it's OK to just use a PIC pin always as an
> output to drive it. But you do need a pull-up resistor on the SDA pin
> and be sure the PIC only drives it low when apropriate.
>
> >2. How can I design a ringbuffer with a eeprom connected via IIC bus.
>
> There's nothing too magic about this, just write bytes in sequence and
> wrap around at the end. The problem is you also need to store pointers
> to the start and end of the data to find it again. Storing the pointers
> in fixed locations in EEPROM will cause these locations to wear out much
> faster than the rest of the chip, since they are written every time data
> is stored. If it's OK for the buffer to become empty when power is lost,
> just keep the pointers in PIC RAM. When the power comes on again, set
> them to a "random" value so the first bytes in EEPROM aren't reused over
> and over again.
>
> I think a good way to keep the buffer state permanently would be to store
> special marker bytes or sequences of bytes (that are certain not to occur
> in the actual data) to indicate the start and end of the valid data. To
> add data, the PIC would scan for the marker, overwrite it with new data,
> and write a new marker. This way the wear on the EEPROM is better (more
> evenly) distributed.
>
> _____________________________________________________________________
> You don't need to buy Internet access to use free Internet e-mail.
> Get completely free e-mail from Juno at
http://www.juno.com
> Or call Juno at (800) 654-JUNO [654-5866]
'Eeprom'
1998\11\30@155008
by
darwin
Hi,
any idea on how to store sound effects and voice
using an eeprom. thanks
1998\11\30@160502
by
Dave VanHorn
Darwin Reynoso wrote:
>
> Hi,
> any idea on how to store sound effects and voice
> using an eeprom. thanks
Go to the record store, and tell the manager "I've got a nice EEPROM
here, and I'll trade you for a CD full of sound effects and voices"
Seriously, you need to perform some sort of A/D conversion to obtain
store-able data. The EEPROM isn't much involved in this process. Then
once you have stored data, you'll need to convert it back to analog,
with a D/A conversion. You can add compression to make better use of
your storage, or encode delta-sigma, but all this happens outside the
EEPROM.
1998\11\30@164234
by
Harold Hallikainen
1998\11\30@191034
by
darwin
Is there any book that you know of can teaches the subject
Dave VanHorn wrote:
{Quote hidden}> Darwin Reynoso wrote:
> >
> > Hi,
> > any idea on how to store sound effects and voice
> > using an eeprom. thanks
>
> Go to the record store, and tell the manager "I've got a nice EEPROM
> here, and I'll trade you for a CD full of sound effects and voices"
>
> Seriously, you need to perform some sort of A/D conversion to obtain
> store-able data. The EEPROM isn't much involved in this process. Then
> once you have stored data, you'll need to convert it back to analog,
> with a D/A conversion. You can add compression to make better use of
> your storage, or encode delta-sigma, but all this happens outside the
> EEPROM.
'eeprom'
1999\01\12@230922
by
ryan pogge
what is the easiest eeprom to use with a pic 16f84 and Pic basic Pro?
I want to use it for a data logger that loggs the time and date of an event
no more than 200 events.....
I am looking at my digi-key catalogue right now at the microchip eeproms
I see 2 wire, spi, and 3 wire eeproms... there are so many under each of
those categories, how do I choose?
thanks,
Ryan
1999\01\13@010329
by
Tjaart van der Walt
|
ryan pogge wrote:
>
> what is the easiest eeprom to use with a pic 16f84 and Pic basic Pro?
> I want to use it for a data logger that loggs the time and date of an event
> no more than 200 events.....
> I am looking at my digi-key catalogue right now at the microchip eeproms
> I see 2 wire, spi, and 3 wire eeproms... there are so many under each of
> those categories, how do I choose?
2 wire (I2C) is probably the easiest way.
You get two different addressing schemes :
1) 7 bit (generally for sizes up to 16k bits)
2) 10 bit (generally for sizes 16k bit - 256k bit)
You have to implement the master mode in software to talk
to the memory chips.
Get the Phillips (I2C patent holder) specification. There
is a link from my web page as well as other I2C resources.
--
Friendly Regards /"\
\ /
Tjaart van der Walt X ASCII RIBBON CAMPAIGN
TakeThisOuTtjaartEraseME
spam_OUTwasp.co.za / \ AGAINST HTML MAIL
|--------------------------------------------------|
| WASP International |
|R&D Engineer : GSM peripheral services development|
|--------------------------------------------------|
| Mobile : RemoveMEtjaart
TakeThisOuTsms.wasp.co.za (160 text chars) |
| http://www.wasp.co.za/~tjaart/index.html |
|Voice: +27-(0)11-622-8686 Fax: +27-(0)11-622-8973|
| WGS-84 : 26¡10.52'S 28¡06.19'E |
|--------------------------------------------------|
1999\01\13@011535
by
James Cameron
|
ryan pogge wrote:
> I am looking at my digi-key catalogue right now at the microchip
> eeproms. I see 2 wire, spi, and 3 wire eeproms... there are so many
> under each of those categories, how do I choose?
Choose one according to the number of wires you have available to talk
to it, and then work out how much data you need to store? Or maybe
there is some other problem with the categorisation that I don't
understand.
If you are recording 200 events using date and time, and you are
encoding the date as a day of year and the time as a minute of day, you
will need nine bits for the day and twelve bits for the time. That's
twenty one bits in total for each event.
There are many other ways of encoding this data, of course.
Personally I would go for sixteen bits for each value, thirty two bits
in total. That makes four bytes by 200 events, or 800 bytes.
--
James Cameron (cameronEraseME
.....stl.dec.com)
OpenVMS, Linux, Firewalls, Software Engineering, CGI, HTTP, X, C, FORTH,
COBOL, BASIC, DCL, csh, bash, ksh, sh, Electronics, Microcontrollers,
Disability Engineering, Netrek, Bicycles, Pedant, Farming, Home Control,
Remote Area Power, Greek Scholar, Tenor Vocalist, Church Sound, Husband.
"Specialisation is for insects." -- Robert Heinlein.
1999\01\14@121951
by
Peter L. Peres
Hello,
I have a small question: What EXACTLY is the copyright and royalty
status on I2C and SPI/Microwire ? There seem to be no direct web
references, but ...
Who pays whom for what when and how, in 20 words, would be very nice to
know imho.
There should be areason for many products using SPI and not I2C so far
(especially if they do not originate in Europe), even if no Motorola
chips are used in them at all.
thank you in advance,
Peter
1999\01\14@132910
by
ryan pogge
what is the difference between 2 wire, 3wire, i2c, and spi/microwire anyway?
I mean when an eeprom is "2 wire" does that mean that it is I2C?
thanks,
Ryan
{Quote hidden}>Hello,
>
> I have a small question: What EXACTLY is the copyright and royalty
>status on I2C and SPI/Microwire ? There seem to be no direct web
>references, but ...
>
> Who pays whom for what when and how, in 20 words, would be very nice to
>know imho.
>
> There should be areason for many products using SPI and not I2C so far
>(especially if they do not originate in Europe), even if no Motorola
>chips are used in them at all.
>
>thank you in advance,
>
> Peter
1999\01\14@134412
by
Barry King
|
> I have a small question: What EXACTLY is the copyright and royalty
> status on I2C and SPI/Microwire ? There seem to be no direct web
> references, but ...
>
> Who pays whom for what when and how, in 20 words, would be very nice to
> know imho.
My understanding is that Philips owns the I2C technology. It
liscenses the tech to chip manufacturers (including MicroChip, I
presume) that incorporate the tech in some some physical product.
As a buyer of the licensed product, you then can use the bus.
It would probably take a intellectual property lawyer to figure out
the legal status of a product that bit-banged I2C on some set of
chips that was not liscensed.
> There should be a reason for many products using SPI and not I2C so far
> (especially if they do not originate in Europe), even if no Motorola
> chips are used in them at all.
You imply that the liscense fees from Philips drive this, which might
be true.
I think its just that the E2PROM market is driven by the largest
volume users. (What market isn't, come to think of it.) So, if cell
phones or auto ignition controllers use Motorola chips, then SPI will
be implemented first and most widely. Xicor, for example, seems to
always have their SPI parts out first, then the I2C ones follow
later, if at all.
There are plenty of good (i.e. cheap and dense) EE PROMS for I2C,
fortunately. MicroChip's own are among the best.
---------------------------------------------------
Barry King
Engineering Manager
NRG Systems "Measuring the Wind's Energy"
EraseMEbarry
nrgsystems.com
"The witty saying has been deleted due to limited EPROM space"
'EEPROM'
1999\10\21@214632
by
harryf
Hi,
I am trying to write and read eeprom 24C16. However it does not work.
Did you ever did it ? I am using 16F84, 4MHz oscillator, SDA to RB7, SCL
to RB6. Using Resistor pull-up to Vcc, 22k in, in SDA and SCL. I think
the circuit is correct. I checked the voltage too.
I followed the instruction in Application Notes AN567 and others,
modified it to run at 16F84. I just write and read 1 byte. However, my
16F84 just read FF.
Do you have any advises about it ? Is the algorithm wrong ? or Should I
buy the new eeprom?
Thanks a lot for your help.
Regards,
Harry
1999\10\25@060344
by
Dr. Imre Bartfai
Hi,
the pull-up should not exceed 4k7, for high-speed connection even 1k.
Regards,
Imre
On Fri, 22 Oct 1999, Harry Febianto wrote:
{Quote hidden}> Hi,
> I am trying to write and read eeprom 24C16. However it does not work.
> Did you ever did it ? I am using 16F84, 4MHz oscillator, SDA to RB7, SCL
> to RB6. Using Resistor pull-up to Vcc, 22k in, in SDA and SCL. I think
> the circuit is correct. I checked the voltage too.
>
> I followed the instruction in Application Notes AN567 and others,
> modified it to run at 16F84. I just write and read 1 byte. However, my
> 16F84 just read FF.
>
> Do you have any advises about it ? Is the algorithm wrong ? or Should I
> buy the new eeprom?
>
> Thanks a lot for your help.
>
> Regards,
> Harry
>
>
1999\10\26@160216
by
Janko
|
Recommended pull-ups are 10k for 100kHz communication, about 2k2 for 400kHz comm
unication. Max. Io(L) for serial EEPROM does not exceed approx. 3mA (see e.g. Mi
crochip 24AAxxx types). If VCC=5V, min. pull-ups are 1k6.
Jan.
"Dr. Imre Bartfai" wrote:
{Quote hidden}>
> Hi,
>
> the pull-up should not exceed 4k7, for high-speed connection even 1k.
> Regards,
> Imre
>
> On Fri, 22 Oct 1999, Harry Febianto wrote:
>
> > Hi,
> > I am trying to write and read eeprom 24C16. However it does not work.
> > Did you ever did it ? I am using 16F84, 4MHz oscillator, SDA to RB7, SCL
> > to RB6. Using Resistor pull-up to Vcc, 22k in, in SDA and SCL. I think
> > the circuit is correct. I checked the voltage too.
> >
> > I followed the instruction in Application Notes AN567 and others,
> > modified it to run at 16F84. I just write and read 1 byte. However, my
> > 16F84 just read FF.
> >
> > Do you have any advises about it ? Is the algorithm wrong ? or Should I
> > buy the new eeprom?
> >
> > Thanks a lot for your help.
> >
> > Regards,
> > Harry
> >
> >
'EEPROM'
1999\12\08@141944
by
Peter Keller
Hi
I'm looking for C-code to read & write a 24LC64B EEPROM.
Any help ?
Peter Keller
1999\12\08@233956
by
Mike M
If my memory serves me correctly, Peter Andersons site has code that will read
24lc32's wich probly could be easily changed to do an lc64 if they are not the s
ame already. There is the c++ version for a pc and an asm version that runs off
a 16c84. somewhere on..
http://www.phanderson.com
good luck
Mike
On Wed, 8 Dec 1999 20:23:04 +0000 Peter Keller <RemoveMEpkellerEraseME
EraseMEDATALINK.CH> wrote:
>Hi
>I'm looking for C-code to read & write a 24LC64B EEPROM.
>Any help ?
>Peter Keller
>
Send someone a cool Dynamitemail flashcard greeting!! And get rewarded.
GO AHEAD! http://cards.dynamitemail.com/index.php3?rid=fc-41
1999\12\09@005917
by
Peter Keller
Thanks
Peter
Mike M schrieb:
> If my memory serves me correctly, Peter Andersons site has code that will rea
d 24lc32's wich probly could be easily changed to do an lc64 if they are not the
same already. There is the c++ version for a pc and an asm version that runs o
ff a 16c84. somewhere on..
{Quote hidden}
'EEPROM'
2000\02\12@200607
by
HŽctor Golia
Need some routines to read or write EEPROM 93C46, apart from those that
are gotten in the MICROCHIP web.
Thank you.
Hector
2000\02\14@061344
by
Philippe
|
At 19:06 12/02/00 -1200, you wrote:
>Need some routines to read or write EEPROM 93C46, apart from those that
>are gotten in the MICROCHIP web.
>
>Thank you.
>
>Hector
Here some code to read [EERead] and write [EEWrite] an 93C46 EEPROM type. The
[EEEnable] and [EEDisable] routine disactive or active the write protection
mechanism.
Code is for a 4Mhz device, depending maximum clock frequency for your EEPROM
and your PIC frequency you will perhaps need to add/delete some nop in the
routines.
This routine use TRIS instruction, so be carreful as it is here TRIS C, main
EEPROM port is SPort.
You may also try this code under UMPS (http://www.vmdesign.com).
Best regards,
Philippe.
+--------------------------------------------------------+
| Virtual Micro Design |
| Technopole Izarbel, |
| 64210 BIDART |
| FRANCE |
| |
| Phone: ++33 559.438.458 Fax: ++33 559.438.401 |
| |
| E-Mail: RemoveMEp.techerTakeThisOuT
spamvmdesign.com |
| URL: http://www.vmdesign.com |
+--------------------------------------------------------+
--------------------
SetDataOut equ %10110001
SPort equ PortC ; Port for HCK, ENB, DIN, DOUT
;----- EEPROM Constants
bHCK equ 1
REnb equ 6
bDout equ 3
bDin equ 5
MaxWriteTime equ 35 ; 35* 256 * 11µS = 98,56mS
EETemp equ $0A
Data2 equ $0D ; EEPROM Constants
Data1 equ $0E
Address equ $0F
;******************************************************************************
; READ Routine for SERIAL EEPROM (64 X 16Bit)
; REGISTER used:
; Data1 -> $0E
; Data2 -> $0D
; Address/Temp -> $0F
; EETemp -> $0A
EERead: movlw SetDataOut ; Set HCK/DOUT/ENB as OUTPUT
tris C
bcf SPort,bHCK ; bHCK = 0
bcf SPort,REnb ; REnb = 0 ROM ACCESS disable
bcf SPort,bDOUT
bsf SPort,REnb
nop
nop
bsf SPort,bHCK
nop
nop
call EEStart
movf Temp,W ; GET Address from Temp register
andlw %00111111 ; it's a 6 bit ADDRESS
iorlw %10000000 ; ADD Read INSTRUCTION to the word
call EERdOut
call EERdIn
movf Data1,W
movwf Data2
call EERdIn
bcf SPort,REnb ; REnb = 0 ROM ACCESS disable
retlw 0
;---------------
EEStart: bcf SPort,bHCK
bsf SPort,Renb
bsf SPort,bDOut
nop
nop
nop
bsf SPort,bHCK
nop
nop
bcf SPort,bHCK
nop
retlw 0
;---------------
EERdOut: bsf SPort,Renb
movwf EETemp
movlw 8
movwf Temp
bcf SPort,bHCK
EERdO_1: bcf SPort,bDOut
rlf EETemp
btfsc STATUS,Cy
bsf SPort,bDOut
nop
nop
bsf SPort,bHCK
nop
nop
nop
bcf SPort,bHCK
decfsz Temp
goto EERdO_1
retlw 0
;---------------
EERdIn: bsf SPort,Renb
movlw 8
movwf Temp
bcf SPort,bHCK
EERdI_1: nop
nop
bsf SPort,bHCK
nop
bcf STATUS,Cy
btfsc SPort,bDIn
bsf STATUS,Cy
rlf Data1
nop
bcf SPort,bHCK
decfsz Temp
goto EERdI_1
retlw 0
;******************************************************************************
; ENABLE, DISABLE and WRITE Routine for SERIAL EEPROM (64 X 16Bit)
; REGISTER used:
; Data1 -> $0E
; Data2 -> $0D
; Address/Temp -> $0F
; EETemp -> $0A
; CounterA -> $1D
; CounterB -> $1E
EEEnable:movlw SetDataOut ; Set HCK/DOUT/ENB as OUTPUT
tris C
bcf SPort,bHCK ; bHCK = 0
bcf SPort,REnb ; REnb = 0 ROM ACCESS disable
bcf SPort,bDOUT
bsf SPort,REnb
nop
nop
bsf SPort,bHCK
nop
nop
bcf SPort,bHCK
call EEStart
movlw %00110000 ; ENABLE WRITE INSTRUCTION
call EERdOut
bcf SPort,REnb ; REnb = 0 ROM ACCESS disable
retlw 0
EEDisable:movlw SetDataOut ; Set HCK/DOUT/ENB as OUTPUT
tris C
bcf SPort,bHCK ; bHCK = 0
bcf SPort,REnb ; REnb = 0 ROM ACCESS disable
call EEStart
movlw %00000000 ; DISABLE WRITE INSTRUCTION
call EERdOut
bcf SPort,REnb ; REnb = 0 ROM ACCESS disable
retlw 0
EEWrite: movlw SetDataOut ; Set HCK/DOUT/ENB as OUTPUT
tris C
bcf SPort,bHCK ; bHCK = 0
bcf SPort,REnb ; REnb = 0 ROM ACCESS disable
bsf SPort,PEnb ; PEnb = 1 PLL ACCESS disable
call EEStart
movf Temp,W ; GET Address from Temp register
andlw %00111111 ; it's a 5 bit ADDRESS
iorlw %01000000 ; ADD WRITE INSTRUCTION to the word
call EERdOut
movf Data2,W ; Get the "HIGH WORD"
call EERdOut
movf Data1,W ; Get the "LOW WORD"
call EERdOut
bcf SPort,REnb ; REnb = 0 ROM ACCESS disable
nop ; NOW, waiting for acknowledge
bsf SPort,bHCK
nop
clrf Temp
bcf SPort,bHCK
nop
bsf SPort,REnb
movlw MaxWriteTime
movwf CounterA
EEWait_1:bsf SPort,bHCK
nop
nop
btfsc SPort,bDIn
goto EEWait_2
nop
bcf SPort,bHCK
nop
decfsz Temp
goto EEWait_1
decfsz CounterA
goto EEWait_1
bcf SPort,REnb ; REnb = 0 ROM ACCESS disable
retlw 1 ; return "1" there is a problem to write the
WORD !!!
EEWait_2:bcf SPort,bHCK
bcf SPort,REnb ; REnb = 0 ROM ACCESS disable
retlw 0 ; return "0", OK.
-------------------- End of ASM
More... (looser matching)
- Last day of these posts
- In 2000
, 2001 only
- Today
- New search...