24lc256 eeprom & picaxe 20x2

westaust55

Moderator
As I see it you have a couple of options/steps:

1. Test the program first on a breadboard with the 40X1 and an EEPROM. Start with the simple code hippy has posted. Verify/prove operation on the breadboard first.

2. Verify if there is a board fault as discussed so far and if so, carefully cut the tracks on the board between the RTC and EEPROM and use a couple of fine wires to reconnect, Then again test the program with the 40X1 and an EEPROM.

3. Insert all of the chips and test one at a time

4. Decide if you are going to make a new PWB/PCB. If so the repeat step 3 on the new board

5. Develop your final datalogger program
 

nick12ab

Senior Member
@TAmeyer

  1. If your computer has a screen-capturing tool, the schematic can then be saved as a PNG image (JPEG not recommended for that sort of thing due to lossy compression) and uploaded so readers don't have to download and open a PDF to view it.
  2. For [code][/code] tags, if you don't want to click 'Go Advanced', you can simply type in the code tags.
  3. If you want to name some tags, use [noparse][/noparse] tags around the tags you want to be displayed rather than implemented.
 

bigjoe

New Member
more on using eight 24LC256 as a solid state data logger with PICAXE-40X1

TAMeyer ... the PCB Express software has a save to file of .sch and .emf format.... no help, but I will make them attachments. I tried the URL that you listed, but had trouble making it work.

nick12ab .... I did a screen shot of the schematic and saved it in the .PNG format, no help; but I have included it as an attachment. I just ran into problem with attaching the .PNG file, the forum says it is too big and I have to re-size it. Also I can not seem to figure out how to attach the parts list. I did make an .emf file of the schematic, but I have not attached it yet.

westaust ... I am doing your suggested options/steps now. I did read the "read me post", but I can not do everything that is suggests.

Right now, all I get back from the 24LC256 is $FFFF. I am trying all the suggested software. I suspect that there is an error on the PWB, so that is what I am looking at for now.
 

Attachments

westaust55

Moderator
@bigjoe,
The comments in post 43 were not specifically aimed at your self, but at "folks" in general as many newcomers do not use the code markers.

Now I have with minor alterations becasaue a have wanted data in my first EEPROM run hippy code and it works. Also with a small text string it will also work:


Code:
#Picaxe 40X1
#Terminal 4800
Pause 2000
SerTxd( "Reset", CR, LF )
HI2cSetup I2CMASTER, %10100100, I2CSLOW, I2CWORD
Pause 1000
HI2cOut 0, ( "Hello" ) 
Do
  Pause 1000
  HI2cIn 0, ( b0, b1, b2, b3, b4 )
  SerTxd( "Read ", b0,b1, b2, b3, b4, CR, LF )
Loop
Which opens the PE terminal window and displays
Reset
Read Hello
Read Hello
Read Hello
Read Hello

... ad infinitum ...
I am sorry but your schematic is ilegible -cannot read pin identification etc.
To try and help you I have included a schematic done with DIPTRACE which includes a 40X1, a DS1307 RTC and 3 EEPROMs as representative of your requirements - but with no programming circuit or back-up battery for the RTC.

Cross check against your schematic and verify if your circuit is right.
If so, then point to point between sockets etc to verify all is correct.
 

Attachments

Last edited:

nick12ab

Senior Member
nick12ab .... I did a screen shot of the schematic and saved it in the .PNG format, no help; but I have included it as an attachment. I just ran into problem with attaching the .PNG file, the forum says it is too big and I have to re-size it. Also I can not seem to figure out how to attach the parts list. I did make an .emf file of the schematic, but I have not attached it yet.
"The forum says it is too big" should be scrapped completely from the forum since it only applies to non-JPG formats BUT what you can do is change the file extension to .JPG which shouldn't automatically convert the image when it is uploaded. Alternatively, a free image hosting site like Picasa could be used.
 

nick12ab

Senior Member
If only folks would read the sticky Read Me First thread at the top of the Active forum area
They may/could also follow the link to the full set of forum control tags
I don't know if it's possible to program the forum to do this, but maybe the forum could be programmed so that during the registration process for new members or when a new member is about to do their first post, it could make the member wait at a screen with the 'Read Me First' and 'Code Tags' sections for five minutes before clicking an 'OK' button which then becomes enabled - also require that they scroll the embedded text window down to the bottom (without telling them to do that) otherwise the timer resets when OK is pressed.
 

westaust55

Moderator
"The forum says it is too big" should be scrapped completely from the forum since it only applies to non-JPG formats BUT what you can do is change the file extension to .JPG which shouldn't automatically convert the image when it is uploaded. Alternatively, a free image hosting site like Picasa could be used.
File size limits apply to all file types to my knowledge including the .JPG format/extension, albeit that there are differeing files size limits.

Rev Ed and many members do not want exceeding large files. From the sticky Read Me First thread at the top of the Active forum:
Welcome to the PICAXE community at www.picaxeforum.co.uk!
:
:
If you attach any image, please make sure it is a small, low resolution file - e.g. don't upload pictures straight off your 6megapixel digital camera - they will be huge files! Images may be moderated before they are publically available.
Those who access the forum through mobile phones and the like do not want to wait for 6MB files to download,
nor do those who have dial-up internet services - such folks are still in existence.

And . . .

Personal preference, but recommendation IS that members DO post their files here.
I regularly come across broken links to other website. People may have all intentions of keeping their website going forever, but things do change and then refernced files are lost and thread become meaningless.
 

nick12ab

Senior Member
For JPG and PDF files, 1MB is allowed but the other file extensions have quite tight file limit restrictions - especially the .BAS extension as many programs can be longer than 19.5KB so I think this should also be increased.
 

bigjoe

New Member
Hippy, westaust55 or anyone that has connections with Rev Ed ....

There is some good code in this thread that I would like to see added to the last page of Vol III of the PICAXE Manuel.

As many suspected all along my problem was the wiring of SCL and SDA on the PWB ....

Have some more code to add:

Code:
 'PICAXE -40X to test eight 24LC256 I2C EEPROM 
'*************************************************************************
init:   'initialization module.
    	hi2csetup i2cmaster, %10100000, i2cslow, i2cword '24LC256 without the B sufix uses word addressing.  Both the programmer and the 24LC256 will take a word as the random address offset.
    	pause 10
    	
    	for b3 = 0 to 3     'for/next loop can only take bytes.
    	for b2 = 0 to 255   'be patient this loop takes a couple of minutes!!!
 	hi2cout [%10100000], w1, (w1) 'put something in the 24LC256; this works.
 	pause 10
 	hi2cout [%10100010], w1, (w1)
	pause 10
	hi2cout [%10100110], w1, (w1)
	pause 10
	next b2
 	next b3
 	'hi2cout [%10100010], w1, (b2,b3) 'this does not work, second byte $FF
	'pause 10	
	hi2cout [%10100100], 0, ("This is to chip 002")
	pause 10
	hi2cout [%10100110], 0, ("This is to chip 003")
	pause 10
	hi2cout [%10101000], 0, ("This is to chip 004")
 	pause 10
 	hi2cout [%10101010], 0, ("This is to chip 005")
	pause 10
	hi2cout [%10101100], 0, ("This is to chip 006")
	pause 10
	hi2cout [%10101110], 0, ("This is to chip 007")
	pause 10
'************************************************************************        
main: 'main module. 
      

	for b3 = 0 to 3
	for b2 = 0 to 255
 	hi2cin [%10100000], w1, (w2)  'this works; addresses 1024 words.
 	pause 10
	hi2cin [%10100010], w1, (w3) 
	pause 10 	
	hi2cin [%10100110], w1, (w4)
	pause 10
 	debug 'DIAGNOSTIC only, remove if this code is to be part of larger program
	next b2
	next b3
 	
	for b2 = 0 to 18
	hi2cin [%10100110], b2, (w4) 'This works, reads at a byte/word
	pause 10
	hi2cin [%10101000], b2, (w5) 
	pause 10
	hi2cin [%10101010], b2, (w6)
	pause 10
	hi2cin [%10101100], b2, (w7)
	pause 10
	hi2cin [%10101110], b2, (w8)
	pause 10
	debug 'DIAGNOSTIC only, remove if this code is to be part of larger program
	next b2
	
	HI2cIn [%10100110], 0, ( b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, b18 ) 'This also works, gets the header.
	
	debug 'DIAGNOSTIC only, remove if this code is to be part of larger program
	stop
Thanks all for the help. Code looks better in color
Joe
 

Attachments

Last edited:

hippy

Ex-Staff (retired)
for b3 = 0 to 3 'for/next loop can only take bytes.
That's not true as FOR-NEXT can work with words. There is the case of "FOR 0 To 65535" which always stays within the FOR-NEXT but in other cases it should work.

'hi2cout [%10100010], w1, (b2,b3) 'this does not work, second byte $FF
It's not clear in what way that does not work.

hi2cout [%10101000], 0, ("This is to chip 004")
While that will work with some I2C Eeprom (including the 24LC256 for which the code is written), something to watch out for is a thing called 'page size', which limits how much can be output in one go. After page size is exceeded further data overwrites the earlier data before the entire page is written into the device.

If this were sent to a device with a 16 byte page size you'd end up with "004s is to chip " written to address $0000-$000F and $0010-$0012 would be left as they were.
 
Last edited:
Top