Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Electronics Engineering Final Project - URGENT HELP!

Status
Not open for further replies.

JohnnyBlaze87

New Member
Hi there! I am new to this site so please be patient...lol

I am trying to do my final project for Electronics engineering but am having a lot of difficulties getting started. What I am trying to make is a simplified game console using the atmega328p microcontroller chip. I am using the uLCD-144 as my screen and number of pushbuttons for the inputs.

So, what I need help with is how to connect everything up. I know that a lot will depend on what functions I am using but I am looking for the basic way to hook everything up so I can start doing some programming. I have the datasheet for the atmega328p but it is very confusing and I dont even know where to begin. I need to create my own pcb (.brd & .sch files) using eaglecad software but as of now I am just using two breadboards.

I have a lot of other components but also am not sure what else I will need to use. (decoupling caps, resistors ect.)
If anyone has any advice or help they can offer it would be greatly appreciated.
 
What is that "lol" in this context?
 
@vizier87 - I can use PICs, but I already have a couple atmega328p chips. So I guess PICs are an option I was just planning on using what I have. I know that it is a lot to ask, I am just so flustered I don't even know where to begin..

@atferrari - I was just "laughing out loud", but this isn't really a laughing matter..

again, any help anyone has for me would be greatly appreciated.
 
Surprised you haven't had courses in microcontrollers given you're in your final year! I suspect the Atmega is arguably a better choice as its faster that even the 18F PIC's, and appears to be more C friendly - not to mention the large number of projects for that series on the web.

I understand the 'flustered' thing. My final year project was a digital wireless guitar system which took up far too much of my time (chose an ambitious one, paid for it with stress). As any engineer would do, break it down into smaller jobs - that goes for both hardware, and software. Making a very crude block diagram of what your system looks like (LCD, microcontorller, buttons, leds, sounder?) and work on each one individually until you are satisfied you can program your micro to control/read what's connected to it. The classic 'hello world' routine for the LCD, button debounce for the buttons etc..

I'll assume you're confident in writing the code for the game, as you've only really mentioned hardware - plus coding a small game is beyond me... I'm sure the makers of the uLCD-144 have example code and schematics, which you can use to make a 'test bed' just to prove you can hook things up, and get it to show something.
 
@Blueteeth - I should clarify that I have had a few courses on microcontrollers (embedded systems, micro-c, advanced micro-c) and other similar courses. So I am not a complete newbie, its just we used different micro's before (AVR Butterfly, Motorola HC11, a little bit w/Arduino) and were given a lot more guidance and instruction (i.e. circuit diagrams w/instructions on what to do). This time around I am using something I've never used before (Atmega328p - not the surface mounted one) and have no guidance or instruction which is why I am so flustered. Also, we are required to program entirely in C (im not the greatest in C but I can get by). We did the 'hello world' routine w/ our HC11's a couple years ago so its been a while. :|

I appreciate your understanding, it is beyond stressful to say the least. I have a very crude block diagram so far, but understanding all the components (apparently I need a 16mHz crystal to control the speed of the mico-c chip) and the sub-circuits that are required is what I am having the greatest difficulties with.

Also, apparently the uLCD-144 is pretty straight-forward for programming. It has a lot of built in commands that you can send to it. I am thinking of doing some easier Casino games (which I know won't be easy) like slots and blackjack, so im not sure this would be the best fit for my project.
 
@3v0 - Thanks for your reply! Would a PIC24 16-bit processor be easier to work with though? I have never used PIC's so I have no familiarity with them. Is there any other advantages?

Does anyone know of any good websites with example circuits/projects (or even just general knowledge), using the hardware mentioned above?

I know once I get rolling with this I will be in better shape (project-wise) and feel better about the overall project. To me the hardest part is starting out...
 
The Atmega328 (an AVR micro) is the 32k version (32k flash program memory = 16k instructions?) of the atmega88 (8k program memory) which is used in the arduino. Essentially, the same chip, with the same pinout, same hardware and same instruciton set. I realise the Arduino is generally used with 'wiring language', I've never used that myself, just went straight to C with the AVR's before the arduino took off. So if you've worked with the arduino already, using C, you're half way there!

If by 'micro-C' you mean the compiler 'MikroC' then thats quite a good complier for conforming to the C standard, as well as having many great built-in ruotines to set up hardware peripherals (I2C, SPI, UART, PWM etc..). The value of the crystal you use is really down to what you wish to do. 16Mhz is sort of a first port of call for many, many AVR's only go up to 16Mhz, so people just run them at full speed, the atmega328, I believe, either ha a max speed of 20Mhz, or 8Mhz (8Mhz for the low voltage one I think...). I wouldn't worry too much about a value, 16Mhz is a good starting point. Should you need instructions to be executed faster you can go up to 20Mhz, if power consuption is an issue (for portable apps) then slowing it down to 8Mhz would save power.

I would use a schematic of the arduino as a guide. Don't worry about the USB-UART part (FT232?) just the regulator, and oscillator circuits, as well as a programming header. Thats all the processor really needs, everything is just IO's which you can configure for whatever purpose you need. I generally put series resistors on all the IO pins, like 100-220ohms, because most IO's aren't required to provide much power (LED's need 15mA max, IO pins rated at 25mA, input current to a chips input is uA), and it will limit the current should you accidently set an IO as an output, and connect it to VCC/GND. Essentially safe-guarding against blowing IO pins.

All thats left is some buttons (again googling 'arduino reading buttons) and your LCD (I believe it uses the UART) and thats your testbed :) Bells and whistles can be added later should you decide to add more features - no point in adding everytinhg, using up every IO pin, then having to write code for all of that, start off small. Eg: press button 1 - LCD displays something. button 2 - lcd displays something else. Most of that stuff can be done in an afternoon :)
 
Thank you so much Blueteeth, that helps immensely. I am wondering though, which part of the arduino schematic is the regulator?(somewhere in the top left I am thinking?) The programming header is the ICSP, am I correct?

Also, where would i connect my LCD to this circuit?

You have no idea how much that helped so far! But I am still in dire straits...
 
@3v0 - Thanks for your reply! Would a PIC24 16-bit processor be easier to work with though? I have never used PIC's so I have no familiarity with them. Is there any other advantages?

Does anyone know of any good websites with example circuits/projects (or even just general knowledge), using the hardware mentioned above?

I know once I get rolling with this I will be in better shape (project-wise) and feel better about the overall project. To me the hardest part is starting out...

My feeling is that if you are going to work with video a 16 bit processor will work better because they can often do more work with a single instruction. This results is shorter machine code and faster execution. Use whatever brand of processor you like.

One advantage of using PICs is that a single programmer can be used with all they micro controllers they offer.
 
I am trying to finalize my board and schematic files still, and it is very frustrating once again!:mad:

I am confused as to where my voltage regulating circuit will be connected to the microcontroller chip.. I am not even sure I need one, do I need 3.3v for any of the functions of the atmega328p?
My LCD has a built in programming header, where would I connect this?

Also if I wanted to hook up four pushbuttons, would I just connect them to PD0-PD4 through a pull up resistor?(one side 5v +resistor, other side ground)?

Can anyone help me with this?
 
@4pyros, I realize in comparison to most posts on this message board I am asking simple or "dumb" questions but I am only looking for people who can help. If you are only here to belittle then please stop posting here. I obviously have looked at the datasheet but it is complicated and confusing. I am guessing the voltage regulating circuit is hooked up to VCC on the micro but am not entirely sure. I have looked at the datasheet for hours upon hours but it doesn't clear anything up for me.

What I was asking before was on the Arduino schematic, what part of it is the voltage regulating circuit (is it the LP2985?) What could i use instead of this?
 
@4pyros, I realize in comparison to most posts on this message board I am asking simple or "dumb" questions but I am only looking for people who can help. If you are only here to belittle then please stop posting here.
Do you have any idea how many times someone posts for "urgent help"?
Only to find out it would take years to teach them.
And now we know what we are dealing with.

Yes VCC is the power lead.
What is the VCC voltage?
What voltage source will you be using?
 
Last edited:
Calm down lads. Not everything takes 'years' to teach. I learnt more in 2 months of my own 'tinkering' with micro's and electronics than I did in 4 years of university. But we do of course get 'urgent help' posts daily, often with very little information given so I guessyou can excuse some rather sharp replies now and then.

Generally with power, often you want your micro and everthing connected to it running off the same power source. The Atmega88/168/328 most likely has a working votlage of 2.7-5.5V, 3.3V is pertty standard when not running at full speed, and if your uLCD runs on that, it makes interfacing easier (all IO's working on the same voltage).

You'll need a regulator for...well.regulation. Although you can get 5V wall power supplies, these can be noisy and should you wish to use a different power source, or accidently connect something thats over 5.5V to the circuit - sometihng will pop.

As for the push buttons, the pull ups should be connected to the same power rail as your micro.

I was thinking of writing a sticky about 'reading datasheets', because they are intimidating to students, beginners, and even 'skimmed' over by professionals. A datasheet is merely a source of informaiton and one should use it to pick out the information you need. Whether thats as basic as 'power supply voltage' or more complicated like 'address of register xxx' it is a reference for everytihng someone needs to know about the device/product in question. Sometimes I don't even bother reading one for a device, but mostly I keep going back to it, searching the pdf for specifics.

For your AVR the datasheet is obviously huge, since it has many peripherals/functions and configurations. A good place to look when considering hardware is the 'pin connections' section, listing the pin numbers, their fucntion, and what exctly that function is. Also, googling for projects using yoru micro will yeild a ton of example schematics showing what is connected to what, and you can use the datasheet to find out 'why' it is connected that way.

The above may seem patronising in some ways, but it is hard to gauge someones experience/skill/knowledge without a background, and who posts a background? so whilst so assume many are post-grads with years of work experience, I tend to err on the side of caution, and risk sounding patronising. But it does get the basics out of the way when dealing with a problem, rather than skip over them.

The LP2985 is indeed a voltage regulator. I guess pyros points was, just googling 'LP2985' one comes up with the manufacturers page, the first line being: 'The LP2985 is a 150 mA, fixed-output voltage regulator designed to provide ultra low-dropout and low noise in battery powered applications. '

I would use the first cheapest 3-pin regulator you can find which will output 3.3V, or 5V, depending on what the maximum voltage is of your uLCD. A common and cheap way is to use an adjustable regulator, the output voltage of which is set by two resistors. the LM317 is an example. As long as its rated above the maximum current your circuit will draw, it will be fine.
 
Last edited:
@4pyros - I get where you are coming from and I appreciate your response regardless. At the moment I am using a 5V wall adapter with a breadboard jack. But I am thinking of using a 9V battery (so I can use a box w/ a battery compartment) and just using a voltage regulator. The output of the wall jack is about 5.23V, is this alright for the atmega328p?

@Blueteeth - Thank you again! I am nearly finished setting up my "test bed". I am wondering, is it possible to control an LED hooked up to the micro with just a pushbutton without programming anything? I'm guessing I will need to program at least a few lines of code before I can get a blinkey LED setup going. I am going to get the AVR dragon to connect up to this but until then I am wondering if this is possible? You have been so helpful so far but I still have much to learn.
 
@4pyros - I get where you are coming from and I appreciate your response regardless. At the moment I am using a 5V wall adapter with a breadboard jack. But I am thinking of using a 9V battery (so I can use a box w/ a battery compartment) and just using a voltage regulator. The output of the wall jack is about 5.23V, is this alright for the atmega328p?
Once again you can look this stuff up your self.
From the Atmel atmega328p cover page here;
http://www.atmel.com/dyn/products/product_card.asp?category_id=163&family_id=607&subfamily_id=760&part_id=4198

The device operates between 1.8-5.5 volts.

From the data sheet;
4.0V to 5.5V range operation (single supply).

So use a 9 volt battery and one 5 volt regulater for both.

So yes you will need a regulater. What voltage two use would depend primarily on what the other stuff needs.

from Blueteeth;
Generally with power, often you want your micro and everthing connected to it running off the same power source. The Atmega88/168/328 most likely has a working votlage of 2.7-5.5V, 3.3V is pertty standard when not running at full speed, and if your uLCD runs on that, it makes interfacing easier (all IO's working on the same voltage).
What voltage is your display?
 
Last edited:
4pyros you sound like my graduate engineer. Completely unable to read anything like a datsheet and want details spoonfed.
 
4pyros you sound like my graduate engineer. Completely unable to read anything like a datsheet and want details spoonfed.
Sorry but I am not the OP!!!!
I think you mean the OP.
I think you can't read threads.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top