ozdesigner Registered: 03/11/09
Posts: 5
|
|
| |
Reply with quote | #1 | I have a program in flash ROM which is loaded on power up. It runs for a while but then seems to be reloaded from flash and starts again.
Any answer to this?
Also where can I find detail of the start up
sequence of the module |
| Loading... | | |
Atilla

Moderator
Registered: 18/03/07
Posts: 580
|
|
| |
Reply with quote | #2 | ozdesigner, Please provide more information; - module product code - pmmc revision - copy of the 4DGL code you're running - brief description of your setup
__________________ Atilla |
| Loading... | | |
ozdesigner Registered: 03/11/09
Posts: 5
|
|
| |
Reply with quote | #3 | The module is an uOLED-32028-P1T
pmmc rev1_08.PmmC
code is
#platform "uOLED-32028-P1T"
/*
- serial interface test-
-- PICASO Platform --
*/
//================================================== ================================================
func main()
var c,z,cnt,w,t,h,r,v,s,t1,t2,dec;
c:=0;
z:=0;
cnt:=0;
gfx_Cls();
txt_Set(FONT_SIZE, FONT4);
txt_Set(TEXT_COLOUR, 1800);
print ("I2C TEMPERATURE CONTROL\n");
print ("RESET OCCURRED\n");
pause(2000);
txt_Set(3, 1);
gfx_Cls();
txt_MoveCursor(3,0);
print ("Temp = ");
repeat
//print ("START\n");
I2C_Open(I2C_SLOW); // open the I2C port in 100khz mode
I2C_Start(); // send an I2C start condition
I2C_Write(0b10010010); // send a single byte to the I2C bus
c := I2C_AckStatus(); // returns the ACK status from the device
I2C_Write(0b00000000); // send a single byte to the I2C bus
c := I2C_AckStatus(); // returns the ACK status from the device
I2C_Stop(); // send an I2C stop condition
I2C_Start(); // send an I2C start condition
I2C_Write(0b10010011); // send a single byte to the I2C bus
c := I2C_AckStatus(); // returns the ACK status from the device
t2 := I2C_Read(); // read a single byte from the I2C bus
I2C_Ack(); // send an I2C negative acknowledge conditio
t1 := I2C_Read(); // read a single byte from the I2C bus
I2C_Nack(); // send an I2C negative acknowledge conditio
I2C_Stop(); // send an I2C stop condition
w:=t2/10;
r:=t2%10;
txt_MoveCursor(3,7);
print (w);
print (r);
print (".");
if(t1==0x80)
print("5");
else
print("0");
endif
print ("\n");
if(t2<=30)
pin_HI(IO5_PIN); // pin only available on uLCD-320-PMD2
else
pin_LO(IO5_PIN); // pin only available on uLCD-320-PMD2
endif
pause(2000);
forever
endfunc
//================================================== ================================================
just running off the usb port on a pc with the i2c module connected via a P1-EB Expansion Board
program runs ok if loaded into ram from pc
but if powered off and on again it loads from flash and then the problem occurs
|
| Loading... | | |
meldavia Moderator
Registered: 18/03/07
Posts: 270
|
|
| |
Reply with quote | #4 | Hi, if you could explain a couple of things we can try and sort it out for you.
1] "program runs ok if loaded into ram from pc"
Is the program you are running from RAM the same program that you have burnt into FLASH?. A program that has been saved to FLASH will be auto-loaded into RAM at power up/reset and will execute. This FLASH program will remain even if you load a new program into RAM, so if power is removed, RAM contents is lost, but old program that is stored in FLASH is then loaded into RAM and executed, so behavior of program in FLASH should be same behavior as program loaded to RAM.
2] "but if powered off and on again it loads from flash and then the problem occurs"
Not quite sure what you mean, however, a good test would be to load some other program to FLASH (say PicasoSanityCheck.4dg) and then load your I2C test program to RAM. If the RAM program falls over, it will fall back into the sanity test and indicate that RAM program has failed somehow and reset has occurred.
Question:- does this seem to happen at the same time each time you run the test? or does it appear to be random. How long will it run for before the crash occurs ?
Thanks.
__________________ Regards,
Dave |
| Loading... | | |
ozdesigner Registered: 03/11/09
Posts: 5
|
|
| |
Reply with quote | #5 | The same program is in flash and ram, works ok if loaded into ram from pc but not if loaded from flash
When the program is loaded from flash into ram stops after about 10 seconds although this is random between 6 - 12 seconds.
when loaded into ram from pc runs ok for hours |
| Loading... | | |
meldavia Moderator
Registered: 18/03/07
Posts: 270
|
|
| |
Reply with quote | #6 | Still trying to fathom what the problem may be. Tests we conducted today revealed no anomaly. When it fails (when program is programmed into FLASH) , is it connected to the PC via the USB adapter, or are you running it from some other power source?
__________________ Regards,
Dave |
| Loading... | | |
ozdesigner Registered: 03/11/09
Posts: 5
|
|
| |
Reply with quote | #7 | Have found the answer, works ok when run from another pc or an external power source. Looks like my pc is faulty. Still a bit of a mystery as to why, works from RAM but not when loaded from flash rom. |
| Loading... | | |
meldavia Moderator
Registered: 18/03/07
Posts: 270
|
|
| |
Reply with quote | #8 | Yes still a bit of a mystery, the odd thing is that the program is copied from FLASH to RAM when the device powers up, then executed in the same manner as if you had downloaded to 'RAM only' so essentially there is no real difference between the two types of execution. __________________ Regards,
Dave |
| Loading... | | |
ozdesigner Registered: 03/11/09
Posts: 5
|
|
| |
Reply with quote | #9 | Maybe my PC is dropping the +5 volts enough to cause a reset but not drop info from ram |
| Loading... | | |