john wrote: > > Hi,thanks for the quick replies, > > The maze is a standard micromouse 16*16 grid (=256), but > the algrorithm i'm using stores a grid potential, i.e. the > number of squares to be moved to get to the goal- this > takes up 16*16 squares, but in between these squares I > store the wall information, e.g: > > |Wl=255 | Pot=2 | Wall=0 | Pot=1 | Wall=0 | Pot=0 | > | | | | | | | > --------------------------------------------------- > | | | | | | | > |Unused | Wl=255| Unused | Wall=0| Unused | Wl=255| > | | | | | | | > --------------------------------------------------- > | | | | | | | > |Wl=255 | Pot=3 | Wl=255 | Pot=2 | Wall=0 | Pot=1 | > | | | | | | | > > I realise now this isn't terribly eficient in terms of > memory, but I didn't think of that when I chose to use it > (ages ago!). > > I stored the data as integers, which means *2* bytes per > square= 2178 bytes for the whole maze! > > What does it mean to store the data as _bits_? Is that like > NESW > directions > 1010 >gap or wall > > I think that unless I radically alter my algorithm or data > storage method, I will have to use a PIC with more memory > or EEPROM as suggested. Is EEPROM easy to use in a > existing program, or will it require lots of rehashing of > the program and new code ( I'm running out of time for my > project!)? Does anyone know of any good idiot's guides to > EEPROM on the web?? Hi John. Good luck using the PIC for this. Smart mice are usually using larger micros, like 32k rom with 32k ram. Thats a minimum, the contest winners are using 1Mb ram etc. If you get a good smart mouse with a PIC you deserve a great score! Even with an eeprom it's not going to be very easy. Yes you can store wall data as 4 bits per square. But it's more efficient to store it just as the right and top wall, as the square below has its own two walls, as does every square on the grid. This gets you down to 2 bits per tile. Does your mouse do 3 minutes exploring and then has to calculate the shortest path? Maybe use a right-hand wall following system to quickly map the maze, then a left wall following system. That should give most/all of the tiles covered. Good luck with this, I hope you haven't left it too late. I think with a 16F876 or 877 you might have enough ram to do this, but it will be tight. You can use 2 bits/tile for walls, means 4 bytes per row x 16 rows. 64 bytes. Then another 4bits per tile for path computing, another 128 bytes. That will be annoying on a PIC because of all the bank switching. :o) The less ram you use for the array the more work the path finding algorithm has to do. But you can do it, even with only 1 bit/tile for path computing.:o) -Roman I can give you some ideas for non-recursive path finding systems with minimum ram, from the days when I was on a games programming team. Some of the games programmers do more AI than the robotics AI people! ;o) -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics