Metku.net

MetkuMods
It is currently 25.10.2014 23:38

All times are UTC + 2 hours [ DST ]




Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: 26.01.2009 23:04 
Offline
Site Admin
Site Admin
User avatar

Joined: 24.01.2002 10:09
Posts: 4683
Location: Finland
Image
Image In English
Image Suomeksi

Questions, comments?

Kysymyksiä, kommentteja?

_________________
Metku | AlltheMods | LedCalc | Teknolelu | AndroidCoding
Main Computer: Intel i5, MSI H55M-ED55, 12 Gigabytes of DDR3, 3 Terabytes of HDD, GTX295 and Benq 27"


Top
 Profile  
 
PostPosted: 27.01.2009 12:58 
Offline
Regular Modder
Regular Modder

Joined: 02.11.2006 19:30
Posts: 249
Great!
I use ATtiny85s, ATmega8s and Arduino. ATtiny85 is same as ATtiny45 that was used in article, but it has more flash memory (more than enough for small projects). With small package, low price and great performance it's great uC to start with.

Only sky is the limit when it comes to uC projects. For example it's possible to scan many buttons with one i/o pin by making voltage divider with resistors and using ADC (analog to digital converter).

There are lots of libraries to be used when interfacing some devices (like some LCDs (nokia 3310's display for example)), so it's easier to make something. After some time, it gets easier to modify those libraries, due the learned stuff.


And what comes to programming languages... I started with C then tried Bascom-AVR (it's like telling uC what to do, in english :P) and then came back to C. The real fun will begin shortly, when I start programming with ASM :D

One advice for starters: print (or draw) picture of you uC with pinout to paper, open texteditor (or AVR-Studio...what ever you use from writing your programs) to half of the screen and open your uC's datasheet to another half of the screen. This way you don't need to "surf" through the windows.

I've been thinking to make that USBasp for long long time... Maybe I'll make it someday, so I can use my eee from programming uC:s (except pics...still have to program them with desktop pc).


Hmmph too lazy to translate this to finnish... Hopefully everyone understands what I wrote. If you don't, just ask.


E: AVRFreaks's (link also in article, www.avrfreaks.com) forums are great place to search AVR related stuff. Lots of tutorials, projects, questions and answers related to common and not so common problems... EVERYTHING and more.

Everyone who plays with uC:s raise your hand!

o/ -One AVR and pic user over here!


Top
 Profile  
 
PostPosted: 27.01.2009 14:20 
Offline
Site Admin
Site Admin
User avatar

Joined: 24.01.2002 10:09
Posts: 4683
Location: Finland
Animating multilayered engravings is the first project published project by me that uses a microcontroller. I have played them for years now and know the potential that they offer for modding but we needed a person like Aki to write it down as an article. :)

Here are couple of other projects that I've done with Atmel controllers:
Water heat indicator: http://allthemods.com/userinfo.php?user ... &album=138
Distance sensing lamp: http://allthemods.com/userinfo.php?user ... &album=138
RGB light with PWM: http://allthemods.com/userinfo.php?user ... &album=138


Top
 Profile  
 
PostPosted: 27.01.2009 23:09 
Offline
Regular Modder
Regular Modder

Joined: 14.05.2005 19:47
Posts: 198
Itse käyttäisi mikrokontrollereita, mutta en ole opetellut C:tä eikä oikein innosta ruveta harjoittelemaan sitä.
Onko C-kieli paljonkin vaikeampaa kuin PHP? Esimerkkikoodeista ymmärsin kyllä osan, mutta esim. nuo heksajutut menevät yli hilseen.


Top
 Profile  
 
PostPosted: 27.01.2009 23:11 
Offline
Regular Modder
Regular Modder
User avatar

Joined: 17.03.2006 00:14
Posts: 187
Location: Pori *** CPU: Intel E8400 RAM: 4 Gigabytes HDD: 596 Gigabytes GFX: 8600 GTS
Odotan innolla jatkoa...


Top
 Profile  
 
PostPosted: 27.01.2009 23:15 
Offline
Site Admin
Site Admin
User avatar

Joined: 24.01.2002 10:09
Posts: 4683
Location: Finland
PHP ja C ovat hyvinkin lähellä toisiaan loppupeleissä. Noi hex tai yleensäkin luvut, kun mennään pois kymmenjärjestelmästä voivat tuntua aluksi hankalilta mutta, kun ymmärtää mitä noilla luvuilla koetetaan ohjaimelle sanoa niin kyllä niitä oppii sitten käyttämäänkin. Ihan säännöt noiden käyttöön on, ei ole salatiede kyseessä. :) Yleensä noi alun heksatkin menee enemmän tai vähemmän samoilla lähtöarvoilla, joten voi panostaa sitten tuohon C-koodin vääntöön.


Top
 Profile  
 
PostPosted: 28.01.2009 00:09 
Offline
Regular Modder
Regular Modder

Joined: 02.11.2006 19:30
Posts: 249
DDRB = 0x1F; kohta voidaan kirjoittaa myös binäärimuodossa:
DDRB = 0b00011111;

Molemmat tekevät saman jutun... PB0-PB4 asetetaan ulostuloiksi. Kuten saattaa huomata, viisi oikeanpuoleista numeroa ovat ykkösiä (PB0-PB4 -> viisi pinniä, jotka on asetettu ulostuloiksi) , loput ovat nollia. Tuota 0b:n perässä olevaa lukua lähdetään lukemaan oikealta: ensimmäinen on bit0, seuraava on bit1, seuraava on bit2 jne.
Samaa 0b******** muotoa voidaan käyttää myös muihin rekistereihin kirjoitettaessa.

DDRB on tiedon kulkusuunta -rekisteri B-portille. Kyseinen rekisteri sisältää kahdeksan bittiä. ATtiny15/-25/-45/-85 piireissä on vain B-portti ja siinäkin on vain kuusi i/o-pinniä. Tällöin siis esim DDRC:llä ei voi määritellä piirin pinnien input/output tyyppiä.

Eli jos DDRB:n bit* on ykkönen, on PB* ulostulo. Jos DDRB:n bit* taasen nolla on PB*....aivan, sisääntulo.

Pitkähkö viesti kirjoitettuna puoliunissaan tietää harvoin hyvää, mutta otan riskin.


Top
 Profile  
 
PostPosted: 28.01.2009 02:21 
Offline
Junior Modder
Junior Modder

Joined: 28.01.2009 02:09
Posts: 0
first thing, great guide!
second thing, bad people from Finland posting replies here in Finnish ;)

poor Swedes and all others :D
anyway.. great guide and I really look forward to next part!

ideas for next part.. why not make an uC control one servo and one dc engine on the same circuit?
controlled by two buttons each, back/forward for the engine and left/right for the servo..

that would be a project I would like to follow and try out myself if you could get the software for it, as I just cant understand C programming yet ;)
I have no problems with PHP as I've worked it for a couple of years, so I know the basics in programming.. but learning C for an uC, that isnt the easiest.. for now :D

looking forward to part 2 !! :)

// Chris from SweMOD ;)


Top
 Profile  
 
PostPosted: 28.01.2009 08:19 
Offline
Site Admin
Site Admin
User avatar

Joined: 24.01.2002 10:09
Posts: 4683
Location: Finland
It seems that motors are something that our friends on #metku.net channen in IRC are also interested in. I too feel that this could be a good choice for the next topic. If not in the part 2 but at least in parts that follow it.


Top
 Profile  
 
PostPosted: 28.01.2009 11:12 
Offline
Junior Modder
Junior Modder

Joined: 25.03.2004 11:12
Posts: 10
Japala; Could you post schematics & code from your projects (water heat indicator, etc.) as an example? They would make a great self-study material.


Top
 Profile  
 
PostPosted: 29.01.2009 01:18 
Offline
Super Modder
Super Modder

Joined: 15.07.2005 20:33
Posts: 1314
Location: Tampere, Finland.
zaketus wrote:
DDRB = 0x1F; can also be written in binary:
DDRB = 0b00011111;


I'm slowly starting to remember stuff from the school :D After all I DID go through the four year school and SHOULD know this stuff... I just haven't used it for a year now... Most likely some day I'll get back to that :)


Top
 Profile  
 
PostPosted: 17.02.2009 22:45 
Offline
Junior Modder
Junior Modder

Joined: 08.05.2006 20:23
Posts: 8
Location: hollola(finland)
koskas seuraava osa tulee?


Top
 Profile  
 
PostPosted: 03.03.2009 07:56 
Offline
Junior Modder
Junior Modder

Joined: 29.10.2007 05:22
Posts: 6
Jos mahdollista, voisitteko seuraavaan osioon laittaa myös vaihtoehtoisia tapoja toteuttaa nuo koodit? Meillä koulussa tuollainen ritariässävalo on tehty hitusen eri tavalla, joten en kaikkia koodinpätkiä ihan ymmärtänyt. Myöskään C-kielestä yleisestiottaen ei liikaa ole kokemusta, joten joku pieni "sanakirja" mitä mikäkin komento tarkoittaa tai linkki johonkin idioottivarmaan oppaaseen olisi tosi jees..


Top
 Profile  
 
PostPosted: 03.03.2009 13:44 
Offline
Mini Modder
Mini Modder
User avatar

Joined: 09.09.2008 15:00
Posts: 54
Location: 5m anteenista 1m kolvista 740m tiestä eli KORVESSA .
Ensi jaksossa jotakin mutkikkaanpaa ku ledien välkyttelyä, esim. automaattinen tuulettimensäädin.


Top
 Profile  
 
PostPosted: 04.03.2009 19:42 
Offline
Veteran Modder
Veteran Modder

Joined: 15.08.2004 17:57
Posts: 582
Location: Salo, Finland
Meneekin mahdottoman mutkikkaaksi ;)

A nice guide

Anyone who is interested in embedded projects and µC's should check out www.avrfreaks.net I noticed that Japala is registered there also.

And for converting hex to binary to decimal and back again, Windows calculator does this automatically.

Hopefully we'll see more of this, since embedded systems are becoming a trend in modding these days.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next

All times are UTC + 2 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group