MySensors with Atmega8(L) ?



  • Hi guys,
    I want to control two relays using MySensors and nRF24L01+. But I wanted to do that using a ATmega8(L), it has 8Kb of flash, instead a 32Kb from mega328 of arduino. Is that possible ?

    Thanks.



  • @joaopaulo
    There has been some success using the ATtiny85 which also has 8kbytes flash. Search the forum for ATtiny.


  • Mod

    you will probably need to hack&cut a library to reduce a required flash
    I would recommend you to reconsider usage of atmega8, otherwise you will need to spend a lot of time to fit any upgrade
    I had such an experience. I was translating Mysensors to Atmel Studio and that allows me to fit sensors & clocks into atmega8.
    But as Mysensors is under fast development it became too complicated to follow.



  • @axillent Yeah, I was with this same intention to port MySensors to Atmel Studio and mega8. Anyway, I think it will be less complicated if i use the common mega328p as Arduino.

    Thanks



  • // EDIT and ADD in: ...Arduino\libraries\MySensors\drivers\AVR\DigitalIO\DigitalPin.h

        #if defined(__AVR_ATmega168__)\
        ||defined(__AVR_ATmega168P__)\
        ||defined(__AVR_ATmega8__)\
        ||defined(__AVR_ATmega328P__)
        // 168 and 328 Arduinos
    

    // EDIT and ADD IN: ...Arduino\libraries\MySensors\drivers\AVR\DigitalWriteFast\digitalWriteFast.h

     #elif defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_DUEMILANOVE) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega8__) || defined(__AVR_ATmega328PB__)
    

    // ADD to Sketch Code:

    //Name conversion R.Wiersma
    #define UCSR0A UCSRA
    #define UDR0 UDR
    #define UDRE0 UDRE
    #define RXC0 RXC
    #define FE0 FE
    #define TIFR1 TIFR
    #define WDTCSR WDTCR

    #define WDIE 6
    #define WDCE 4

    // DISABLE debug! small memory 😞
    //#define MY_DEBUG

    I did not test on HW, I just tried to compile it (DimmableLEDActuator):

    0_1484920625423_obrazek.png



  • @vikmad
    Impressive, the same thing will work for an attiny84/85 ?


Log in to reply
 

Suggested Topics

  • 4
  • 14
  • 4
  • 17
  • 9
  • 2

0
Online

11.4k
Users

11.1k
Topics

112.6k
Posts