Pages: [1]   Go Down
Author Topic: Atmega328P Standalone I2C, extra hardware?  (Read 1911 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there.

I'm currently working on a project using 2x TLC5940s to run an 8x4 mono matrix.
I'm planning to have several patterns running over the matrix, selectable using an IR remote (I already have the remote code and HW working fine.
Judging by some comments on here the Arduino may not have enough memory to store too many programs/patterns, coupled with the IR code, so I've heard talk of using a master/slave setup.
I'd have the master reading the IR code and setting some variables, then passing them over to the slave, which would have the patterns setup and run the correct one based on the variables passed over, does that make sense, is that the most efficient solution?
To save on space and cost I'd like to do this with just 2 Atmega328s and required hardware. I've bought the chips with the crystals (Would they be required for this application?) but some schematics recommend using some capacitors too?
Is there anything else required for I2C.

Many Thanks
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8952
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I2C requires pull-up resistors on SCL and SDA.  I think 4.7K Ohm?
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27352
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Be easier to go with a processor with more memory.
'1284 just as easy to work, similar in size to two '328's and the extra crystal & caps & resistor.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Be easier to go with a processor with more memory.
'1284 just as easy to work, similar in size to two '328's and the extra crystal & caps & resistor.

Thanks for the responses guys.
So is the standalone set-up for the 1284 the same as the 328? Resistor? Can I program the 1284 the same way I'd program the 328 if removed from the Due? I'll have a look around for topics on the 1284, though they're a bit of a bugger to get hold of it seems.

Thanks for all your help
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27352
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Mouser.com has plenty last I looked.
http://www.mouser.com/Search/Refine.aspx?Keyword=atmega1284

Setup like a '328 with crystal, caps, reset resistor.
I bootload mine with the $13 AVR programmer from MDFly, then download sketches with FTDI Basic or equivalent. May be possible to bootload with Westfw's optiloader as well, discussion ongoing in another thread on that.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27352
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm installing these on my next board design for programming
http://www.mouser.com/ProductDetail/mikroElektronika/MIKROE-483/?qs=sGAEpiMZZMuNcqZxhMNT3znYT0k8AsjH
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Excellent thanks, I'll keep them in mind. Mouser seem to have a few available in the UK and the prices look very good.
Could the bootloader not be burned using the same methods as for the 328 if you already have an Arduino? Looks to me like the pin setup is similar enough.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27352
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Could be, as long as a bootload file exists and it knows about fuse settings, etc.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Could be, as long as a bootload file exists and it knows about fuse settings, etc.

Going to get a couple of these ordered.
I may be stuck with I2c for a bit as I have a few 328s to use up and a project to work on this weekend.
I'll wire it all up and see if I can get some form of communication.

Thanks for your help
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 495
Posts: 19040
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You could run your 328s on the internal 8 MHz clock and save the crystals. You probably need 0.1 uF caps on the two VCC lines (VCC and AVCC). Apart from one set of 4.7 K pull-ups for I2C you should be able to get away with a pretty minimal setup.

Make sure you give each slave a different I2C address, or alternatively do an I2C broadcast and talk to all at once, which might suit you better.
Logged


Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could run your 328s on the internal 8 MHz clock and save the crystals. You probably need 0.1 uF caps on the two VCC lines (VCC and AVCC). Apart from one set of 4.7 K pull-ups for I2C you should be able to get away with a pretty minimal setup.

Make sure you give each slave a different I2C address, or alternatively do an I2C broadcast and talk to all at once, which might suit you better.

Nice one Nick, thanks for the assistance.
Would I gain/lose anything running at 8MHz? Would it affect the IR receiver, TLC5940s or PWM in general?

Cheers
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 495
Posts: 19040
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Apart from halving the speed? You would need to compensate for that in any time-critical part (like PWM). I believe the internal oscillator isn't as accurate as a crystal, but the TV-Begone kit uses a Attiny without a crystal and that successfully turns TVs off.
Logged


Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nothing particularly time sensitive I'd say, I'll give it a go without and see where I get, they're easy enough to stick in afterwards from what I see.
If I'm right PWM ends up twice as fast but can be taken into account.

Thanks
Logged

Pages: [1]   Go Up
Jump to: