0
Offline
Full Member
Karma: 0
Posts: 239
Arduino rocks
|
 |
« Reply #15 on: February 20, 2008, 10:59:44 pm » |
if you look at the schem, most of the motor control pins are for the PWM channels. theres only 3 pins that are used for 'data' - and those are behind a latch - clk, data, enable and latch. turning into some i2c deal would thus save you a grand total of 2 pins. unless you wanted to, say, put -everything- onto another microcontroller. in which case you would try to do the PWM on the attiny2313 and have that controlled via i2c. and the attiny2313 only has 2 timers by the way, whereas the atmega168 has 3, so you'd have to do the PWM in software which means tons of fun debugging that and i2c communication at the same time. especially difficult when the user wants 8-bit PWM is at >20khz! also, where are you getting an attiny2313 for $1.45 in qty 1? and a 8-pos DIP switch for $0.75 in qty 1? +$3 in parts cost -> *at least* +$6 in final cost. for example: $0.40 led + $0.80 PCB + $1.80 chip/passives for i2c = $3 raw cost $3 * 200% wholesale markup = $6 $6 * 200% retail markup = $12 final cost
|
|
|
|
|
Logged
|
|
|
|
|
Brisbane, Australia
Offline
God Member
Karma: 0
Posts: 593
|
 |
« Reply #16 on: February 20, 2008, 11:32:34 pm » |
unless you wanted to, say, put -everything- onto another microcontroller. in which case you would try to do the PWM on the attiny2313 and have that controlled via i2c. Exactly.  Makes the library controlling it far simpler and frees up timers. Was it you who hit a snag with the timers and delay()? and the attiny2313 only has 2 timers by the way, whereas the atmega168 has 3, so you'd have to do the PWM in software which means tons of fun debugging that and i2c communication at the same time. especially difficult when the user wants 8-bit PWM is at >20khz! Well the ATtiny2313 was a example. There are enough different chips to fill any need.  also, where are you getting an attiny2313 for $1.45 in qty 1? and a 8-pos DIP switch for $0.75 in qty 1?  Futurlec.  Cheap shipping too. In quantities of 100 the prices are $1.05 and $0.60 respectively.[/quote]
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 239
Arduino rocks
|
 |
« Reply #17 on: February 20, 2008, 11:41:56 pm » |
well, it sounds like a fun & interesting project. let me know when its done & ill check it out! ill look into integrating it into my designs if its robust
|
|
|
|
« Last Edit: February 20, 2008, 11:45:32 pm by ladyada »
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 239
Arduino rocks
|
 |
« Reply #18 on: February 20, 2008, 11:43:53 pm » |
Futurlec.  Cheap shipping too. In quantities of 100 the prices are $1.05 and $0.60 respectively. i wont copy and paste a 5-page long email thread i've had regarding orders placed with 'em, suffice to say, the prices are good because you're unlikely to ever get the parts.
|
|
|
|
« Last Edit: February 20, 2008, 11:44:08 pm by ladyada »
|
Logged
|
|
|
|
|
Brisbane, Australia
Offline
God Member
Karma: 0
Posts: 593
|
 |
« Reply #19 on: February 21, 2008, 12:14:48 am » |
i wont copy and paste a 5-page long email thread i've had regarding orders placed with 'em, suffice to say, the prices are good because you're unlikely to ever get the parts. Heh. I've always gotten my stuff. Sometimes it takes a little while if you order one of their boards (waiting on a 3.3v switching regulator board atm) but the components come fast.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 173
Arduino rocks
|
 |
« Reply #20 on: February 21, 2008, 10:07:28 am » |
ok, so I wasn't totally off on the I2C thing. It sounds like a great idea, but it definitely introduces added costs(however large or small) and requires some software for the 2313.
Simple jumper wires don't seem to create any additional work other than in the PCB design, and add maybe a nickel to cost for the jumper wires.... kinda seems similar to my idea about jumpers, just easier to implement.
I'm gonna play with some stacky headers this weekend too.... but they are also a bit pricey...
Any other ideas?
|
|
|
|
|
Logged
|
|
|
|
|
SF Bay Area (USA)
Offline
Faraday Member
Karma: 78
Posts: 5454
Strongly opinionated, but not official!
|
 |
« Reply #21 on: February 21, 2008, 09:16:44 pm » |
for example it would only increase the price by about 3 dollars. ~$1.45 for a ATtiny2313 for the I2C interface and ~$0.75 for a DIP switch to select the address. It would increase the COST by about $3... (oops. The Lady already pointed this out!) Isn't implementing an I2C "slave" difficult, though? Or was that SPI? There are a couple protocols where the master has it easy, but the slave has to be able to toggle a signal on a clock edge (or similar), which is tough to do in SW.
|
|
|
|
|
Logged
|
|
|
|
|
USA
Offline
Sr. Member
Karma: 0
Posts: 452
Freeduino rocks
|
 |
« Reply #22 on: February 21, 2008, 11:25:05 pm » |
I just found a great example of a very simple solution here, Totally user configurable... with just a few wires. http://www.ladyada.net/make/eshield/wire.htmlI think the simple solutions are often the most elegant, kudos to you, ladyada. Hmmm... the protoshield with breadboard already had the same concept... maybe we get so advanced on an idea that we forget to get back to the basics...
|
|
|
|
|
Logged
|
|
|
|
|
USA
Offline
Sr. Member
Karma: 0
Posts: 452
Freeduino rocks
|
 |
« Reply #23 on: February 21, 2008, 11:39:56 pm » |
ok, so I wasn't totally off on the I2C thing. It sounds like a great idea, but it definitely introduces added costs(however large or small) and requires some software for the 2313.
Simple jumper wires don't seem to create any additional work other than in the PCB design, and add maybe a nickel to cost for the jumper wires.... kinda seems similar to my idea about jumpers, just easier to implement.
I'm gonna play with some stacky headers this weekend too.... but they are also a bit pricey...
Any other ideas? aballen, if you want to have many-to-many combinations, it is just impractical with jumpers. That is why buses were invented. I2C is the way to go. You can hide the complexity of i2c by writing an abstraction library that talks to a master I2C shield, which assigns device numbers to different shields and do the master coordination... every shield, when powered-up and connected to an i2c bus, tries to talk to the master shield... Arduino does the same... actually ladyada already put a price on this shield... $12... it is just a tiny AVR + PCB + software
|
|
|
|
|
Logged
|
|
|
|
|
USA
Offline
Sr. Member
Karma: 0
Posts: 452
Freeduino rocks
|
 |
« Reply #24 on: February 21, 2008, 11:41:48 pm » |
i wont copy and paste a 5-page long email thread i've had regarding orders placed with 'em, suffice to say, the prices are good because you're unlikely to ever get the parts. Heh. I've always gotten my stuff. Sometimes it takes a little while if you order one of their boards (waiting on a 3.3v switching regulator board atm) but the components come fast. Futurlec is reliable, but slow (2-3 weeks)... and the pricing is OK for small to mid size orders... it is not so cheap if you order large quantities.
|
|
|
|
|
Logged
|
|
|
|
|
Brisbane, Australia
Offline
God Member
Karma: 0
Posts: 593
|
 |
« Reply #25 on: February 22, 2008, 05:01:28 am » |
Isn't implementing an I2C "slave" difficult, though? Or was that SPI? There are a couple protocols where the master has it easy, but the slave has to be able to toggle a signal on a clock edge (or similar), which is tough to do in SW. I believe that Wire handles it out of the box. Its SPI with the tricky slave stuff. When creating the object there is a optional slave address parameter although I've never used it.
|
|
|
|
|
Logged
|
|
|
|
|
Denver
Offline
God Member
Karma: 19
Posts: 776
Inactive - PM
|
 |
« Reply #26 on: February 23, 2008, 08:15:10 pm » |
Hi, I just received some stacking SIP headers from Adafruit http://www.adafruit.com/index.php?main_page=product_info&cPath=17_21&products_id=85I used them to replace the SIP headers on my "base I/O shield". I'm now able to stack 3 shields. Pretty soon I'll have a PC     Works for me! John
|
|
|
|
|
Logged
|
"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom." ~ Clifford Stoll
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 173
Arduino rocks
|
 |
« Reply #27 on: February 24, 2008, 01:11:28 am » |
yeah I got to play with some stacky shield today and they are sweet!!.... its like a triple decker cheeseburger.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 173
Arduino rocks
|
 |
« Reply #28 on: February 24, 2008, 01:07:10 pm » |
hogan what did you use to cut your stacky headers a dremel?
|
|
|
|
|
Logged
|
|
|
|
|
Denver
Offline
God Member
Karma: 19
Posts: 776
Inactive - PM
|
 |
« Reply #29 on: February 24, 2008, 01:35:46 pm » |
Just used a wire cutter and sacrificed one socket by cutting down it's center. Then clean up the cut ends with the wire cutter, and if I'm ambitious, a belt sander.
|
|
|
|
|
Logged
|
"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom." ~ Clifford Stoll
|
|
|
|
|