Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Monochron Clock - programme ATMEGA
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Monochron Clock - programme ATMEGA

by alarkham on Tue Oct 27, 2015 4:35 pm

Still got this on the list... :-)

I am trying to work out how I can programme a ATMega328....
The FTDI method is within my capabilities (I think!) but I have a question.
Where can I obtain an ATMega328 with the fuses set for internal clock?
The chips I can find that come with the Bootloader seem to part of a basic Arduino kit - with a crystal.
So fuses set for external clock.

... or am I missing something?

Many thanks
Andy

alarkham
 
Posts: 6
Joined: Tue Jul 28, 2015 3:36 pm

Re: Monochron Clock - programme ATMEGA

by adafruit_support_bill on Tue Oct 27, 2015 4:38 pm

You can buy the raw - un-programmed chips from major suppliers such as Mouser and DigiKey.

adafruit_support_bill
 
Posts: 77964
Joined: Sat Feb 07, 2009 10:11 am

Re: Monochron Clock - programme ATMEGA

by jarchie on Tue Oct 27, 2015 5:40 pm

alarkham wrote:Where can I obtain an ATMega328 with the fuses set for internal clock?

The raw, unprogrammed chips Bill mentioned have the default fuses, and the default fuses are for the internal clock.

And the monochron uses the ATmega328p--not the ATmega328. It's only a one letter difference, but they are different chips.

jarchie
 
Posts: 595
Joined: Sun Jun 24, 2012 2:16 pm
Location: Santa Cruz, California, United States

Re: Monochron Clock - programme ATMEGA

by alarkham on Fri Oct 30, 2015 4:34 pm

Thanks Guys,
But am I right to assume that raw and unprogrammed means no bootloader?
In which case I can't use FTDI to programme them?

Andy

alarkham
 
Posts: 6
Joined: Tue Jul 28, 2015 3:36 pm

Re: Monochron Clock - programme ATMEGA

by Russell 27 on Fri Oct 30, 2015 6:58 pm

The 328 and 328P are the same chip. The small differences are, 328P has a slightly better processor and both have different chip signatures. Some boot loaders or code situations might look for the 328P signature and cause problems. Those values would just need to be changed in code. Other than that, both operate the same. I don't think either come with fuses set for boot loader. I'm not an arduino expert, but those are 328P, are set for boot loader, and are fused for external crystal to operate. If you have means to flash fuses, you should be set. If you do search for 328P vs 328, will give greater detail. Standard chips are set default for internal oscillator.
Russell 27
 
Posts: 240
Joined: Thu Sep 12, 2013 3:59 pm

Re: Monochron Clock - programme ATMEGA

by phild13 on Sat Oct 31, 2015 7:11 am

Either version of the raw processor have the fuses set to use the internal clock. The raw processor does not contain any bootloader. Best places to buy the raw chips is DigiKey, Mouser, or other places like that.
The DigiKey number is ATMEGA328P-PU-ND and they cost 3.70 plus a bit to mail (if in USA select the USPS mail as it is cheapest shipping).
http://www.digikey.com/product-detail/e ... 328P-PU-ND

Adafruit does not sell blank processors. only ones with the bootloader already on them. You can reprogram these, but you will need the correct crystal and capacitors to make the external clock frequency and a breadboard to set things up on for reprogramming.

In general you will need an AVR programmer such as the USBtinyISP to program the "RAW" processor be it a 328 or a 328p; though you can in a pinch with enough effort use some versions of FTDI programmers (FTDI Friend for ex.) and trick the chip into being programmed. https://learn.adafruit.com/ftdi-friend/ ... blank-avrs

I would recommend you pick up Adafruits USBtinyISP programmer kit. It is much faster than an FTDI hack, and it is easy to use, and most tutorials will be geared towards using an AVR programmer. https://www.adafruit.com/products/46

As for the differences in the chips themselves.... They are the same except for a power usage difference, the signature byte difference, Brownout fuse difference, and a couple of instructions difference The 328 also costs about 32 cents less than the 328p. You can actually use either in most circuits. You can also I think use an 328 in a UNO once programmed with the UNO bootloader. The UNO comes with the pico power one (328p).

phild13
 
Posts: 247
Joined: Mon Sep 10, 2012 1:05 pm

Re: Monochron Clock - programme ATMEGA

by alarkham on Sat Oct 31, 2015 8:25 am

Thanks to all who replied.

phild13 wrote:In general you will need an AVR programmer such as the USBtinyISP to program the "RAW" processor be it a 328 or a 328p; though you can in a pinch with enough effort use some versions of FTDI programmers (FTDI Friend for ex.) and trick the chip into being programmed. https://learn.adafruit.com/ftdi-friend/ ... blank-avrs

I would recommend you pick up Adafruits USBtinyISP programmer kit. It is much faster than an FTDI hack, and it is easy to use, and most tutorials will be geared towards using an AVR programmer. https://www.adafruit.com/products/46


OK - probably time to increase my knowledge and jump in to 'proper' programming.!
Something to do over the holidays :-)

Andy

alarkham
 
Posts: 6
Joined: Tue Jul 28, 2015 3:36 pm

Re: Monochron Clock - programme ATMEGA

by phild13 on Sat Oct 31, 2015 3:30 pm

Since the title of the thread is "Monochron Clock - programme ATMEGA" Are you just trying to modify or install a different firmware on an existing clock, or are you trying to make one from scratch, or are you just wanting to do something else with a 328p?

phild13
 
Posts: 247
Joined: Mon Sep 10, 2012 1:05 pm

Re: Monochron Clock - programme ATMEGA

by alarkham on Sun Nov 01, 2015 7:58 am

Hi Phild13....
Trying to start from scratch, and programme a 'raw' 328P.
Most of my experience is with Arduinos, so having to drop a hex file onto a chip is new territory!

Regards
Andy

alarkham
 
Posts: 6
Joined: Tue Jul 28, 2015 3:36 pm

Please be positive and constructive with your questions and comments.