EEEPROM download data hang-ups

Budzik

New Member
Hi,
I have problem with my project which is saving 2 bytes of of data and 6 bytes of date&time in eeprom memory. 8 bytes in total per record. Date and time are given by i2C from Ds1307, 2 bytes of data are obtained from another 28x1
Works ok, but its hangs up when I try to read and transfer data to PC using either serout or setxd command. Tried with RS232 converter. Same problem!!!
download starts and downloads to PC but stops without reason sometimes after downloading of hundreds records, sometimes even after few recors. it never reads up end of data or last address. When it stops i need to switch off the Picaxe. any Ideas??
 

hippy

Ex-Staff (retired)
What are you using on the PC to read / store / display the data ?
What type of PC - Windows ( version ), Linux, Mac
Are you using a hard-wired serial port connection or USB to serial ?
Is there any protocol used or do you just churn data out from the PICAXE ?
Does the PICAXE stop sending or the PC stop receiving ?
 

Budzik

New Member
What are you using on the PC to read / store / display the data ?
What type of PC - Windows ( version ), Linux, Mac
Are you using a hard-wired serial port connection or USB to serial ?
Is there any protocol used or do you just churn data out from the PICAXE ?
Does the PICAXE stop sending or the PC stop receiving ?
Tried with Windows XP and Vista Bussiness SP1.
USING ADVANCED SERIAL PORT TERMINAL
I am using USB to serial
I m using "serout 4,n4800, (#b1," ",......,#b7" ")
and tried with sertxd
caonnected straight from picaxe
and tried via Max232 using serout 4, t4800,..... and sertxd
Picaxe does stop sending - I use indication on LCD (high 7 on picaxe) when transmition to PC. It getting low when stop sending.
My project included: 4of 28x1 and 1of 08M PICS connecteed via bluetooth to sensor with 08M, 2 line LCD and graphical LCD, and speech synth. Its works perfectly besides that downloading data.


sample of my software :

download:
if pin6 = 1 then download 'wait untlii button released
'wait 2
high 7
read 0,b12
read 1,b13
high 5 ' write protect eeprom
let address = 0
read_data:
'4x 24LC256. Input0 in IC0,4, input1 in IC1,5
'4x 24LC256. Input2 in IC2,6, input7 in IC3,7
'if address > 16383 then read_data_high
i2cslave %10100000, i2cslow, i2cWORD
readi2c address,(B0)
'pause 50 '- tried with different pauses!!!!
let address = address +1
' pause 10
readi2c address,(B1)
' pause 10
let address = address +1
' pause 10
readi2c address,(B2)
' pause 10
let address = address +1
' pause 10
readi2c address,(B3)
' pause 10
let address = address +1
' pause 10
readi2c address,(B4)
' pause 10
let address = address +1
' pause 10
readi2c address,(B5)
' pause 10
let address = address +1
' pause 10
readi2c address,(B6)
' pause 10
let address = address +1
' pause 10
readi2c address,(B7)
' pause 10

goto tx_data


tx_data:
serout 4, n4800,(#address," ",#B0," ",#B1," ",#B2," ",#B3," ",#B4," ",#B5," ",#B6," ",#B7," ",10)
'pause 1000 '- tried with different pauses!!!!
'IF B0=255 AND B1=255 AND B2 =255 THEN goto reportend
inc_address:
'pause 100 '- tried with different pauses!!!!
let address = address + 1
' pause 100
if address=$FF then goto reportend
'if address<>lastaddress then goto read_data
' IF B0=255 AND B1=255 AND B2 =255 THEN goto services

goto read_data
 
Last edited:

hippy

Ex-Staff (retired)
Picaxe does stop sending - I use indication on LCD (high 7 on picaxe) when transmition to PC. It getting low when stop sending.
That does seems odd. The only reason the PICAXE should stop sending is if it meets an end condition as set in your code or it was leaving that download code for some reason; reset, power fail, download or interrupt which did not return. It is possible that a PC can get over-whelmed with incoming data but the pauses should have solved that, and normally that would fail more consistently, plus there's be nothing on the terminal but the PICAXE would continue outputting.

Two things you could try - Replace the I2C reading and output with a single SERTXD/SEROUT which fakes a data send ( "FOR w0 = 0 To 60000 : SerTxd(#w0," 0 1 2 3 4 5 6 7 ",10) : Next ) ,and to send via SEROUT with another terminal watching progress reports sent via SERTXD to show where it is getting to.

You could also try putting an R+LED on the TX line to indicate when data was actually being transmitted.
 

hippy

Ex-Staff (retired)
Ran my I2C tests on 28X1 A.4 and 40X1 A.3 with 24LC16B and no problems in dumping data on my PC. There is a reset if trying to access I2C and it is not connected. Add a SEROUT/SERTXD at the start of your program to show if a reset is occuring.

Code:
#picaxe 28X1

Symbol address = w13

SerTxd("Reset",CR,LF)

I2cSlave $A0, I2CSLOW, I2CBYTE

SerTxd("Load",CR,LF)

address=0
Do
  b0 = address
  b1 = b0+1
  b2 = b0+2
  b3 = b0+3
  b4 = b0+4
  b5 = b0+5
  b6 = b0+6
  b7 = b0+7
  I2cWrite address,(b0,b1,b2,b3,b4,b5,b6,b7)
  pause 10
  address = address + 8
Loop until address >= 256

SerTxd("Dump",CR,LF)

address = 0
Do
  I2cRead address,(b0,b1,b2,b3,b4,b5,b6,b7)
  SerTxd(#address," ",#b0," ",#b1," ",#b2," ",#b3," ",#b4," ",#b5," ",#b6," ",#b7,CR,LF)
  b0 = address + 7
  If b7 <> b0 Then
    SerTxd("FAIL")
    End
  End If
  address = address + 8
Loop
 

Budzik

New Member
I did a data send "for w0 = 0 to 60000 ..... serout...." and it works. It display data on PC perfectly. I didnt use any pause.
It means there is a problem with getting data from eeprom.
Ideas???
 

hippy

Ex-Staff (retired)
Add that SERTXD/SEROUT at the start of the program to report any reset as a first step.

If it's still hanging and no reset the only suggestion is perhaps to start trying to determine where the hang occurs then why. It could be some hardware issue, lose connection, intermittent short, power supply sagging, brownout, EMC, etc. Agreed, everything else appaears to work okay.

You could probably modify the above test to check the integrity of your own Eproms.

Also ... Try running just an Eprom dumping program. That will exclude any issues which may be a result of the rest of the code.
 
Last edited:

Budzik

New Member
just update:
Found problem!!!! problem's occuring when Speech synth (SPE030F) is connected to I2C rail, even SPE030F is doing nothing!!. does it mean too many I2C devices connected ???? (SPE030F + DS1307 + 8* 24LC256)??
 
Last edited:

westaust55

Moderator
Recall this is a previously reported problem - think BCJKiwi identified the problem.

If the SPE030 is connected to the i2c bus but not powered it prevents i2c comms working.

Edit:
No not a case of too many i2c devices commenced.
I have 13 i2c devices permanently connected and have thru an expansion port added a couple more for some experiments.
 
Last edited:

Technical

Technical Support
Staff member
At some point the i2c address byte for the eeprom may be exactly the same as the SPE030 slave address and this accidentally kicks it into life, giving a conflict on the bus. This shouldn't officially happen under i2c rules, but could if the SPE030 firmware isn't quite right.
 

westaust55

Moderator
At some point the i2c address byte for the eeprom may be exactly the same as the SPE030 slave address and this accidentally kicks it into life, giving a conflict on the bus. This shouldn't officially happen under i2c rules, but could if the SPE030 firmware isn't quite right.
The problem as previously reported is when the SPE030 is not powered but connected to the i2c bus.
IMHO this would suggest a hardware issue rather than firmware issue unless there is parasitic power driving the SPE030 badly.
 
Top