PDA

View Full Version : move data



donde
12-13-2009, 02:47 AM
Background: Out of memory, first 32K. Next 32K open. If I comment out a few lines of graphics in DAT. I regain memory and program runs fine. But, I loose part of the graphics that I commented out. Right now I have commented out lots of line of graphics, because I have added enhancements to the program. I want to move some or all of the DAT block to the 2nd 32K of EEPROM, so I'll have more EEPROM available in the 1st half. But, not sure of best way to do this.

I have a DAT block that looks like this:

See Attachment

Each example has a lot more similar entries.

I want to preserve the exact way they both look, when placed starting at EEPROM address $8000. I'm using a 64K EEPROM with first 32K for the spin program. I have played with Basic_I2C_Driver.spin, and the minimal version. I'm also using TV_Text.spin to see what is happening. I'm not sure if everything is there at the $8000 start, when I start up I2C object. Right now, I have no loop to move all data. I just want to see the first few characters. What I want is just to see the data as raw, placed at the EEPROM location. It seems "word" and "byte" are a problem during the move of data. @cloudy_img or @ftable are in place of @buffer in the minimal i2c

Post Edited (donde) : 12/12/2009 7:21:18 PM GMT

Mike Green
12-13-2009, 03:08 AM
What are you asking?

It would be helpful for you to try to write down (and post) what your program would look like given the example in the comments of "Basic_I2C_Driver", then ask specific questions on what you wrote (and posted).

donde
12-13-2009, 03:21 AM
I have added a bit more Mike, but just saw your post. So, does "Background" help? I'll add more if necessary.

donde
12-13-2009, 09:19 AM
Here is the program that doesn't work. I show a portion of the data. Won't compile with VAR. I omment out VAR, now compiles, but see 40 on screen twice. So it does write and read. Decimal 40 is a (

Indented tv.dec in error.

Post Edited (donde) : 12/13/2009 1:28:04 AM GMT

Mike Green
12-13-2009, 10:06 AM
1) Your VAR section declares a byte array called "cloudy_img", then your DAT section also tries to declare some data with the same name. You can't have both. You don't actually need the VAR section or the declaration in it.

2) Your display statements (tv.dec) display the address of the variable, not the actual data itself. You need a loop of some kind, something like:


repeat i from 0 to 15
tv.dec(cloudy_img[ i ])
tv.str(string(13,10))

donde
12-13-2009, 11:08 AM
Well, made the changes and rearranged.

Got 2 rows of: 8196000000000000000 (15 zeros)

Guess I don't want that.

donde
12-13-2009, 01:11 PM
Mike, maybe what I want to do can't be done using the 64K EEPROM. I tried to move the reserved word DAT even as a string, but the Prop would not let me. Same with the words, byte or word. So, I guess I'll fool with the SD card again. And put the DAT block on the card with the PC. And figure how to access it?? But, not right now. Got to quit, for head hurts. Thanks

Post Edited (donde) : 12/13/2009 5:16:11 AM GMT

Mike Green
12-13-2009, 02:35 PM
What you got displayed is exactly what you should get. Think about it. "byte 4,32,0,0" followed by a bunch of zeros will display exactly that way when that series of 16-bit words is displayed in decimal without separating spaces or commas. Admittedly it's not easy to figure out, but I just gave you that display loop as a quick and dirty example and figured you'd modify it to make it more meaningful for yourself.

"byte 4,32,0,0" is the same as "byte $04,$20,$00,$00" which is the same as "word $2004,$0000" which is the same as "word 8196,0".

Post Edited (Mike Green) : 12/13/2009 6:40:34 AM GMT

donde
12-14-2009, 06:44 AM
Very good. That helps to see what's going on. You are doing right by pointing to the water, but not leading me by the hand to it. Much better way. Keep up the good work. I notice Prop Tool 1.27 is out. Happy Holidays!