• You are currently viewing our forum as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to additional post topics, communicate privately with other members (PM), view blogs, respond to polls, upload content, and access many other special features. Registration is fast, simple and absolutely free, so please join our community today! Just click here to register. You should turn your Ad Blocker off for this site or certain features may not work properly. If you have any problems with the registration process or your account login, please contact us by clicking here.

uC - Programming

entropie

Permabanned
Joined
Apr 24, 2008
Messages
16,767
MBTI Type
entp
Enneagram
783
Hello there,

I recently started to get intrested in the world of microcontroller programming.

I have some experience with PIC-Chips and got to know about those very easy programmable AVR Chips.

I was just wondering, if someone has some experience with those chips. I am on the lookout for an intresting project, I can build at home.

Most german sites about AVR's reference to german projects, but I found out about some pretty intresting projects from America. Just lack a good collection of links :).

At the moment, I am trying to realise a little stand-alone Webserver with an ATMega and a MMC-Slot for Data Storage.

I am also working on a AVR-USB interface to build a Relais. So you can switch on/off external lights in your room from the PC.

I recently completed the following project as a birthday gift for my mum. There are three Lights (LED) , Red, Green and Blue and they fade in 10 seconds from being offline to their peak intensity and back. I put this into an old bottle and build a wodden socket for the bottle. Now it is an ambient light in our living room :).

The LEDs are up to 2000 mcd with an emitting-angle of 50 degrees. The AVR works with its internal clock at 1,2 MHz, prescaling one circle of operation in 10 seconds @ a working rate of 1 ms . After 10 seconds an Interrupt through buffer overflow is triggered and the circle starts again. Will try to put the AVR CPU Core to sleep mode, so I can lower the consumed current.

Here is the project:

P1000160.JPG


PDF Reference ( shematics + C-Source Code ):

http://sn0opy83.sn.funpic.de/uC.pdf

---

So if anyone of you, knows some intresting projects in AVR Programing, I am eager to learn about it :).

Greetings ~ent
 

spirilis

Senior Membrane
Joined
Jul 5, 2007
Messages
2,687
MBTI Type
INTP
Enneagram
9w1
Instinctual Variant
sp/sx
I haven't put much time into it, but I did get an Arduino USB programmer board that uses the ATmega8 chips I believe. Toyed around with it a bit (controlling LEDs 'n stuff). I was thoroughly impressed at how powerful those things are for being cheap embedded microcontrollers.
 

entropie

Permabanned
Joined
Apr 24, 2008
Messages
16,767
MBTI Type
entp
Enneagram
783
Yea, those AVR things are pretty tough and versatile, when it comes to controlling, surveying or boosting applications.

I have nearly completed two more projects:

P1000423.JPG


That is an USB - Relais with 6 Ports you can set and 4 Ports you can listen to. It works, but as shown here, it is just a prototype. I am thinking about to build optocoupler on the ports so you can switch AC powered systems on or off via your pc. Another possible solution is to build a measuring station, which sends data to the PC. Pretty easy to build, the software for the microship is readily availiable as GPL thing and you just need to embeed it in your project.

P1000421.JPG


This is a nearly completed Webserver that hosts a html site. I still need a crystal and the microcontroller, before I can start it. Have built a prototype already and that I sold for nearly a $100 xD.

I build this one in my company I work for besides university at the moment. They made me the board and I gave the specs.

Pretty cool project, though the server only has 1 kb of webspace at the moment. I am trying to implement a SD-Card slot, but I still need to figure out how to convert from FAT16 to assembler for the microcontroller. The SD slot itself, I will take from an old ISA-slot from a mainboard and it is easily connected to the controller via a few resistors.

Pretty nice project, I maybe can make some money with that. There are many kids still playing online games like counterstrike. Dont know, how good the AVR's are at controlling such a game, but it is worth da try to set up a game server xD
 

spirilis

Senior Membrane
Joined
Jul 5, 2007
Messages
2,687
MBTI Type
INTP
Enneagram
9w1
Instinctual Variant
sp/sx
haha, that's badass. I dunno if an AVR would be too useful for modern internet usage, but controlling and reporting sensor information sounds like a cool idea.

I wish I could get my hands on one of those "tongue-electrode" things I've read about like this; wouldn't it be BAD ASS to create your own body sensors? say, I dunno, connect various metrics about your car to an AVR, then have that stimulate the tongue to relay this information...

haha you could turn yourself into a cyborg :)
 

runvardh

にゃん
Joined
Jun 23, 2007
Messages
8,541
MBTI Type
INFP
Enneagram
6w7
Instinctual Variant
sx/so
I messsed with really small scale stuff in college, but man was it fun. Almost wonder if I should get back into it again.
 

spirilis

Senior Membrane
Joined
Jul 5, 2007
Messages
2,687
MBTI Type
INTP
Enneagram
9w1
Instinctual Variant
sp/sx
Lol almost posted a new thread about this stuff, then did a search and found this. Been getting into AVRs a LOT lately... upgraded my old Arduino NG USB board to the ATmega328, also bought the Arduino Mega ADK (for interfacing custom hardware with Android phones) and I'm dabbling with some "arduino-alternative" boards that use the AVR ATmega1284P processor (possibly the best of all the AVRs for DIY et al). Also got a kit for making my own printed circuit boards, and I've been learning electronics at a greatly accelerated rate from any other time in my life when I tried to pick it up. (And it's a true hobby, money-sink and all... LOL)
 

spirilis

Senior Membrane
Joined
Jul 5, 2007
Messages
2,687
MBTI Type
INTP
Enneagram
9w1
Instinctual Variant
sp/sx
My current project so far has been adding some basic amenities to my wife's car, she doesn't really have much at all (no keyless entry, no cruise control, no clock besides the stereo and I upgraded that but true to typical aftermarket car stereos, the clock isn't visible all the time when the song title is scrolling... etc) so I'm trying to shore that up. Designed the "gadget network" around I2C, using buffering chips to extend the usable distance of I2C so I can leverage I2C-addressable sensors but also do the I/O with the built-in serial hardware on the Atmel AVRs. Using CAT5 cabling for everything with my own custom pinout that supplies power, the SCL/SDA lines for I2C, a line for Dallas 1-wire (for the temperature sensors) and a final wire that is driven by a pair of FETs which shows +5V if the ignition switch is on, GND if it's off (to give all attached devices the option to shut off/go to sleep if they're wired or programmed to pay attention to that).

Might take some pics once it's completed... the first component I had to build was a power supply/RJ45 concentrator board that links all the data busses and supplies +5V from a switching regulator (since AVRs can't handle the standard +12VDC voltages a car uses)
 

Not_Me

New member
Joined
Jan 16, 2008
Messages
1,641
MBTI Type
INTj
Interesting projects! I use both the PICs and AVRs. Both have their advantages. Microchip will send you their chips for free if you qualify.
There's a lot of AVR projects here: http://www.avrfreaks.net/

It is good to understand how to program in assembler, but if you program in C, it makes it easy to use other processors. For example, you can get an order of magnitude higher performance by using the ARM Cortex chips. They don't cost much more.

Recently, many companies in China will produce PCBs for you in small quantities for a very reasonable price.($10-$20) I am still doing most by toner transfer since it's much faster than waiting weeks for shipping. But for semi-commercial projects, the off-shore companies opens up possibilities.
 

spirilis

Senior Membrane
Joined
Jul 5, 2007
Messages
2,687
MBTI Type
INTP
Enneagram
9w1
Instinctual Variant
sp/sx
Yeah I do toner-transfer but this atmega1284P arduino shield-compatible board I'm playing with was created by Iteadstudios I think (by one of the folks on arduino.cc)... Beautiful board, having rolled a number of single-sided toner transfer boards I drool over the detail.

I'd heard about PIC years and years ago, they were practically a gold standard in MCUs for a lot of applications were they? My thoughts is that I should stick with AVR since I know it well enough now, and dabble in ARM Cortex when I need to move up... Although I did just get my hands on that $4.30 TI LaunchPad thingamajig. Too many toys, not enough time!

Another near-future project I intend to complete is a MIDI postprocessor for some Yamaha toy digital drumset I bought years ago... it has a firmware bug where the hi-hat pad only sends an open-hihat MIDI instrument regardless of whether the pedal is depressed or not. Was going to pass the pedal signal through an AVR and passthru back to the drumset, then clean that bug out of the MIDI stream, and also add the ability to inject play-along MIDI programs triggered/initiated by a drum hit or whatever... haven't thought the last part out too much, but I am receiving a couple ATmega32U4 processors and I'm going to build that project as not just a MIDI postprocessor but an actual MIDI-USB adapter (I've seen a project where someone did that with the ATmega8U2 shipping with newer Arduino Uno and Megas, so I'll try to adapt that code for my uses)
 

Not_Me

New member
Joined
Jan 16, 2008
Messages
1,641
MBTI Type
INTj
With toner transfer, I can easily do double sided surface mount boards. I've been using magazine paper, so I kept the trace/spacing at 15 mil because paper fiber tended to get stuck between the traces. They need to be removed by hand. I recently switched to HP presentation paper. I didn't etch yet, but a test transfer with 8 mil traces went perfectly. The paper lifted off by itself after less than 5 minutes of soaking, leaving a perfect, etch ready board. I etch with copper chloride, which can be regenerated indefinitely.

I like the AVR better than the PICs but the latter has a DSP variant that can do math very quickly. I've been experimenting with stepper motor and servo motor controllers.
 

spirilis

Senior Membrane
Joined
Jul 5, 2007
Messages
2,687
MBTI Type
INTP
Enneagram
9w1
Instinctual Variant
sp/sx
Someone (old EE guy) suggested Staples 32lb Glossy Color Laser paper, I've been giving it a try so far with success. A board with some 5.9mil spacing experienced failure (copper bridging) in 1 out of 24 instances so I know that's pushing it beyond the limit but I think 7mil+ should work perfectly.
 

spirilis

Senior Membrane
Joined
Jul 5, 2007
Messages
2,687
MBTI Type
INTP
Enneagram
9w1
Instinctual Variant
sp/sx
Good question, didn't really get a good inspection of it before the etch. I found it after the fact.
Could have been toner smear as I suspect my printer is laying down the toner pretty heavy. I could try backing off the settings but TBH ..... I'd rather leave it alone, it works well enough :)
 

spirilis

Senior Membrane
Joined
Jul 5, 2007
Messages
2,687
MBTI Type
INTP
Enneagram
9w1
Instinctual Variant
sp/sx
Well, my big project for my wife's car is finally installed (or in a state of being installed...) and I've had enough playtime to tinker and figure out things that have gone wrong.
1. The digital compass (LSM303DLM 3-axis magnetometer+accelerometer used as a tilt-compensated compass) needs calibration, or rather, the user needs to develop the appropriate high & low readings for the magnetometer axes to get a reasonable amount of accuracy. It also feels like there's a slight bias in the reading, but I wonder if that has to do with Magnetic North vs. True North, which I am not compensating for yet. The surface where it's mounted I believe is flat and parallel to the frontward direction of the car, but that could be slightly off too.

For now I've adapted the firmware (using Arduino 1.0 to an ATmega1284P target) to continually evaluate the response of the magnetometer and compare to its own known max/min values, if the new reading pushes that further it will update its max/min and commit the new values to EEPROM. It was fun taking it on a ~30 mile drive tonight and watching it learn and become more stable & accurate.

2. A power-off switch on the PSU board in the trunk ... I am just going to desolder, as I have suspicions the switch is somewhat loose/flaky and accidentally trips when you slam the car door sometimes, turning everything off. There's a wire brought out which turns off the PSU when it's attached to GND (exact same thing as that switch onboard the PCB does...) and the 12V power feed inputs use barrel-type quick disconnect fittings so it's easy to disconnect anyhow.

Otherwise, I need to get my under-hood external temperature sensor done (found a pre-drilled hole in the firewall which I may be able to use to route the cable between the interior & under-hood, which helps me a LOT) and then it's a fully-functioning "phase 1" implementation of the project. Currently it has a 16x2 LCD display showing time, compass heading, temperature from inside the trunk, and the date on the bottom line. I'll take pics soon.
 

spirilis

Senior Membrane
Joined
Jul 5, 2007
Messages
2,687
MBTI Type
INTP
Enneagram
9w1
Instinctual Variant
sp/sx
Any of the uC nerds in here use Renesas microcontrollers before? I apparently "qualified" for one of those free RX62N development kits (link) and just got it today.... Slick board, lots of hardware, and the uC looks like some sort of ARM Cortex-M competitor of sorts. From further reading that appears to be exactly what it is--a Japanese show of force against the ARM hegemony I guess (lol). First time touching a 32-bit MCU though. I haven't installed the development software yet.

http://am.renesas.com/products/mpumcu/rx/index.jsp
 

Not_Me

New member
Joined
Jan 16, 2008
Messages
1,641
MBTI Type
INTj
I used the 16 bit versions. The most notable feature was that it had 2 sets of working registers so that it was not necessary to save the data to the stack during an interrupt. The worse feature was the compiler user guide. It was nothing more than pages after pages of screen captures with obvious comments. "Click on FILE and the file menu will pop up."

Low cost micro-controllers have gotten so powerful that I rarely select one based on the architecture. I usually go by peripherals and the quality of the free development tools.
 

spirilis

Senior Membrane
Joined
Jul 5, 2007
Messages
2,687
MBTI Type
INTP
Enneagram
9w1
Instinctual Variant
sp/sx
I used the 16 bit versions. The most notable feature was that it had 2 sets of working registers so that it was not necessary to save the data to the stack during an interrupt. The worse feature was the compiler user guide. It was nothing more than pages after pages of screen captures with obvious comments. "Click on FILE and the file menu will pop up."

Low cost micro-controllers have gotten so powerful that I rarely select one based on the architecture. I usually go by peripherals and the quality of the free development tools.

Lol @ the compiler manual, that sounds bad. So far the tools look promising but that's because some company (KPIT Cummins?) ported GCC over to it, called GNURX, and it integrates both with Renesas' HEW IDE and KPIT's own version of Eclipse (although I couldn't get the KPIT GNURX tools to recognize the Eclipse install, oddly enough, but it does integrate with the HEW IDE). The RX chips sound neat, with plenty of connectivity but from what I gathered on their site's parts list, most of the small-pin count USB ones are still "in development" and not released. The ones with USB peripherals currently available for purchase are 100+ pins (a tad less friendly for DIY work, IMO). Anyway the board was free, so I figured I'd give it an honest look.
--edit--
Almost forgot, there was a free book written (basically a college textbook) that features the dev board & chip- http://am.renesas.com/media/product...rx62n/child/RENESAS_RX62N_MICROCONTROLLER.pdf
Looks like it's written for the newbie, literally for a college course on embedded systems development, but I'm going to skim through and see what I can get out of it.
 

Not_Me

New member
Joined
Jan 16, 2008
Messages
1,641
MBTI Type
INTj
The RX chips sound neat, with plenty of connectivity but from what I gathered on their site's parts list, most of the small-pin count USB ones are still "in development" and not released. The ones with USB peripherals currently available for purchase are 100+ pins (a tad less friendly for DIY work, IMO). Anyway the board was free, so I figured I'd give it an honest look.
The pin count tends to be excessive in the higher end processors. I been using the DSPIC for my DIY projects, primarily because they are available in user friendly packages.

The RX looks like a very capable chip. I'd be interested in what you think of the development environment. The kit would be much more useful if it allows the onboard JTAG debugger to be used on other chips.
 
Top