Problem running external slots

BeanieBots

Moderator
PE V5.2.4
PICAXE 28X V B.0
Hardware AXE091

Hopefully I've just made a silly but I can't get an external slot to run.

This is what I've tried using the AXE091 Dev board.

Fitted 24LC256 in I2C socket (tested OK in datalogger)
Connected SDA to pin15
Connected SCL to pin14
Connected pin28 (out7) to L2 (yellow LED)

Downloaded this:-

#PICAXE 28X2
#no_data
#no_table

#slot 4

do
high 0
low 0
toggle 7
pause 50
loop

followed by this:-

#PICAXE 28X2
#no_data
#no_table

for b0=1 to 6
toggle 7
pause 200
next b0

run 4


The downloads all work fine but the code in slot 4 does not run.
The LED flashes as expected due to the code in slot 0 but the 28X2 goes into the ether after the line "run 4" is executed.

It never comes back from wherever it has gone. Reset does not work.
Only a power cycle brings the 28X2 back to life.

Slots 0 to 3 work fine.
Slots 4 to 7 all give the same result.

Removing the 24LC256 gives the same result.
Download to slot 4 completes successfully even with EEPROM removed.

Any guidance would be appreciated.
 

Technical

Technical Support
Staff member
We've just tried your exact two programs (with a 24LC512 that was to hand) and it works fine for us - LED flashes slowly a few times then much faster when slot 4 kicks in. Curiously we did at first have some strange problems like you but then realised we had a 24LC16B in the socket by mistake!

On the AXE091 also make sure your 'pin 14' connection is actually on the 28 pin row (inner set of 4 contacts by themselves) not the outer 40 pin row - they are different due to the differences between 28/40 pin chips.

Also you should really start using 'toggle b.7' rather than 'toggle 7'
 

BeanieBots

Moderator
Hmm, sounds like I have an EEPROM issue to resolve then:confused:

Was going to try a 24LC16 but presumably it requires at least a 128 even if the slot program is small?

Is it normal for the download to work even when there is no memory?
My results are identical whether the EEPROM is fitted or not. No PE errors.
 

Technical

Technical Support
Staff member
Due to the way the download has to work (cacheing 64 bytes to write to EEPROM) this behaviour is correct. You do need at least a 128 to get the 64 byte page write capacity. We've just tested with a 24LC256 aswell and it was ok, it sounds like you have an i2c hardware issue somewhere (do you have the DS1307 fitted? - try without).
 

BeanieBots

Moderator
I've now tried with two different X2's and two 256's. Same results.
Iv'e 'buzzed' pin to pin, all OK.
I've even tried swapping SDA and SCL over "just in case".
DS1307 not fitted for any 'slot' tests.
SDA and SCL are both correctly pulled high.

Lifting either SDA or SCL causes a reset when "run 4" is encounter resulting in slot 0 being run over and over. So, 'something' is 'working'.
When hooked up "correctly", it just goes off into the ether whenever run 4 is executed:(

I'll have to park this for now and maybe try some I2C read/writes later and see if anything is getting into the EEPROM or if the X2 (or any other PICAXE) can use it as data memory on the AXE091.
 

Technical

Technical Support
Staff member
Lifting either SDA or SCL causes a reset when "run 4" is encounter resulting in slot 0 being run over and over. So, 'something' is 'working'.
That is expected behaviour - the run 4 attempts to do some i2c read, can't and so the i2c bus locks. After 2 seconds or so the chip watchdogs out and resets.

This all points to no valid program ending up in the external EEPROM - maybe check the 10k under the EEPROM is correctly pulling WP low?

Are they Microchip 24LC256's ??...
 
Last edited:

eclectic

Moderator
I've also (re) duplicated BB's original setup and program.
AXE091 / 28X2(5v) / RevEd sourced 24LC256

with a DS1307 ticking in the background.
It works.

Then, I connected LED's to outputs 4/5/6/7.
Wiped the 256 Eeprom , then sequentially loaded four programs

Slots 4,5 and 6

Code:
#PICAXE 28X2
#no_data
#no_table
#rem
#slot 4
sertxd ("Slot 4",cr,lf)
for b0 = 1 to 20
toggle 4
pause 50
next 
run 5

#slot 5
sertxd ("Slot 5",cr,lf)
for b0 = 1 to 20
toggle 5
pause 50
next 
run 6

#endrem

#slot 6
sertxd ("Slot 6 ", cr,lf)
for b0 = 1 to 20
toggle 6
pause 50
next 
run 0
slot0 program
Code:
#PICAXE 28X2
#no_data
#no_table

sertxd (cr,lf, "Starting ",cr,lf)
for b0=1 to 6
toggle b.7
pause 200
next b0

run 4
The LED's flash in correct sequence, and Sertxd works. (Pic 1)

Finally, I tried a counter, on the slot0 program
Code:
#PICAXE 28X2
#no_data
#no_table

w0 = w0+1
sertxd (cr,lf, "Starting ",#w0,cr,lf)
for b0=1 to 6
toggle b.7
pause 200
next b0

run 4
The light show works perfectly, but, after the very first
“1” value, for w0, it then continually displays “21”.
See pic 2.

Have I misread Manual 2 page 165. :-(

e
 

Attachments

BeanieBots

Moderator
I now have this working fine on a different (home made) board.
(also with RTC clock on the I2C bus)

Porting back (same chips) to the AXE091 however, still refuses to work:confused:
The I2C bus on the AXE091 appears fine:confused:
 

hippy

Ex-Staff (retired)
@ BeanieBots : It's not clear what "this" is that's working.

I can't see any obvious reason the circuit shaould work on an own board but not on the AXE091, there's not a lot to the circuit I should imagine.

One thing you could try is, get it running on your own board ( or entirely the AXE091 beardboard ), then remove components from that and utilise those on the AXE091 PCB. And vice-versa, use the 28X2 on the AXE091 with the other components on your own PCB.
 

BeanieBots

Moderator
Sorry for not being clear.

"this" is a 28X2 running from an external slot. (on my own board)

I've already done exactly what you suggest, ie take the 28X2 and 24LC256 from my working board and put them in the AXE091. It then didn't work?
I'm just as confused as you are why that should be the case.

I've done the obvious checks. Power pins, logic state of WP/SDA/SCL etc and all looks fine:confused:

The 28X2 talking to a DS1307 works fine on the AXE091.
I've not yet had time to do extensive tests with the 24LC256 on the AXE091 but the chip works fine on another board.

The AXE091 is high quality board with no obvious track breaks, solder bridges or dry joints. It has an abundace of useful features so I WILL at some point in the not too distant future devote some quality time to finding the problem.

Bottom line. External slots DO work with my 28X2 but NOT on MY AXE091:confused:
 

hippy

Ex-Staff (retired)
I was thinking 28X2 on your board 24LC256 on AXE091, and vice-versa, to see if the problem can be identified that way. If the 24LC128 worked off your board but not on AXE091, 28X2 worked on both, that would point to an I2C issue with the AXE091 circuity and so on.

I don't have a 24LC256 but am sure I tested with a 24LC128 on the AXE091. I'll try and find the 24LC128 and test again. Will be interesting to hear the results you do get when you have the time to do further tests.
 

BeanieBots

Moderator
Well, it didn't take long (and it was suspected anyway) that the issue was to do with the I2C. However, it did take a while to pinpoint, especially as the DS1307 was working fine.

Everything worked fine when the 24LC256 was on the bread-board but not when it was in the socket.
The confusing part was that everything 'buzzed out' OK.
It wasn't until I clipped a scope probe onto the SDA line and found no signal that the fault became more obvious.
Just the smallest amount of pressure (eg a DVM probe) on the SDA pin made things OK. Without that pressure there was no connection.

This was eventually traced to a break in the track right up against the 24LC256 SDA socket pin.
It is possible to just about make it out using a X20 jeweller's glass. I tried to take a picture but it was impossible to get the light just right or zoom in close enough to be able to see it.

Unlike most other track failures I've encountered, this one does not have the tell-tale 'bulge' or hair-like tails comming from the track which makes me think it has occured post manufacture. Possibly a result of flexing.
I do have all six posts fitted but both the 24LC256 and the DS1307 have been removed and inserted many times, so more likely than not, damage I've done. Though the PTH still remains secure.

Either way, I'm really pleased I've found the issue. It was driving me nuts.
The board has now been fixed by scraping away a small length of the resist and bridgeing with solder:)
 
Top