+ Post New Thread
Results 1 to 4 of 4
  1. #1
    Newbie level 6
    Points: 226, Level: 2

    Join Date
    Aug 2015
    Posts
    11
    Helped
    0 / 0
    Points
    226
    Level
    2

    3.3V Atmega328p with Arduino Bootloader

    Hello, I want to use Arduino compatable 328p in my project. All other devices runs from 3.3V, so I want to use one power supply. I successfully burned bootloader and blink sketch into new atmega, then disabled brown-out. All worked fine with 16MHz crystal, but according to 328p datasheet, with 3.3V PSU it should be used with max 12MHz crystal. So what will happen to all time related stuff if I just swap crystals? Are delay(1000) still will be delay for 1s?

    •   Alt27th October 2015, 21:34

      advertising

        
       

  2. #2
    Full Member level 3
    Points: 1,293, Level: 8

    Join Date
    Jul 2014
    Posts
    155
    Helped
    27 / 27
    Points
    1,293
    Level
    8

    Re: 3.3V Atmega328p with Arduino Bootloader

    You might want to check the link below.

    http://ceptimus.co.uk/?p=102

    The bootloader and boards.txt file need to be modified for 12 Mhz


    1 members found this post helpful.

    •   Alt28th October 2015, 00:07

      advertising

        
       

  3. #3
    Newbie level 6
    Points: 226, Level: 2

    Join Date
    Aug 2015
    Posts
    11
    Helped
    0 / 0
    Points
    226
    Level
    2

    Re: 3.3V Atmega328p with Arduino Bootloader

    Thank you for the link, but main question still remains. How this efect time related operations? I assume that delay() will calculate how much NOP instructions it has to be done with 16MHz clock, so with 12MHz clock time delay won't be that I want, because NOP instruction now will take longer to execute



    •   Alt29th October 2015, 08:56

      advertising

        
       

  4. #4
    Full Member level 3
    Points: 1,293, Level: 8

    Join Date
    Jul 2014
    Posts
    155
    Helped
    27 / 27
    Points
    1,293
    Level
    8

    Re: 3.3V Atmega328p with Arduino Bootloader

    The delay functions are calculated and configured by the compiler using the information on clock speed from boards.txt. In the Arduino environment, under the tools menu, the board selected has a clock speed associated with it. Each board that appears in that menu has a stanza in boards.txt, that defines this.
    The bootloader needs to be configured for the proper frequency so that it is using an accurate baud rate, to upload the program.
    So, yes, the delay functions and baud rates would be too slow if just the crystal were changed.


    1 members found this post helpful.

--[[ ]]--