DAT on SD
donde
Posts: 51
Can I move data, that is now on the DAT block, onto an SD card, and then access it from from the program? I have gone through test reading a file OK an a SD using fsrw. Have no idea how to get to the data on the SD. I'll keep "ftable" symbol on the DAT block, and just move the stuff to the right.
donde
DAT
ftable byte SUNNY_IMG_ID, "Clear", "|"
byte CLOUDY_IMG_ID, "Cloudy", "|"
etc
donde
DAT
ftable byte SUNNY_IMG_ID, "Clear", "|"
byte CLOUDY_IMG_ID, "Cloudy", "|"
etc
Comments
There is a test program showing how to move the data from dat into swap.sys and back for usage.
I am unclear what your goal is....is it
A) To move the data from DAT into a file during your program?
To move the data into the file so that it doesn't have to be in DAT at all?
or some combination of these?
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NYC Area Prop Club
Prop Forum Search (Via Google)
·
donde
You didn't say what kind of Prop board you're using. If you're using a Protoboard, you already have another 32K of EEPROM that's not being used and you could write an initialization program that's run once from RAM and simply initializes the 2nd 32K of EEPROM with the DAT tables that you're currently using. Your program could then read the tables from EEPROM as it needs them. Your initialization program would add a pointer table to the beginning of the EEPROM that would contain the EEPROM addresses of the weather statements in the EEPROM. The easiest and smallest object to use for reading and writing EEPROM would be "Basic I2C Driver". That has routines for reading and writing bytes, words, longs, and blocks of memory given an address in the EEPROM.
If you're not using a Protoboard, you may be able to replace the EEPROM with a larger one or add an additional EEPROM to I/O pins 28/29 or some other pair of I/O pins.
I have a PropModule, which indeed has a 512K EEPROM (64K). I never thought of how to use the rest till now. How do you initialize the 2nd section? I have tried the Basic I2C Driver a while back, but did not connect the dots for the memory problem in the current project. Now, I hope to apply this I2C object to put data in the other 32K.
By the way the keypad plus encoder works great to input any ZIP and get weather.
Thanks, donde
The comments at the beginning of the Driver show how to use it to read and write EEPROM data.
For initialization, you're just going to make another program that's downloaded to RAM for execution. This program contains your tables in DAT form and a small program (a simple loop would do) that writes the DAT tables to the EEPROM starting at location $8000 using the Basic I2C Driver.
To simplify the EEPROM use, you might want to include an address table at the beginning of the DAT information like:
Each word has the offset from the start of the table to the start of the string. The last table entry is zero to mark the end of the table.
Post Edited (Mike Green) : 12/7/2009 5:53:04 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
FSRW at least has portions of PASM that it uses, so I would imagine it would be much faster than the basic I2C driver.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
donde
In my case, I'll only be periodically reading a short string or two from DAT on the 2nd half of the 64K EEPROM.
donde
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!