Menu

Progrmem for avr

2020-02-18
2020-02-20
  • Boris Breuer

    Boris Breuer - 2020-02-18

    Hi folks,

    just read, that GreatCowBasic has a way to use PROGMEM for storing. But PIC only afair.
    Any Chance to get an AVR-mechanism, too?

    Thank you for reading, Boris.

     
  • Anobium

    Anobium - 2020-02-18

    If you have example code.. then, we can look.

     
  • Boris Breuer

    Boris Breuer - 2020-02-20

    Hi Anobium,

    no Great Cow BASIC code atm, after a delay i am working on some things for some articles I would like to publish on the Full Circle Magazine in the nearer future. I thought I could save some RAM and store some fixed values in PROGMEM. The idea would be to save a value table with values for flicker patterns (the goal of the article series was and is a light reacting false candle)...

    For this project maybe defining constants for the repeating text messages could save some, i have to try...

    I have some things with LCD-Displays in mind for some other projects and some arduino sample codes used PROGMEM for the pictures instead of defining a variable in RAM. That looked somehow logical to me.

    For this future project PROGMEM seems the ideal solution.

    So with respect to the time it would need until i am ready with the code I thought I ask now and have PROGMEM or a similar solution later :) and because, I don't know how much effort it would take to implement i would like to ask sooner than later ;)

     
  • stan cartwright

    stan cartwright - 2020-02-20

    Hi,Boris.
    Anobium told me tables use program memory not ram.
    I have bought several candle/flame effect lamps off ebay.
    Nice tear apart video https://www.youtube.com/watch?v=1D8lmgxRqf8

     
  • Boris Breuer

    Boris Breuer - 2020-02-20

    Hi Stan,

    well, maybe there are some other ways to achieve the same goal :)

    Have had a look at tables. For fixed values which are needed one by one like for this purpose to have the PWM values this would be sufficient. For the other mentioned purpose (fixed picture data aka bitmap) it would not be sufficient besides the lcd routines read data line by line - i haven't had a look at the lcd_routines in Great Cow BASIC...

    Nice lamps, never saw them here in Germany - but as they seem to have a normal high voltage socket I suppose they are meant to be plugged into a lamp socket.

    My efforts go more in this direction: https://youtu.be/tE63F9P7uDU
    And this will be the real use case in the end - as a decoration in respect to my father for the place he found his last rest. And my other relatives at the same place. Surely, i could buy some, but it wouldn't be the same ;)

     

    Last edit: Boris Breuer 2020-02-20
    • stan cartwright

      stan cartwright - 2020-02-20

      There's a led candle in gcb demos.
      I have a flame effect lantern from Lidl which hangs over my front door. It uses 3 aaa cells and goes on for 6 hours then off for 18 hours then repeats.
      There are solar powered vesions that charge the battery in daylight.

       
  • stan cartwright

    stan cartwright - 2020-02-20

    A 328p uno/nano has 2K ram and 32K program memory.
    each table data is 1 byte.
    I have used large tables over 1 K on a 328p for sprite data in glcd graphics.
    I could have used an array in ram.

     
  • Boris Breuer

    Boris Breuer - 2020-02-20

    Yes if I would use a 328p for that, than I would have plenty. But I try to cram that into an tiny13a :)

    The ATtiny13A: 1K byte Flash, 64 bytes EEPROM, 64 bytes SRAM

    The idea is to have the smallest possible chip and power consumption to have very long battery lifetime.

     

    Last edit: Boris Breuer 2020-02-20
    • stan cartwright

      stan cartwright - 2020-02-20

      Cool idea. Use random for the led flicker...maybe?
      I would go for a cheap solar powered garden lamp and modify it for your needs.
      I like the sentiment of you making a candle and not just buying one :(

       
  • jackjames

    jackjames - 2020-02-20

    This little program is to make an 8 flames flickering candles.

     
  • stan cartwright

    stan cartwright - 2020-02-20

    Hi jackjames.
    I looked at your code. I would have done 8 leds in a sequence or sequences to give the flame jump effect to top ie make it look like a candle.
    Your version might be nice.
    What does your idea look like ?

     
  • Boris Breuer

    Boris Breuer - 2020-02-20

    Hi jackjames thanks for the Code. did not get all of it at once. but maybe i get it at
    the second look :)

    @Stan: recharging with solar-panels rescued from old Garden lanterns is another Part of the project ;)

     
  • jackjames

    jackjames - 2020-02-20

    @Stan:
    Actually the full version of the project has 15 outputs, I use all the outputs available on the PIC.
    This is the algorithm I have used.
    I used it to simulate the flames of candles and torches in the crib.
    The effect is very realistic.
    By changing the times it can also be used to simulate the flicker of stars.

     

    Last edit: jackjames 2020-02-20
  • stan cartwright

    stan cartwright - 2020-02-20

    These are nice projects and many ways to implement them using gcb.
    The using ports is simple and easy to understand.
    Why not tri colour leds?

    A poundland light would be simpler in design ie no micro.
    Let us know what you decided to use @Boris.

     
  • jackjames

    jackjames - 2020-02-20

    @Stan:
    I have not used the three-color LEDs because normal LEDs were fine for my use, for the lanterns I used incandescent bulbs that have hysteresis and the effect reproduced is much better than the LEDs.

     

Log in to post a comment.