Pages: [1] 2   Go Down
Author Topic: Arduino Basic + ATmega8 + ATtiny85 = Teach Class for Kids!  (Read 4788 times)
0 Members and 1 Guest are viewing this topic.
Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's the idea:

Run Arduino Basic on a ATmega8 (will need to tweak the code to make it use less RAM and Flash, will start do soon)

http://ec2-122-248-210-243.ap-southeast-1.compute.amazonaws.com/mediawiki/index.php/Arduino_Basic

Make a tiny terminal with this:

- ATtiny85 using the internal 8Mhz clock
- PS2 keyboard connector (2 wires)
- 16x2 LCD using a C164 or C595 shifter (2 wires)
- I2C or UART connection to the main board above (2 wires)

This is to teach kids the startup of robotics/microelectronics. And they are mostly poor, so, no computer, no expensive stuff.

Wk
Logged


Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I still don't know about the PS2 keyboard and LCD on the Tiny85, but I'm just wish-hoping it will fit and work. Since nothing else will run on the thing it should be good to go. Them this board can be larger while the actual target will be very very small so it could fit on top of a mini-car or something like this:

http://elm-chan.org/works/ltc/report.html

http://hackaday.com/2011/09/07/matchbox-sized-line-following-robot/

And please, no, I can't teach C and use the Arduino IDE, as those kids can't afford computers and I can't afford to buy computers for the class, as this is mostly a hobby/charity thing for now.
Logged


Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's the PS2 Mouse/Keyboard code:

http://www.arduino.cc/playground/ComponentLib/Ps2mouse

And here's how to use 2-wires to connect the LCD with a cheap shift-chip:

http://code.google.com/p/arduinoshiftreglcd/

Them there's also the ATtiny85 I2C/Uart code:

http://code.google.com/p/arduino-tiny/

Logged


0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2857
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This is very cool, and from what I've seen of your hacks, if anyone can pull this off it is you smiley

--
The Basic Motor Driver: simple, inexpensive motor driver for 1 stepper motor or 2 DC motors
Logged

Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh yeah, I also hope so, thanks.

BTW: it seems that the 2-wire scheme doesn't work on the LCD with C595, so I had to order some SN74LS164 just for that.  smiley-eek-blue (they are cheap, uff)

I also got some ATmega8 just to be sure it will work on those, but for now I test on the regular ATmega328 I got here.

Wk
Logged


Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah, I already noticed that I will be using the SoftwareSerial library to handle the UART. Now I hope that there will still be room for the PS2 code. From what I could see the PS2 code works with interrupts, have to check how many we got on the ATtiny85...

Wk
Logged


Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, from the datasheet, any pin can have pin-change interrupt, so that's nice to know.  smiley-cool

Wk
Logged


Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Actually, all in all I think I will stick with the ATmega8 for both devices. The advantage is that I could use the direct LCD mode without an extra shift-chip, and also there's the Hardware Serial (UART) ports to talk to each other, much nicer.

So I'm ordering some SMD ATmega8 and conversion boards to make some tests. I plan on testing things soon.

The challenge will be update the Arduino code so it uses less RAM freeing more RAM for the Basic. But since the EEPROM has only 512 bytes, there's not much need for more than that anyway, which I doubt I would get in any event. The ATmega8 has only 1K of RAM, and currently TinyBasic uses around 640 bytes, so if I could drop to 512 bytes or so, it would be perfect.

This will be used for basic stuff, so 512 bytes should be enough. And we could always add Macros and new Instructions for things making the BASIC code even smaller. We will see...  smiley-fat

Wk
Logged


Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12737
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Actually, all in all I think I will stick with the ATmega8 for both devices. The advantage is that I could use the direct LCD mode without an extra shift-chip, and also there's the Hardware Serial (UART) ports to talk to each other, much nicer.

What do you think about using an ATtiny2313 instead of the ATtiny85?
Logged

Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I couldn't find good prices on eBay, while I got some good prices on the ATmega8.

http://www.ebay.com/itm/170659460920?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

And I will use this as the board.

http://www.ebay.com/itm/270707899662?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

Now I need to learn how to hand-solder SMD chips.  smiley-eek-blue smiley-eek

But I met an old guy around here that is an expert and he's retired, so he may help me out, at least I'm hoping so. ;-) He has an electronics shop in his country house, so I'm sure he got some nice SMD tools.

Wk
Logged


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

why not just hook everything up to a 328p? http://www.mouser.com/ProductDetail/Atmel/ATMEGA328P-AU/?qs=sGAEpiMZZMvu0Nwh4cA1wRKJzS2Lmyk%252brzyUxJFNGOs%3d if you buy 25 they are only $2.97, and you'd double your ram.
Logged

Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the idea, but sadly, since I'm in Brazil, Mouser charges $40 for transportation. So, if I buy 10 units, the total bill is $70, since its over $50, and its from a company, I pay 100% custom taxes on top, for a total of $ 140 USD for 10 chips alone.   smiley-sad

Also, I want to keep 2 boards. One for the Terminal alone, and another for robotics, so it could be as small as possible, to fit in a mini rc car.  smiley-cool

Wk
Logged


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

Wow, that's expensive. If you get it working though maybe I'll modify what you have. I was thinking, if I can find an old big keyboard with some extra space, of mounting the lcd and 328p in the keyboard case. Then you'd have a tinyBasic laptop smiley-grin
Logged

Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I do have 6x ATmega328, so I may try those for the target board, and still use the ATmega8 for the Terminal board.

The advantage is that I still save a few bucks on the Terminal board while having a good target board. I wonder if I could use the TinyBasic at 20Mhz, as I got some 20Mhz crystals too. ;-)

I just need to learn how to solder SMD chips now, a friend already gave me great tips.  smiley-mr-green

Wk
Logged


Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I haven't done the tests yet, but as soon as some parts arrive, I will start testing things out.

Wk
Logged


Pages: [1] 2   Go Up
Jump to: