Searching \ for '%24LC32%' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=24lc32
Search entire site for: '24LC32'.

_Sub string match.
PICList Thread
'[PICLIST] 24LC32A 8pin DIP'
2000\07\20@180533 by Rob R

flavicon
face
Anyone know where to find these that are actually in stock?  Digikey as well as 8 other places are backordered for months.  Microchip wont help me, can anyone else???

Or what is a similar chip that I can use thats still i2c same pinouts to replace this one for around the same price??

Rob

Send someone a cool Dynamitemail flashcard greeting!! And get rewarded.
GO AHEAD! http://cards.dynamitemail.com/index.php3?rid=fc-41

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu>

2000\07\20@234923 by Mitchell D. Miller

picon face
www.ramtron.com has pin for pin replacements for the 24LC65, but I don't
know about the 32 ... might check 'em out.

-- Mitch

{Original Message removed}

'[PICLIST] [EE] 24C32/24LC32 serial eeprom'
2000\07\21@122438 by Rob R

flavicon
face
Sorry if ur getting this twice ignore it...

Anyone know where to find the 24lc32 or 24c32 that are actually in stock?  Digikey as well as 8 other places are backordered for months.  Microchip wont help me,can anyone else???

Or what is a similar chip that I can use thats still i2c same pinouts to replace this one for around the same price??

Rob


Send someone a cool Dynamitemail flashcard greeting!! And get rewarded.
GO AHEAD! http://cards.dynamitemail.com/index.php3?rid=fc-41

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

'[EE]: 24C32/24LC32 serial eeprom (Was [EE] 24C32/2'
2000\07\21@132005 by David Kott

flavicon
face
> Sorry if ur getting this twice ignore it...
>
> Anyone know where to find the 24lc32 or 24c32 that are actually in stock?
Digikey as well as 8 other places are backordered for months.  Microchip
wont help me,can anyone else???
>
> Or what is a similar chip that I can use thats still i2c same pinouts to
replace this one for around the same price??
>
>  Rob
>
>

A findchips.com search shows that this distributor has some....


http://www.americaii.com/newweb/search.cfm

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

2000\07\21@140454 by Rob R

flavicon
face
Would anyone know if the 24c64 (64k version of the 24c32) would still use the same i2c commands?  My software reads bytes from a 24lc32 but since it uses 16bit address it should be able to read addresses up to 65535.  You think it would work the same if i switched the 24c32 with a 24c64?

Rob

On Fri, 21 Jul 2000 13:17:50 -0400 David Kott <.....dkottKILLspamspam@spam@TESTPROD.COM> wrote:
{Quote hidden}

Send someone a cool Dynamitemail flashcard greeting!! And get rewarded.
GO AHEAD! http://cards.dynamitemail.com/index.php3?rid=fc-41

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

2000\07\21@144235 by Spehro Pefhany

picon face
At 01:17 PM 7/21/00 -0400, you wrote:
>
>http://www.americaii.com/newweb/search.cfm

They are a gray market dealer, not an authorized distributor.

Any port in a storm, I suppose.

Perhaps we need a new tag for these issues [PA] for purchasing
agent, at least until the current shortage passes, which it will,
as surely as day follows night.

Best regards,

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..."            "The Journey is the reward"
speffspamKILLspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

2000\07\21@150903 by Chris Carr

flavicon
face
If I have got this posting wrong I appologise in advance. My first posting
to the list.

You should have no problems using a 24C64 instead of a 24C32 providing you
have followed the rules regarding the top 4 bits which should be held at 0
you will then be addressing only the bottom 32k of the memory space (for the
full address space of the 24C64 you hold the top 3 bits at 0) Fig 5-2 in the
24LC64 datasheet (page 6) refers.

If you fancy wasting even more memory u could substitute a 24LC128 or go
into MxxxxxxxT memory wastage mode and substitute a 24LC256.

The other alternative (which requires a program change) is to use a couple
of 24LC16, one with chip select A0 set to 0 and the other set to 1 then
toggle that chip select bit instead of Address bit A11.


{Original Message removed}


'[PICLIST] PIC: (not) talking to 24LC32'
2000\10\06@090812 by John Walshe
flavicon
face
Hi Folks,
   I don't often post but this one has me beaten. I'm simply connecting a
24LC32 to a 17C44 RB2(SDA) and RB3(SCL). I have a pullup resistor on SDA and
my waveforms appear to be correct. However I'm not having success.

Does anyone out there have any C code (preferably Hitech) which could help
me out of this bind.

The problem that I see is that I appear to have no response from the
24LC32 - not even an ack to the command byte.
I put a stop before the start just in case it might be in an unknown state
beforehand - but no joy.

Any advice welcome.

Thanks in advance
John Walshe

PS yes it has power and no it is not dead (I've already replaced it once !)

***************************************************************
.....John.WalsheKILLspamspam.....inpactmicro.com

INPACT MICROELECTRONICS (Irl) Ltd
WWW.INPACTMICRO.COM
***************************************************************

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


'[PICLIST] (not) talking to 24LC32'
2000\10\06@094204 by Michael Rigby-Jones

flavicon
face
Are you sure you are addressing the device correctly?   Check the state of
the address pins on the eeprom and ensure this ties with the slave address
you are actually sending.

Mike

> {Original Message removed}

'[PIC]: 24LC32 problems'
2000\10\09@052030 by John Walshe

flavicon
face
Hi guys,
   it would appear that the piclist is exhibiting the same problem as my
24LC32 - no responses! (ok I got one but I was hoping for more)

If you have ever connected this device to a pic (in my case a 17C44) you may
be able to help. I'm using two pins RB2,RB3, the 24LC32 hardware address is
0 (a1,a2,a3 tied low) and WP is also tied low . Although my waveform appears
correct I do not see the 24LC32 acknowledging.

Maybe I'm incorrectly interpreting what I see:

I send a Stop bit, Start bit, Commandbyte = 0xA0; extra clock for the
acknowledge bit.
Now before I send the extra clock I set the pic SDA pin as input wait a
short delay (~ 2uS) and then give the clock pulse. However the SDA line does
not float high at all (as I expect) before the clock pulse - it is low all
the time.

What I expected to see was the SDA float high and then get pulled low by the
24LC32 when the extra pulse arrives. Am I wrong.

I think I have all bases covered but it still doesn't work so there is
something I'm missing so any comments at all would be welcome.

Alternatively if someone has code that they know works (Hitech C preferably)
perhaps I could try that.

Looking forward to some replies

John
***************************************************************
EraseMEJohn.Walshespam_OUTspamTakeThisOuTinpactmicro.com
WWW.INPACTMICRO.COM
***************************************************************

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


2000\10\09@063036 by Michael Rigby-Jones

flavicon
face
{Quote hidden}

Yes.  AFAIK, if the device isn't acknowedging, the slave will release the
data on the rising edge of your acknowledge clock pulse.  Have you continued
after the ack to see if you can read.write etc?

> I think I have all bases covered but it still doesn't work so there is
> something I'm missing so any comments at all would be welcome.
>
> Alternatively if someone has code that they know works (Hitech C
> preferably)
> perhaps I could try that.
>
Are you using the I2C code included in the samples directory with HiTech?
If so, it usualy works, but there is a potential bug in the code in that it
modifies a ports TRIS bits to set the pin high/low but it does not explicity
set the pins PORT bit, which can be changed if a read-modify-write operation
is performed on the PORT when a bit is set for input.

{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


2000\10\09@074758 by John Walshe

flavicon
face
Yes.  AFAIK, if the device isn't acknowedging, the slave will release the
data on the rising edge of your acknowledge clock pulse.  Have you continued
after the ack to see if you can read.write etc?

>>Yes I have continued with both a Write byte and also a Read byte  but the
output from the LC32 is always low irrespective of what I had written into
that location previously.



Are you using the I2C code included in the samples directory with HiTech?
If so, it usualy works, but there is a potential bug in the code in that it
modifies a ports TRIS bits to set the pin high/low but it does not explicity
set the pins PORT bit, which can be changed if a read-modify-write operation
is performed on the PORT when a bit is set for input.

>> Actually I'm not because as I understood from the data sheets the 24LC32
doesn't conform fully to the I2C spec - if however you think it would work
I'll swap over. What I am using at the momentis some code that I found for
the 24LC01 written by Cameron Pearce.

John

***************************************************************
RemoveMEJohn.WalsheTakeThisOuTspaminpactmicro.com

WWW.INPACTMICRO.COM
***************************************************************

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


2000\10\09@083016 by Michael Rigby-Jones

flavicon
face
www.ozemail.com.au/~dljones/pic.htm has some general purpose I2C
routines written in HiTech C.

Mike

> {Original Message removed}

2000\10\09@090727 by Olin Lathrop

flavicon
face
>     it would appear that the piclist is exhibiting the same problem as my
> 24LC32 - no responses! (ok I got one but I was hoping for more)

I can't say why others didn't answer, but I didn't remember off the top of
my head what a 24LC32 is.  Since you didn't even include even a three word
description, I deleted the message and went on.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, spamBeGoneolinspamBeGonespamcognivis.com, http://www.cognivis.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


2000\10\09@133622 by John Walshe

flavicon
face
Hi Michael,
Thanks for the help - I used the Hitech sample functions and now I'm
getting the acknowledge sequence and data back when I do a read ( a major
improvement). The only problem is that the read data and written data are
different! The commands a hand entered via a windows i/f to the pic so the
24LC32 has plenty of time to complete the write.
The command sequence appears correct and I get the acks as expected - any
further ideas.
John
***************************************************************
TakeThisOuTJohn.WalsheEraseMEspamspam_OUTinpactmicro.com

WWW.INPACTMICRO.COM
***************************************************************

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


2000\10\10@030044 by ISO-8859-1?Q?Ruben_J=F6nsson?=

flavicon
face
Date sent:              Mon, 9 Oct 2000 10:16:22 +0100

Send reply to:          pic microcontroller discussion list <<RemoveMEPICLISTspamTakeThisOuTMITVMA.MIT.EDU>

From:                   "John Walshe @Inpact" <<John.WalsheEraseMEspam.....INPACTMICRO.COM>

Subject:                [PIC]: 24LC32 problems

To:                     EraseMEPICLISTspamMITVMA.MIT.EDU<italic>


</italic><color><param>7F00,0000,0000</param>> Hi guys,

{Quote hidden}

</color>Is it really necessary to send a stop bit right before a start bit?
Isn't the startbit itself a guarantee that the device will move into
a known state?


<color><param>7F00,0000,0000</param>> acknowledge bit. Now before I send the extra clock I set the pic SDA

{Quote hidden}

</color>It should be pulled high by a pull-up resistor, not floating high.


<color><param>7F00,0000,0000</param>> I think I have all bases covered but it still doesn't work so there is

{Quote hidden}

==============================
Ruben Jvnsson
AB Liros Elektronik
Box 9124, 200 39 Malmv, Sweden
TEL INT +46 40142078
FAX INT +46 40947388
RemoveMErubenspam_OUTspamKILLspampp.sbbs.se
==============================

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics




2000\10\10@052436 by John Walshe

flavicon
face
Ruben,
   You probably missed the first message in which I stated that the SDA line had a pullup resistor.
The reason for the additional stop bit is that it was recommended by Microchip as "good practice", in case any glitches on the lines put the device into an unknown state - the stop bit will always be recognised therefore putting the device into a known state.
John
***************************************************************
RemoveMEJohn.WalsheTakeThisOuTspamspaminpactmicro.com

INPACT MICROELECTRONICS (Irl) Ltd
21A Pouladuff Road,
Cork,
Ireland,
Tel: +353 21 4318296
Fax: +353 21 4318980
WWW.INPACTMICRO.COM
***************************************************************

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics




2000\10\10@064019 by ISO-8859-1?Q?Ruben_J=F6nsson?=

flavicon
face
Date sent:              Tue, 10 Oct 2000 10:16:46 +0100
Send reply to:          pic microcontroller discussion list <EraseMEPICLISTspamspamspamBeGoneMITVMA.MIT.EDU>
From:                   "John Walshe @Inpact" <RemoveMEJohn.WalsheKILLspamspamINPACTMICRO.COM>
Subject:                Re: [PIC]: 24LC32 problems
To:                     PICLISTSTOPspamspamspam_OUTMITVMA.MIT.EDU

> Ruben,
>     You probably missed the first message in which I stated that the
>     SDA line had a pullup resistor.

Ok. Is it low enough? Any change if You slow down the communication?
Maybe 2ms instead of 2us delay, just to see if it works. When I have
problems like this I always slow down everything as much as possible
just to see that there isn't any capacitive load holding the pin low.

You could drive it staticly from an emulator or even debounced
switches to see that You get what You expect on the SDA line.

> The reason for the additional stop bit is that it was recommended by
> Microchip as "good practice", in case any glitches on the lines put
> the device into an unknown state - the stop bit will always be
> recognised therefore putting the device into a known state. John

Meaning the device can always recognize the stop bit but not the
start bit. Perhaps because the device can hold the SDA low making it
impossible for the master to initiate a start condition (SDA can't be
set high before SCL is set low), but the SCL can always be set high
by the master. Ok, I got it.

When I first put together my I2C routines (for a 24LC16B) I had
problems with read-modify-write due to an interrupt routine updated
the port just after the I2C had set the SDA low but before I had
trised it as an output.


{Quote hidden}

==============================
Ruben Jvnsson
AB Liros Elektronik
Box 9124, 200 39 Malmv, Sweden
TEL INT +46 40142078
FAX INT +46 40947388
KILLspamrubenspamBeGonespampp.sbbs.se
==============================

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics




2000\10\10@124126 by John Walshe

flavicon
face
Hi guys,
   I got it going at last. The last of my problems was how the stop bit was
being generated by the sample code. When I exploded the view on the logic
analyser around the stop bit I saw that the SCL was going high  just before
SDA was brought low in preparation for the stop bit. This effectively was a
Start condition which confused the 24LC32 and thus the writes did not
happen.
Different code is used in the read 'cos the 17C44 generates the ack in this
case.

Thanks for all your help, each comment served to discount something or
confirm I was on the right track.
Best regards,
John
***************************************************************
EraseMEJohn.WalshespamEraseMEinpactmicro.com

WWW.INPACTMICRO.COM
***************************************************************

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics





'[PIC]: PIC16F87x to 24LC32 using page reads/writes'
2001\03\03@125453 by Glenn Mitchell
flavicon
face
I want to use a 16F876 with a 24LC32 (or 24LCxxx).  I have quite a few
example routines showing page read/writes using bit-bang methods.  And I
have one using hardware I2C with everything but page read/writes.  I have
gone through the archives and I have not found anything using hardware I2C
page read/writes.  Does anyone have example code?  On the bit-bang code,
page reads are done by sending consecutive ACKs instead of STOP.  How is
this done with hardware I2C?  Thanks.

Glenn Mitchell.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\03\03@190235 by Peter Anderson

flavicon
face
See the SSPCON2 register in RAM bank 1.

Set the ackdt bit to the appropriate state.
Set acken and loop until it is clear.

Peter H. Anderson, http://www.phanderson.com, pha(a)phanderson.com



Peter H. Anderson, @spam@pha@spam@spamspam_OUTphanderson.com, http://www.phanderson.com
Sign up for Free-for-Life E-mail at http://www.Africana.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\03\05@001555 by Glenn Mitchell

flavicon
face
Thanks.  OK, you use NO_ACK for byte reads and ACK for page reads.

Glenn Mitchell.

----- Original Message -----
From: "Peter Anderson" <spamBeGonekz3kspamKILLspamafricana.com>
To: <.....gmitchspam_OUTspam101FREEWAY.COM>; <TakeThisOuTpiclist.....spamTakeThisOuTmitvma.mit.edu>
Sent: Saturday, March 03, 2001 4:00 PM
Subject: Re: [PIC]: PIC16F87x to 24LC32 using page reads/writes


{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\03\05@150628 by Mike Mansheim

flavicon
face
> Thanks.  OK, you use NO_ACK for byte reads and ACK for page reads.

Sort of.  At the risk of being obtuse and providing more information than
was asked for:
These devices have a page write, but don't exactly have a page read.
What you can do is read bytes consecutively without repeating the start
and send device address operation for each byte.  This is done by acking
each byte as it is received - the internal address pointer in the EEPROM
is automatically incremented.  After the last byte that you want, send a
no_ack and then the stop.  That is why a no_ack is required for reading
a single byte.  This also means that you can read the entire contents of
the EEPROM is a single start/stop operation.
Mr. Anderson pointed how to do the acking and no_acking with the MSSP
hardware - I just wanted to make it clear that you don't just send an
ack and then you'll automatically receive a "page" of bytes.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\03\06@203707 by Glenn Mitchell

flavicon
face
----- Original Message -----
From: "Mike Mansheim" <.....Michael_J_MansheimspamRemoveMEGRACO.COM>
To: <RemoveMEPICLISTspamspamBeGoneMITVMA.MIT.EDU>
Sent: Monday, March 05, 2001 12:01 PM
Subject: Re: [PIC]: PIC16F87x to 24LC32 using page reads/writes


> > Thanks.  OK, you use NO_ACK for byte reads and ACK for page reads.
>
> Sort of.  At the risk of being obtuse and providing more information than
> was asked for:
Not at all.  All help is welcome.

{Quote hidden}

Gotcha.  It is a consecutive read not a page read.  Thanks for your help.  I
should have some code together tonight.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamBeGonelistserv@spam@spamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body



'[EE] Calculate the last location of 24LC32 eeprom'
2008\11\18@145400 by Stefano Vanzo
flavicon
face
Hi
Stupid question, that I don't find on the datasheet.

How do I calculate the last location in the eeprom.
Hi and Low address.

datasheet say's:
24LC32 is a 4K x 8 (32K bit)

I think the first address is HI-0x00 LOW-0x00

last address I would calculate:

(4 x 1024) - 1 = 4095 ->  HI-0x0F  LOW-0xFF

is this correct?

Stefano Vanzo

2008\11\18@162226 by Philip Pemberton

face
flavicon
face
Stefano Vanzo wrote:
> How do I calculate the last location in the eeprom.
> Hi and Low address.
>
> datasheet say's:
> 24LC32 is a 4K x 8 (32K bit)

Yep -- (32 x 1024) bits, or ((32 x 1024) / 8) = 4096 bytes = 4Kbytes.

> I think the first address is HI-0x00 LOW-0x00

That's right.

> last address I would calculate:
>
> (4 x 1024) - 1 = 4095 ->  HI-0x0F  LOW-0xFF

Exactly right. 4096 bytes total, minus 1 (address 0x000 is the first
addressable byte), which is address 4095. 4095 in hex is 0xFFF, which means
the high byte is 0x0F, and the low byte is 0xFF.

--
Phil.
TakeThisOuTpiclistspamspamphilpem.me.uk
http://www.philpem.me.uk/

2008\11\18@162548 by olin piclist

face picon face
Stefano Vanzo wrote:
> How do I calculate the last location in the eeprom.
> Hi and Low address.
>
> datasheet say's:
> 24LC32 is a 4K x 8 (32K bit)

4096 - 1 = 4095 = FFFh

********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2008\11\18@164720 by Stefano Vanzo

flavicon
face
Thanks


Philip Pemberton ha scritto:
{Quote hidden}


'[SX] how to read and write to eeprom 24LC32A?'
2009\01\08@170047 by eagletalontimn/a
flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eagletalontim wrote:

I just got my eeprom chips in today from Parallax and I cannot find any documentation on them on how to hook them up or to read/write to them :(  I need help getting started please :)
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\08@174629 by JonnyMacn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote:

You're kidding, right?  Somehow you are able to use the Internet to post questions here but not locate information about the 24LC32?... that's funny.  There's this little company out here in California called Google -- you might might want to look into them.  :tongue:

I use EEPROMs in a lot of projects; the framework I've attached works fine with the 24LC32.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680#m318694
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\08@175245 by JonnyMacn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote:

This will help, too: http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol8/col/nv145.pdf
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680#m318695
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\08@183230 by eagletalontimn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eagletalontim wrote:

Sorry if they are extreme newbie questions, but I really could not find any information about how to read and write to it.  I did find the chip in microchips.com and found the data sheet, but there was nothing I could understand to help me read and write to it.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680#m318704
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\08@195640 by JonnyMacn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote:

All kidding aside, you really should spend a few minutes learning to use Google.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680#m318728
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\09@082039 by daveheinn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, davehein wrote:

eagletalontim,
I think your request is reasonable for this forum.  Look at the sticky threads at the top of the SX forum.  The thread labeled "Best SX Threads ..." has lots of valuable information posted by others.  There are several posts related to using EEPROMs.  The sticky thread is located at http://forums.parallax.com/forums/default.aspx?f=7&m=182809 .

I did some work with EEPROMs a couple of years ago.  I spent a lot of time searching for information on the internet using AltaVista (I prefer it over Google).  I downloaded the data sheet for the EEPROM and studied it.  I couldn't get my code to work until someone on the forum pointed out that there was sample code in the SX tutorial book for an I2C interface.  I hadn't made the connection that a serial EEPROM device uses the I2C protocol.  I got my code working within hours after getting that valuable information.

Good luck on your project.  Please continue to post any questions you might have.

Dave
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680#m318819
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\09@164413 by eagletalontimn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eagletalontim wrote:

thanks for the links :)   I am finally able to write to the eeprom and can read back information that is stored using the program sent above.  A few things I still have a slight misunderstanding of is erasing the data on a certain address.  I tried putting PUT_EE eeAddr, "" and it did not erase what was put there.  Also....If I store a word variable say "1234" to address 0, what would be the next storage address?

I know I will probably be told to Google it, but 90% of the time, my searches come up with things that are not exactly what I am looking for and they are not coded in SX/B.  I am still learning the SX/B language so I have to ask questions to help me get farther.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680#m318923
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\09@165330 by PJ Allenn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, PJ Allen wrote:

There is definitely an I2C example in SX/B Help.

The address following Address 0?  It's Address 1.

An address can only hold a Byte, 8 bits.  A Word is two Bytes, 16 bits.  So, you have to break that into two Bytes (highbyte, lowbyte) and store each in a separate Address.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680#m318929
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\09@171140 by eagletalontimn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eagletalontim wrote:

hmmm.  I am still having troubles with it.  It must be something in my code.  Here is what I have :

[CODE]DEVICE          SX28, OSCXT2, TURBO, STACKX, OPTIONX
FREQ            4_000_000
' -------------------------------------------------------------------------
' IO Pins
' -------------------------------------------------------------------------
LcdTx                VAR        RA.2                        ' LCD serial connection
SDA             PIN     RA.0 INPUT                    ' pull-up with 4.7K
SCL             PIN     RA.1 INPUT                    ' pull-up with 4.7K
' -------------------------------------------------------------------------
' Constants
' -------------------------------------------------------------------------
LcdBaud                CON        "T19200"                ' or T2400, or T9600
LcdBkSpc        CON     $08                    ' move cursor left
LcdRt           CON     $09                    ' move cursor right
LcdLF           CON     $0A                    ' move cursor down 1 line
LcdCls          CON     $0C                    ' clear LCD (need 5 ms delay)
LcdCR           CON     $0D                    ' move pos 0 of next line
LcdBLon         CON     $11                    ' backlight on
LcdBLoff        CON     $12                    ' backlight off
LcdOff          CON     $15                    ' LCD off
LcdOn1          CON     $16                    ' LCD on; no crsr, no blink
LcdOn2          CON     $17                    ' LCD on; no crsr, blink on
LcdOn3          CON     $18                    ' LCD on; crsr on, no blink
LcdOn4          CON     $19                    ' LCD on; crsr on, blink on
LcdLine1        CON     $80                    ' move to line 1, column 0
LcdLine2        CON     $94                    ' move to line 2, column 0
SlaveWr         CON     $A0                        ' for EEPROMs
SlaveRd         CON     SlaveWr | 1
Ack             CON     0
Nak             CON     1
EE_LAST                CON        $0FFF                        ' for 24LC32
' -------------------------------------------------------------------------
' Variables
' -------------------------------------------------------------------------
text                VAR        Word temp1                VAR        Byte                        ' subroutine work vars
temp2                VAR        Byte
temp3                VAR        Byte
temp4                VAR        Byte
temp5                VAR        Byte
i                VAR        Byte flags           VAR     Byte
ackNak         VAR     flags.0                 ' for I2C routines
i2cMulti        VAR        flags.1                        ' for I2C write eeAddr                VAR        Word
eeOut                VAR        Byte
eeIn                VAR        Byte tmpB1                VAR        Byte                        ' for subs/funcs
tmpB2                VAR        Byte
tmpB3                VAR        Byte
tmpW1                VAR        Word
' =========================================================================
 PROGRAM Start
' =========================================================================

' -------------------------------------------------------------------------
' Subroutine Declarations
' -------------------------------------------------------------------------
WAIT_MS                SUB        1, 2                        ' delay in milliseconds
LCD_OUT                SUB        1, 2                        ' send byte {+ count} to LCD
print                SUB        3, 4                        ' send string to LCD
clear                SUB        1, 2
EE_WAIT                SUB        0                        ' wait for EE to be ready
PUT_EE          SUB     3, 4                    ' write byte(s) to EEPROM
GET_EE          FUNC    1, 2                        ' read byte from EEPROM
GET_EE2                FUNC        2, 2                        ' read word from EEPROM
' I2C routines used by subs/funcs above
I2C_START       SUB     0                       ' generate I2C Start
I2C_STOP        SUB     0                       ' generate I2C Stop
I2C_OUT         SUB     1, 1                    ' write byte to SDA
I2C_IN          FUNC    1, 1                    ' read byte from SDA
' -------------------------------------------------------------------------
' Program Code
' -------------------------------------------------------------------------
Start:
 PLP_A = %0111                                        ' pull up unused pins
 PLP_B = %00000000
 PLP_C = %00000000
 HIGH LcdTx
 WAIT_MS 100                                        ' let LCD initialize
 LCD_OUT LcdOn1                                ' no cursor or blink
 LCD_OUT LcdCls                                ' clear the LCD
 LCD_OUT LcdLine1
 eeAddr = 0
 eeIn = GET_EE eeAddr
 WAIT_MS 50
 if eeIn <> 0 THEN
   print "Data Exists", 1, 1
   WAIT_MS 2000
   print "Data is : ", 2, 1
   print eeIn, 2, 11
   PUT_EE eeAddr, $FF
 ELSE
   print "Saving Data", 2, 3
   PUT_EE eeAddr, 12
   WAIT_MS 2000
   clear 2
   print "Retreiving...", 2, 2
   eeIn = GET_EE eeAddr
   WAIT_MS 2000
   clear 2
   print eeIn, 2, 1
 ENDIF
Main:
 WAIT_MS 500
 print eeIn, 2, 11
 GOTO Main

' -------------------------------------------------------------------------
' Subroutine Code
' -------------------------------------------------------------------------
' Use: WAIT_MS milliseconds {, multiplier }
' -- multiplier is optional
WAIT_MS:
 temp1 = __PARAM1                              ' get milliseconds
 IF __PARAMCNT = 1 THEN                        ' if no multiplier
   temp2 = 1                                   '   set to 1
 ELSE                                          ' else
   temp2 = __PARAM2                            '   get multiplier
 ENDIF
 IF temp1 > 0 THEN                             ' no delay if either 0
   IF temp2 > 0 THEN
     PAUSE temp1 * temp2                       ' do the delay
   ENDIF
 ENDIF
 RETURN
' -------------------------------------------------------------------------
LCD_OUT:
 temp1 = __PARAM1                                ' save the byte
 SEROUT LcdTx, LcdBaud, temp1                ' transmit to LCD
 RETURN
' -------------------------------------------------------------------------
clear:
 temp2 = __PARAM1
 print "                ", temp2, 1
 RETURN

print:
 IF __PARAMCNT = 3 THEN
   text = __PARAM1                            ' get string offset
   temp3 = __PARAM2
   temp4 = __PARAM3
 ELSE
   text = __WPARAM12                            ' get string offset
   temp3 = __PARAM3
   temp4 = __PARAM4
 ENDIF

 LCD_OUT LcdLine1
 IF temp3 = 1 THEN
   LCD_OUT LcdLine1
 ELSEIF temp3 = 2 THEN
   LCD_OUT LcdLine2
 ENDIF
 FOR temp5 = 1 TO temp4
   LCD_OUT LcdRt
 NEXT
 LCD_OUT LcdBkSpc
 
 DO
   READ text, temp5                            ' read a character
   IF temp5 = 0 THEN EXIT                      ' if 0, string complete
   SEROUT LcdTx, LcdBaud, temp5
   INC text                                   ' point to next character
 LOOP
 RETURN
SUB EE_WAIT
 DO  
   I2C_START
   I2C_OUT SlaveWr
 LOOP UNTIL ackNak = Ack
 ENDSUB
SUB PUT_EE
 IF __PARAMCNT = 3 THEN                        ' write one byte
   tmpW1 = __WPARAM12
   tmpB1 = __PARAM3
   i2cMulti = 0
 ELSE
   tmpW1 = __WPARAM12
   tmpB1 = __PARAM3
   tmpB2 = __PARAM4
   i2cMulti = 1
 ENDIF
 I2C_START
 I2C_OUT SlaveWr                               ' send slave ID
 I2C_OUT tmpW1_MSB                             ' send address, high byte
 I2C_OUT tmpW1_LSB                             ' send address, low byte
 I2C_OUT tmpB1                                 ' send data byte
 IF i2cMulti = 1 THEN
   I2C_OUT tmpB2                                ' send second data byte
 ENDIF
 I2C_STOP                                      ' finish
 '{$IFNDEF NOEEWAIT}
 DO                                            ' let write cycle finish
   I2C_START
   I2C_OUT SlaveWr
 LOOP UNTIL ackNak = Ack
 '{$ENDIF}
 ENDSUB
' -------------------------------------------------------------------------
FUNC GET_EE
 tmpW1 = __WPARAM12
 I2C_START
 I2C_OUT SlaveWr                               ' send slave ID
 I2C_OUT tmpW1_MSB                             ' send address, high byte
 I2C_OUT tmpW1_LSB                             ' send address, low byte
 I2C_START
 I2C_OUT SlaveRd
 tmpB1 = I2C_IN Nak
 I2C_STOP
 RETURN tmpB1
 ENDFUNC
' -------------------------------------------------------------------------
' Use: wordVal = GET_EE2 address
' -- reads [Little-Endian] 'wordVal' from EEPROM location 'address'
' -- 'address' is a word (0 to 65535)
FUNC GET_EE2
 tmpW1 = __WPARAM12
 I2C_START
 I2C_OUT SlaveWr                               ' send slave ID
 I2C_OUT tmpW1_MSB                             ' send address, high byte
 I2C_OUT tmpW1_LSB                             ' send address, low byte
 I2C_START
 I2C_OUT SlaveRd
 tmpW1_LSB = I2C_IN Ack
 tmpW1_MSB = I2C_IN Nak
 I2C_STOP
 RETURN tmpW1
 ENDFUNC
' -------------------------------------------------------------------------
' Use: I2C_START
' -- generates I2C start condition on SDA/SCL pins
SUB I2C_START
 I2CSTART SDA
 ENDSUB
' -------------------------------------------------------------------------
' Use: I2C_STOP
' -- generates I2C stop condition on SDA/SCL pins
SUB I2C_STOP
 I2CSTOP SDA
 ENDSUB
' -------------------------------------------------------------------------
SUB I2C_OUT
 I2CSEND SDA, __PARAM1, ackNak
 ENDSUB
' -------------------------------------------------------------------------
FUNC I2C_IN
 ackNak = __PARAM1.0
 I2CRECV SDA, __PARAM1, ackNak
 ENDFUNC[/CODE]
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680#m318934
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\10@060922 by eagletalontimn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eagletalontim wrote:

There must be something wrong with my PUT_EE sub.   I cannot get the print sub it to display a simple number like 12 unless I add quotations around it.  I am wanting to save a byte variable first, then be able to pull it from the eeprom and run it through some math function and then display it on the LCD.  The reason I made the print sub is so that when I have another chip talking to the display chip, I can send 3 parameters to it and it will know what line and character to put the text on.  It just makes it easier for me that way.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680#m319013
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\10@063900 by PJ Allenn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, PJ Allen wrote:

"I>

The Serial LCD understands everything you send it to be ASCII data; sometimes it's character code (letters, numerals, etc.), sometimes it's control code (line_feed, carriage return, etc.)[/color>

SEROUT'ing a decimal 12 (which is really a $0C), the SX knocks out a $0C, a control code for Form Feed.  SEROUT'ing a "12" makes the SX knock out the character codes for the numerals inside the quote_marks, a $31 and then a $32 for a numeral 1 and a numeral 2.
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680#m319019
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\10@065222 by eagletalontimn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eagletalontim wrote:

ok, that makes a little more sense :)  I am still a little confused on how the PUT_EE sub works.

Here is the code :

[CODE]SUB PUT_EE
 tmpW1 = __WPARAM12
 tmpB1 = __PARAM3
 I2C_START
 I2C_OUT SlaveWr                               ' send slave ID
 I2C_OUT tmpW1_MSB                             ' send address, high byte
 I2C_OUT tmpW1_LSB                             ' send address, low byte
 I2C_OUT tmpB1                                 ' send data byte
 I2C_STOP                                      ' finish
 '{$IFNDEF NOEEWAIT}
 DO                                            ' let write cycle finish
   I2C_START
   I2C_OUT SlaveWr
 LOOP UNTIL ackNak = Ack
 '{$ENDIF}
 ENDSUB[/CODE]
Now, I have tried to put PUT_EE eeAddr, 12 and it prints on the LCD "<<".  If I put PUT_EE, eeAddr, "12" it puts "11" on the LCD.  I am guessing it is something wrong with my print sub then?  I have been searching the help files and the forum and still cannot quite grasp what is going on.

Here is my updated "print" sub :

[CODE]print:
 IF __PARAMCNT = 3 THEN
   text = __PARAM1                            ' get string offset
   temp3 = __PARAM2
   temp4 = __PARAM3
   tmpB1 = 2
 ELSE
   text = __WPARAM12                            ' get string offset
   temp3 = __PARAM3
   temp4 = __PARAM4
   tmpB1 = 3
 ENDIF

 LCD_OUT LcdLine1
 IF temp3 = 1 THEN
   LCD_OUT LcdLine1
 ELSEIF temp3 = 2 THEN
   LCD_OUT LcdLine2
 ENDIF
 FOR temp5 = 1 TO temp4
   LCD_OUT LcdRt
 NEXT
 LCD_OUT LcdBkSpc
 
 IF tmpB1 = 3 THEN
   DO
     READ text, temp5                     ' read a character
     IF temp5 = 0 THEN EXIT                      ' if 0, string complete
     SEROUT LcdTx, LcdBaud, temp5
     INC text                                   ' point to next character
   LOOP
 ELSE
   DO WHILE tmpB1 > 0
     SEROUT LcdTx, LcdBaud, text
     DEC tmpB1
   LOOP
 ENDIF
 RETURN[/CODE]
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680#m319020
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\10@083700 by eagletalontimn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eagletalontim wrote:

ok, i just found a thread on here that may be what I need but I have no idea how to use the code.  It does not look like it will return anything...

[CODE]Bin16DEC:
' Use: Bin16DEC word
' -- Convert a 16bit binary variable into a decimal value.
'    define BLANK as 00h for BCD nibbles
'    define BLANK as 30h to directly output ASCII
'    to a terminal or LCD.
'    Original versions by Bean (Hitt Consulting) & Michael Chadwick & John Couture
'
' Setup
'    temp       VAR Byte
'    wTemp      VAR Word
'    wDivisor   VAR Word
'    ascDigit   VAR Byte (5)

 IF __PARAMCNT = 1 THEN   ' if parameter is a Byte or Word variable
   wTemp = __PARAM1
 ELSE
   wTemp = __WPARAM12
 ENDIF

 ' fill all locations with zeros
 PUT ascDigit(0), BLANK, BLANK, BLANK, BLANK, BLANK

 ' Loop for first 4 digits
 FOR temp = 0 TO 3
   ' Get divisior for this digit
   LOOKUP temp, 10000, 1000, 100, 10, wDivisor
   ' Increase digit until value < divisor
   DO UNTIL wTemp < wDivisor
     INC ascDigit(temp)
     wTemp = wTemp - wDivisor
   LOOP
 NEXT
 ' Last digit is just units, so just add it
 ascDigit(4) = ascDigit(4) + wTemp_LSB
 RETURN[/CODE]
Having just a RETURN with nothing to follow means that it will not return anything right?  I am basically looking for some way to convert a number variable into a word variable that can be show on the LCD
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680#m319040
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\10@091830 by eagletalontimn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eagletalontim wrote:

well, i am fixing to give up.  Google does not have my answers and I can't seem to understand how others have gotten it to work.  I am so confused on how to use a byte and a word.  From what I understand, a byte is a number 0 - 255, and a word can be a number 0 - 65535.  To pass a byte to a sub or function, you need to grab it with __PARAM# and to pass a word, you need to grab it with __WPARAM12.   Apparently, a byte cannot be shown on an LCD but a word can.  Since a Byte is 0 - 255, each number (2, 5, 5) will have to be saved in different addresses in an eeprom???  I have tried to save the number 12 to the eeprom, but I never get 12 back.  To display the byte that is received back from the eeprom, it will have to be converted to a word which I have no idea how to do.  I have browsed through all the help files and examples and have only found how to either display a full string of text OR display a number.....not both.

I need to be able to....

1 - Save a 0 - 255 number to the eeprom.
2 - Read the number back.
3 - Display the number on the LCD along with some pre-defined text.
4 - Use the number in a few math functions and display the result on the LCD.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680#m319047
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\10@094316 by soshimon/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, soshimo wrote:

@Eagle - might I gently suggest that you start off small and perhaps study a little bit about the architecture of computers, microprocessers, and microcontrollers.  The fact that you are confused about bit/byte/word and storage sizes implies that you might not be as familiar with the architecture of computers to understand whats going on.  It's important to know a little bit about that little chip you are programming.  If you treat it as a black box then everything seems like magic, but once you learn how it "thinks" and "talks" then you can probably figure a lot of these things out on your own and that's always a much better feeling than having your hand held IMHO.  The primary reason you are not finding what you need is because you are asking too broad of a question from google.  Basically you are asking google "what the heck is programming and what is this SX/B thing?"  Of course google is going to give you a bunch of stuff because you asked such a broad question.  The fact is, if you learn a bit more about the architecture you will be in a much better position to ask the question you need to ask to get the answer you want.

That being said, I would start off on in the tutorial section.  Download all the labs.  Read any and all manuals and books that came with your SX/B - there might be something valuable in there.  I know the homework board had a book with it call "What's a Microcontroller" that would be a big help for you as well.  The only thing I can suggest is read, read, read.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680#m319053
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\10@095847 by PJ Allenn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, PJ Allen wrote:

Sometimes you need to walk away and have a pop, blow it off, come back later.

My suggestion is that you get the LCD'ing right, all on its own.  Get comfortable with displaying some CONstants (CON), VARs, or just plug numbers.  Then you can progress to the I2C reading/writing.


You can save 255 in one address, but displaying a number of two or more digits will require parsing, separating, that number's digits and sending each digit's ASCII code.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680#m319057
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\10@105908 by eagletalontimn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eagletalontim wrote:

thanks for the info!  I got up for a bit to cool off and now I have restarted all my code and am working with just the LCD right now.  I will wait for the eeprom later.  After viewing the SEROUT example, I have been able to come up with the ability to put text and variables on the screen at the same time :)  I only have one problem that I cannot figure out.... Anywhere that a character is not defined on the LCD, it puts a \.  On line 1, I have the text "Working..."  but on the display it shows "Working...\\\\\\".  Any ideas what is causing that?

[CODE]DEVICE          SX28, OSCXT2, TURBO, STACKX, OPTIONX
FREQ            4_000_000

' -------------------------------------------------------------------------
' IO Pins
' -------------------------------------------------------------------------
LcdTx                VAR        RA.2                        ' LCD serial connection

' -------------------------------------------------------------------------
' Constants
' -------------------------------------------------------------------------
LcdBaud                CON        "T19200"                ' or T2400, or T9600
LcdBkSpc        CON     $08                    ' move cursor left
LcdRt           CON     $09                    ' move cursor right
LcdLF           CON     $0A                    ' move cursor down 1 line
LcdCls          CON     $0C                    ' clear LCD (need 5 ms delay)
LcdCR           CON     $0D                    ' move pos 0 of next line
LcdBLon         CON     $11                    ' backlight on
LcdBLoff        CON     $12                    ' backlight off
LcdOff          CON     $15                    ' LCD off
LcdOn1          CON     $16                    ' LCD on; no crsr, no blink
LcdOn2          CON     $17                    ' LCD on; no crsr, blink on
LcdOn3          CON     $18                    ' LCD on; crsr on, no blink
LcdOn4          CON     $19                    ' LCD on; crsr on, blink on
LcdLine1        CON     $80                    ' move to line 1, column 0
LcdLine2        CON     $94                    ' move to line 2, column 0 text                VAR        Byte
idx                VAR        Byte                        ' loop counter
line1                VAR        Byte(16)                ' line 1 buffer
line2                VAR        Byte(16)                ' line 2 buffer temp1                VAR        Byte                        ' subroutine work vars
temp2                VAR        Byte
temp3                VAR        Byte
temp4                VAR        Byte
temp5                VAR        Byte


' =========================================================================
 PROGRAM Start
' =========================================================================

' -------------------------------------------------------------------------
' Subroutine Declarations
' -------------------------------------------------------------------------
wait                SUB        1, 2                        ' delay in milliseconds
LCD_OUT                SUB        1, 2                        ' send byte {+ count} to LCD
LCD_STR                SUB        2                        ' send string to LCD
UPDATE_L1        SUB        0                        ' update line 1 of LCD
UPDATE_L2        SUB        0                        ' update line 2 of LCD
' -------------------------------------------------------------------------
' Program Code
' -------------------------------------------------------------------------
Start:
 PLP_A = %0111                                        ' pull up unused pins
 PLP_B = %00000000
 PLP_C = %00000000
 HIGH LcdTx
 wait 100                                        ' let LCD initialize
 LCD_OUT LcdOn1                                ' no cursor or blink
 LCD_OUT LcdCls                                ' clear the LCD
 wait 5
 text = 255
 PUT line1, "Working..."
 PUT line2, "Var :"
Main:
 temp1 = text / 100
 temp2 = __REMAINDER
 temp1 = temp1 + "0"
 PUT line2(6), temp1
 temp1 = temp2 / 10
 temp2 = __REMAINDER
 temp1 = temp1 + "0"
 PUT line2(7), temp1
 temp1 = temp2 + "0"
 PUT line2(8), temp1
 UPDATE_L1
 UPDATE_L2
 wait 1000
 text = text - 1
 if text = 0 then
   text = 255
 endif
 GOTO Main

' -------------------------------------------------------------------------
' Subroutine Code
' -------------------------------------------------------------------------
' Use: WAIT_MS milliseconds {, multiplier }
' -- multiplier is optional wait:
 temp1 = __PARAM1                              ' get milliseconds
 IF __PARAMCNT = 1 THEN                        ' if no multiplier
   temp2 = 1                                   '   set to 1
 ELSE                                          ' else
   temp2 = __PARAM2                            '   get multiplier
 ENDIF
 IF temp1 > 0 THEN                             ' no delay if either 0
   IF temp2 > 0 THEN
     PAUSE temp1 * temp2                       ' do the delay
   ENDIF
 ENDIF
 RETURN
SUB UPDATE_L1
 LCD_OUT LcdLine1
 wait 5
 FOR idx = 0 TO 15
   LCD_OUT line1(idx)                                ' transfer buffer
 NEXT
ENDSUB
SUB UPDATE_L2
 LCD_OUT LcdLine2
 wait 5
 FOR idx = 0 TO 15
   LCD_OUT line2(idx)                                ' transfer buffer
 NEXT
ENDSUB
LCD_OUT:
 temp1 = __PARAM1                                ' char to send
 IF __PARAMCNT = 1 THEN                        ' if no repeats specified
   temp2 = 1                                        ' - set to 1
 ELSE
   temp2 = __PARAM2                                ' - save repeats
 ENDIF
 DO WHILE temp2 > 0
   SEROUT LcdTx, LcdBaud, temp1                ' transmit to LCD
   DEC temp2
 LOOP
 RETURN
' -------------------------------------------------------------------------
' Use: LCD_STR [ string | label ]
' -- "string" is an embedded literal string
' -- "label" is DATA statement label for stored z-String
LCD_STR:
 temp3 = __PARAM1                              ' get string offset
 temp4 = __PARAM2                              ' get string base
 DO
   READ temp4 + temp3, temp5                   ' read a character
   IF temp5 = 0 THEN EXIT                      ' if 0, string complete
   LCD_OUT temp5                                    ' send the byte
   INC temp3                                   ' point to next character
   temp4 = temp4 + Z                           ' update base on overflow
 LOOP
 RETURN[/CODE]
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680#m319080
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\10@115011 by eagletalontimn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eagletalontim wrote:

ok, I got it :)  I changed the LCD_OUT to :

[CODE]LCD_OUT:
 temp1 = __PARAM1                                ' char to send
 IF __PARAMCNT = 1 THEN                        ' if no repeats specified
   temp2 = 1                                        ' - set to 1
 ELSE
   temp2 = __PARAM2                                ' - save repeats
 ENDIF
 DO WHILE temp2 > 0
   IF temp1 = $00 THEN
    SEROUT LcdTx, LcdBaud, " "
   ELSE
    SEROUT LcdTx, LcdBaud, temp1                ' transmit to LCD
   ENDIF
   DEC temp2
 LOOP
 RETURN[/CODE]
Time to get up and do something else before tackling the EEPROM :|
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680#m319088
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\10@124939 by eagletalontimn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eagletalontim wrote:

I thank everyone who helped me understand this better!  I was finally able to display text and variables on the LCD, write to the EEPROM, read from the eeprom and use the data in math formulas :)  I wound up having to redo all the code, but it was well worth it!

One think I found out is that Google does not always have the answer!

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318680#m319105
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

More... (looser matching)
- Last day of these posts
- In 2009 , 2010 only
- Today
- New search...