DataFlash on WiShield v2.0

Postings related to the second version of the WiShield

Do you use the DataFlash on the WiShield 2.0?

Yes
6
100%
No
0
No votes
 
Total votes : 6

DataFlash on WiShield v2.0

Postby benquark » Thu Aug 12, 2010 9:48 pm

Hi Everybody,

I suppose you've been wondering what's going on with AsyncLabs. I think I even saw some posts on the forum asking if we are still around and Yes we are still around :) We've just been busy working to get more WiShields and BlackWidows out to you guys. You might have noticed that the WiShield 2.0, BlackWidow and YellowJackets are out of stock on the store and it's mainly because we get them manufactured in small batches and have to re-order more as we go along. Apologies but we are working on stocking more as soon as possible.

Recently it has become very hard to get hold of Atmel parts. The ATmega328p which is the MCU on the BlackWidow and YellowJacket is out of stock in most places and now there is a new shortage of Atmel DataFlash parts which are on the WiShield 2.0.

I know a lot of you have been waiting to get your hands on one of the WiShields but the shortage of the DataFlash devices is causing us to hold production of these cool little shields. So the question today is "How important is the DataFlash?" and to figure it out we have posted a poll above asking you if you use the DataFlash on the WiShields. We put the DataFlash on the WiShields because it enables some nice applications but because of this shortage of DataFlash devices, we do not want to stop production and keep all you guys from being able to play with the WiFi part of the WiShield which we think is more important.

We also have the FlashShield which we will stock as soon as we can get access to more of the DataFlash devices and it provides the same functionality as the onboard DataFlash on the WiShield. So, for those of you who were very dependent on the DataFlash, there is an alternative.

So, please let us know if you use the DataFlash. We will leave the poll open for 2 weeks and hope at the end of it that we will be able to get an idea of how many of you use the DataFlash and we can try to come up with a plan to solve this issue.

Thanks a lot.
Ben
benquark
 
Posts: 63
Joined: Wed May 06, 2009 3:57 pm

Re: DataFlash on WiShield v2.0

Postby CapnBry » Tue Sep 07, 2010 7:14 am

I use the dataflash for serving static web content, as I think most people are. However, it also serves a separate purpose. Remember when computers used to have bank swapped RAM? Well, because the dataflash has 2 pages of 528 bytes of SRAM, I consider this sort of like extra RAM. Reading and writing to it is somewhat speedy and power efficient, since you're not actually flashing anything.

I don't need to keep the information in non-volatile storage, so I swap structures in and out of Arduino SRAM as needed to work with them. My state structures are 80 bytes a piece, and I need 6 of them but the Arduino doesn't have the RAM to support it once my application is built with WiFi so I swap in each as needed.

I've also used a dataflash SRAM page as a ring buffer for smaller structures and that worked pretty well too.
CapnBry
 
Posts: 10
Joined: Wed Aug 18, 2010 11:21 am

Re: DataFlash on WiShield v2.0

Postby comperem » Tue Sep 07, 2010 8:40 am

CapnBry,

That all sounds great - you sound like you've had success with the WiShield's dataflash. Based on your post, you've got the SRAM figured out pretty well. But have you also gotten the 2Mb flash memory working as well - with the wireless code operational?

I don't believe this has been accomplished yet.

Marc
comperem
 
Posts: 12
Joined: Mon Jul 13, 2009 6:34 am

Re: DataFlash on WiShield v2.0

Postby CapnBry » Tue Sep 07, 2010 12:36 pm

Oh absolutely. I had to modify the source a bit though. A lot of the dataflash routines leave the flash chip "selected" on the SPI bus which prevents the WiFi from working because I suppose both chips have their SS pins low. Here's some code I use to serve a file from flash, the key to having both work is DF_CS_inactive().
Code: Select all
void sendFlashFile(const struct flash_file *file)
{
  unsigned int size = pgm_read_word(&file->size);
 
  dflash.Cont_Flash_Read_Enable(pgm_read_word(&file->page), 0);
  while (size-- > 0)
    WiServer.write(dflash.Cont_Flash_Read());
  dflash.DF_CS_inactive();
}


Oh also I modified some of the command opcodes, because the ones from the github dataflash.h did only two things: jack and @$%@. It is pretty slow loading files in a browser though, I think because of the slow ack timing maybe? But a 14k PNG file takes about 15-20 seconds to load, and pulling it with curl under linux is about 5-8x faster.
CapnBry
 
Posts: 10
Joined: Wed Aug 18, 2010 11:21 am

Re: DataFlash on WiShield v2.0

Postby comperem » Wed Sep 08, 2010 3:48 am

CapnBry,

Bravo! This is good news.. I'm glad to hear of your success. The code clip makes it look quite straightforward. Two questions come to mind after reading your last post:

(1) it appears that you're using the WiServer's write() method to transfer data to the tcp connection directly from the dataflash read(). That makes a lot of sense. But your comment about needing to 'unselect' the dataflash chip on the SPI bus makes me wonder if you've also put a DF_CS_inactive() call at the end of the dflash.Cont_Flash_Read() method. Like just inside Cont_Flash_Read() so it will release the dataflash chip just as you said. Is this the case?

(2) Your last comment about changing op codes is similar to others working on this same issue. It makes me wonder exactly what your dataflash.h modifications were. I've been trying to track this forum's threads related to dataflash+WiShield combined functionality. My compiled list of changes is below. Can you verify your mods against this list? Same? Anything else? If you've got full, or mostly full functionality with the WiShield 2.0 and dataflash in the same sketch, you've cracked the code!

The three edited portions of my dataflash.h in the .\arduino-0018\libraries\dataflash directory looks like this:

How about yours? Any other mods elsewhere?

Marc
comperem
 
Posts: 12
Joined: Mon Jul 13, 2009 6:34 am

Re: DataFlash on WiShield v2.0

Postby CapnBry » Wed Sep 08, 2010 6:07 am

I've actually started a thread about the changes I made just so we don't derail this thread
viewtopic.php?f=23&t=484
CapnBry
 
Posts: 10
Joined: Wed Aug 18, 2010 11:21 am

Re: DataFlash on WiShield v2.0

Postby comperem » Wed Sep 08, 2010 7:19 am

CapnBry,

Awesome. Thank you for your inputs. The other thread is exactly what I've been waiting for. A HOWTO for WiFi communications and the dataflash.

I'll dig into this soon and try to reproduce your results.

Marc
comperem
 
Posts: 12
Joined: Mon Jul 13, 2009 6:34 am


Return to WiShield 2.0

Who is online

Users browsing this forum: No registered users and 1 guest