20x2 - 24LC256 frustration

kirby

New Member
I am trying to read/write a 24LC256 using a 20x2. I have double-check the wiring. (4.7K pull-ups, 20x2 pin 11 to '256 pin 6, 20x2 pin 13 to '256 pin 5, power and ground). I am using the following code:
Code:
hi2csetup i2cmaster, %10100000, i2cfast, i2cword
pause 1000

hi2cout 0, ("hello")

main:
	pause 2000
	hi2cin 0, (b0,b1,b2,b3,b4,b5,b6,b7)
	debug b1
	goto main
However, the debug window only shows zeros.
 
Last edited:

eclectic

Moderator
I am trying to read/write a 24LC256 using a 20x2. I have double-check the wiring. (4.7K pull-ups, 20x2 pin 11 to '256 pin 6, 20x2 pin 13 to '256 pin 5, power and ground). I am using the following code:
snip

However, the debug window only shows zeros.

Welcome to the Forum.

Please can you check your circuit and connections.
I've just run your program using the
AXE091 board, 20X2 and an 24LC256.


e
 

Attachments

kewakl

Senior Member
Note: Using a VARIABLE after DEBUG is not required. The variable field in fthe DEBUG command is for compatibility with older programs. (hth)
Also, what PE version?
 

westaust55

Moderator
Also for your future reference:
1. if you also use other i2c devices of different types, then you need to issue the setup i2cslave command before each new device type is first accessed.
2. when writing multiple bytes of data at one time (called page writing), the EEPROM stores the data in a temp register and then transfers the data to the EEPROM once the data is all received. This takes a short time and it is good practice to have a PAUSE 10 after such writei2c commands
 

kirby

New Member
Solution, of sorts! I was using AXEpad 1.0 on FC11. Your question about the version of PE got me wondering if the compiler AXEpad was using might be the issue. I downloaded the latest compilers, checked their MD5 sums and, well, AXEpad is using the latest. I did try running the compiler standalone. It works great! Seems that there is an issue with AXEpad.

Thanks to all for the suggestions/help.
 

hippy

Ex-Staff (retired)
Apologies for the compiler issue. If the compilers are run standalone they should report their version numbers, for example -

PICAXE-20X2 Enhanced Compiler. Version 1.1
Copyright (c) 1996-2009 Revolution Education Ltd

The latest compilers can replace those in the appropriate "Compiler" sub-folder of AXEpad's home folder where they will automatically be invoked when compiling. Not sure what an "FC11" is, for WinAXEpad and LinAXEpad the compilers can simply be dropped in the folder, for MacAXEpad the bundle has to be opened to get at the folder.
 

kirby

New Member
compiling. Not sure what an "FC11" is, for WinAXEpad
Fedora Core 11, a Linux variant.

The compliers all appear to be Version 1.0.
"PICAXE-20X2 Enhanced Compiler. Version 1.0"
with a file creation date of 2009-05-08. I downloaded them from the website on November 14. Standalone, things work wonderfully. The issue is when I try to view the debug output using AXEpad.

The AXEpad version is 1.0.0.

The issue seems to be specific to the 20x2. More correctly, I do not see a problem with the 08M, and do not recall any issues with the 14m or 18x, the other chips I have.
 

hippy

Ex-Staff (retired)
The issue is when I try to view the debug output using AXEpad.
That is possible; the debug display is a part of AXEpad. We are planning a further release of AXEpad which should be happening in the near future. As a workround using SerTxd and the Terminal display within AXEpad should show correct results from the 20X2.

As new PICAXE products and features are introduced, PICAXE extends across a wider range of products ( Programming Editor, AXEpad, Logicator for PICAXE, PICAXE VSM, and native compilers ) plus multiple OS support ( Windows, Linux, Mac ) it becomes more difficult to keep everything in sync. We are looking into improving that situation.
 
Top