Pages: [1]   Go Down
Author Topic: PROGMEM  (Read 1442 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 267
dinosaur cork
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

David,

I had no problem compiling the PROGMEM example in either 011 or 012 IDE. I don't know what your issue may have been with that. My memory was with a different piece of code I realized.

Too bad about your decision to kill PROGMEM in the docs, is it moving somewhere? Or are we burying it, so only the cognoscenti can find it when they need it?

If so, this post is at least a crumb for future users to follow. Search for PROGMEM in the reference docs and you might find something.

paulb
« Last Edit: October 20, 2008, 08:50:06 am by paulb » Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6255
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Paulb, could you share some context for your post. I have no idea what decision you are referring to.
Logged

Wuppertal/Germany
Offline Offline
God Member
*****
Karma: 1
Posts: 895
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi mem,
there had been a discussion on the devlopers mailing list (Thread : Extended Reference)
about (my interpretation of it) the target audience of the reference pages.
David Mellis wants the Reference to be targeted at beginners (or non-programmers) while Paul has put (I don't know how much) work into the Reference-pages aiming at completeness.

Progmem seems to be the first victim of a clean-up for beginners process.

I'm a bit undecided on the whole topic. I wish the playground was a little bit more organized. My inner voice says it would be the right place for a PROGMEM article, but hard to find without a proper index.

Eberhard
« Last Edit: October 20, 2008, 09:32:22 am by wayoda » Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6806
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

PROGMEM is important in an arduino-like sytem, but it's a bit complex to deal with from the beginner perspective.  What would be nice is to wrap the most common PROGMEM usage within an easier-to-use set of primitives:
Code:
Serial.print(FLASHMEM("this is a string in flash"));
Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6255
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not sure if this or the developers mailing list is the better place to discuss this, but FWIW here is my two cents worth.

IMO, the Arduino reference pages should be targeted at beginners. Much better leaving out details then to overwhelm non technical users with too much information. A fundamental characteristic of Arduino is to make technology accessible and usable by people interested in completing their project rather than understanding the intricacies of the language.

That said, the reference pages could be divided into a main 'overview for beginners' and a separate section with details for experts.
Logged

Pullman, WA
Offline Offline
Edison Member
*
Karma: 12
Posts: 1248
Arduino Ninja
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Focus on beginners; advanced users can get everything they need from the Atmega datasheet and the AVR-GCC reference.
Logged

Wearable Arduino-compatible LED matrix glasses: https://www.kickstarter.com/projects/macetech/rgb-led-shades

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6255
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Focus on beginners; advanced users can get everything they need from the Atmega datasheet and the AVR-GCC reference.
The Arduino specific abstractions aren't covered in the datasheet.

For example, documenting something like the wire library is tricky because although there does need to be someplace to cover details like the return codes, the main reference article probably would not need to go into detail on each of the return codes but this information does need to be covered somewhere.
« Last Edit: October 20, 2008, 12:48:15 pm by mem » Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think PROGMEM is useful.  We should find a nice, "Arduino-like" way to incorporate its functionality into the language (e.g. making Serial.print() working transparently with PROGMEM strings, if possible).  Until then, I think it's best to document it in the playground, since it's more of a "hidden" feature.  

On the other hand, I agree that it can be tough to find things in the playground.  Suggestions welcome.  
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Actually, whatever we decide to include the Arduino language (and reference), there will always be useful code that doesn't quite seem to belong.  To make it easier to find such things, I added links from the reference and extended reference to the code library and tutorials page on the playground.  That seems like a good place to document things like PROGMEM that are useful but don't quite fit into the main language.  This is similar to the way that the official hardware page links to the community-maintained list in the playground.  This might be simpler (and more user friendly) than trying to recreate the entire reference in the playground.  What do you think?
Logged

0
Offline Offline
Faraday Member
**
Karma: 8
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What about tagging reference pages/features as "advanced", or maybe an advanced reference section in addition to the standard reference?

-j

Logged

0
Offline Offline
God Member
*****
Karma: 1
Posts: 513
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Progmem is EXTREMELY useful.  So useful that maybe there should be some way to make it the default storage for const variables.  Though how you automate access to everything progmem const in all existing functions/whatnot is more than a little tricky.  

I suppose a pre-processor *could* handle it and resolve the consts into flash constants and extract them into ram temporarily where they are used for function calls, etc?

i.e. a storeConstsInFlash setting?
« Last Edit: October 20, 2008, 07:24:00 pm by dcb » Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 267
dinosaur cork
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Somehow I posted this in the hardware section, my apologies.

PROGMEM is extremely useful - and as I said in a post to the developer's list, try doing a large LCD project without it. And it's not that puzzling to implement once you have some example code.

So what's the big deal in having the example code in the extended reference section? I thought that was why we made an EXTENDED reference section, so that slightly more advanced concepts would be shielded from beginners. David seems to have some kind of idea of formalist or ideological purity for the reference pages, which I can't figure out.

All I'm arguing for is that the EXTENDED reference section should have nice little details, pointing the way for slightly-past-beginner programmers to get the job done, as well as for beginners to be able to find most of the elements of the C language, so they can begin to understand half of the programs posted in the forum. What the heck is wrong with letting people have information in an organized and sensible way. In my view, the EXTENDED reference page was not getting out of control with irrelevant links or information.

This has not just been about PROGMEM, things like the diagram of the ATEMGA168 chip mapping, was a handy and useful reference on the EXTENDED reference page. This too, somehow runs afoul of some kind of formalist or ideological purity. I personally used the pin diagram  a lot from that page while coding and teaching, and I'll bet others did too. The reference page is still very small compared to Processing and Wiring  and was definitely not in danger of becoming a swiss army knife IMHO. Others may disagree.

If I hadn't worked on writing so much of the material on that page, I wouldn't be so exercised about this issue. No doubt I am embarrassing myself somewhat and I expect many people are scratching their heads and muttering "get a life", which I understand, viewed from the outside, is entirely appropriate. Lest readers wonder about who edited and wrote most of the material on the reference pages, just click a few of the page history links and look at the authorship. (Some may repeat the "get a life" remark). Users who have been around for a while can remember the reference pages from spring 07 when I began filling them in, and my students remarked to me "why do I have to dig through the forum to try to find out how to do anything, instead of finding it on the reference page"

I DO think we need a complete reference in the public section of the website and one that is collectively edited, instead of being micromanaged from the top. I would like to have a place to document the Arduino language (and bugs and quirks), and hopefully make a robust, publicly-edited reference that lets beginners and more advanced coders alike get the job done as quickly as possible. Another editorial viewpoint from the official one also seems entirely useful.

I just don't have time to do it right now - although much of my work can just be copied from the reference pages at first and then added to. And perhaps after it's in place in the public section of the site, it can be deleted from the "official" reference pages so they will have the minimal elegance that seems to be desired at the top.  I'll be happy to help work on reference pages in the public section of the website, should someone else take the lead. I'd like to propose the name "Cabinet" for the public reference to differentiate if from the reference section, but maybe someone has a better name.

Let me say that much of this has been discussed in conversations between DM and myself in the past, and I have tried to have a thick skin about it in the spirit of compromise and cooperation on an open-source project. I have seldom had much of a sense of compromise or attempt to see things from another angle from the other party. Time to get a life and work on other things.

Paul Badger

« Last Edit: October 21, 2008, 12:30:55 am by paulb » Logged

New Zealand
Offline Offline
God Member
*****
Karma: 0
Posts: 999
Arduino pebbles
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
there had been a discussion on the developers mailing list (Thread : Extended Reference)
Slightly OT but this makes me realise I haven't had any developer mailing list mail since mid-September and checking the Arduino Developers list online archive suggests it hasn't received any either.

Anyone know what's up with that?

--Phil.
Logged

New Zealand
Offline Offline
God Member
*****
Karma: 0
Posts: 999
Arduino pebbles
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks to a helpful PM I discovered the Arduino Developers list has been moved.

It seems my address might have somehow got lost during the move?

--Phil.
Logged

Pages: [1]   Go Up
Jump to: