Shop OBEX P1 Docs P2 Docs Learn Events
move data — Parallax Forums

move data

dondedonde Posts: 51
edited 2009-12-13 22:44 in Propeller 1
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

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-12-12 19:08
    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).
  • dondedonde Posts: 51
    edited 2009-12-12 19:21
    I have added a bit more Mike, but just saw your post. So, does "Background" help? I'll add more if necessary.
  • dondedonde Posts: 51
    edited 2009-12-13 01:19
    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 GreenMike Green Posts: 23,101
    edited 2009-12-13 02:06
    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[noparse][[/noparse] i ])
    tv.str(string(13,10))
    
  • dondedonde Posts: 51
    edited 2009-12-13 03:08
    Well, made the changes and rearranged.

    Got 2 rows of: 8196000000000000000 (15 zeros)

    Guess I don't want that.
  • dondedonde Posts: 51
    edited 2009-12-13 05:11
    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 GreenMike Green Posts: 23,101
    edited 2009-12-13 06:35
    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
  • dondedonde Posts: 51
    edited 2009-12-13 22:44
    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!
Sign In or Register to comment.