![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| Hello everyone, I am attempting to attach my Displaytech 161A (Datasheet here) to an Atmega16. I have not succeeded so far. The 161A is an 8-bit display. I have used the specs of this table found in the help file of my compiler: Code: LCD DISPLAY PORT DB7 PORTB.7 DB6 PORTB.6 DB5 PORTB.5 DB4 PORTB.4 E PORTB.3 RS PORTB.2 RW Ground Vss Ground Vdd +5 Volt Vo 0-5 Volt Just in case somethings wrong with that: Here is the code for the Atmega: Code: $regfile = "m16def.dat" $crystal = 8000000 Config Lcd = 16 * 1 Do Display On Cls Lcd "Hello world..." Wait 2 Cls Lcd "Hello me..." Wait 2 Display Off Loop
__________________ Seize the time, and seize it now! | |
| |
| | (permalink) |
| Well, I can't comment on the code specifically since it appears to be BASIC. You should verify the connections - BASIC is making assumptions about the pinout. Secondly, check contrast. I've had the situation where I couldn't get the LCD to work and it turned out I just had to turn the contrast up. Finally, I'm a little skeptical of the init sequence that canned LCD code does. some of the H44780 controller clones can be a bit fussy about that. If the clock frequency is different that what library code expects it won't work correctly. | |
| |
| | (permalink) |
| What am I supposed to do with the left ports of the display?
__________________ Seize the time, and seize it now! | |
| |
| | (permalink) |
| if you mean db0-db3, do nothing. | |
| |
| | (permalink) |
| The contrast is controlled through the voltage applied to V0, is that correct? If so, I will obtain full contrast by connecting V0 to VDD? Because that is what I have done. I have also used a method to tell the compiler which ports of the display are connected to which ports of the microcontroller. But I still can not see anything on the display. Is there a possibility that the atmega16 is not compatible with these 8-bit displays at all?
__________________ Seize the time, and seize it now! | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) | ||
| Quote:
Note: Adjust to make these blocks just visible. Too dark then you might not see the actual display characters. Quote:
__________________ L.Chung Last edited by eblc1388; 16th October 2006 at 09:44 AM. | |||
| |
| | (permalink) | ||
| Quote:
Quote:
You shouldn't really be messing around with LCD's unless you've read (and printed out) the EPE article. http://www.epemag.wimborne.co.uk/lcd1.pdf http://www.epemag.wimborne.co.uk/lcd2.pdf | |||
| |
| | (permalink) |
| What potentiometer would I use for this (value, lin/log)? I am sorry, I can not open the PDFs right now (at work) and the datasheet for the display does not seem to reveal anything useful, but I would greatly appreciate any help with that, so I could buy the potentiometer, because there is an electronics shop close to where I work. I know, I am impatient
__________________ Seize the time, and seize it now! | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) |
| Okay, I have connected the contrast through a pot and pulled RS high with 10k. I can see something, but it is only black blocks, no matter if a microcontroller is connected or not. I assume something is wrong with the code???
__________________ Seize the time, and seize it now! | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) |
| Hi, Just a tip, sometimes, using 4-bit mode...leaving D3-D0 unconnected causes problems, I think this is down to the LCD, but I don't know why people leave them unconnected...floating inputs is just a bad idea. Connect the unused inputs to GND. it can't hurt, it just stops them floating and picking up god knows what noise when you're setting up for 4-bit mode (so it ignores the lower nibble). Is your micro running at 5v as well? Not sure if 3.3V I/O's would cut it on a 5V LCD. As for Contrast, any preset will do, preferably 10k+, its just a voltage divider, and the Vo contrast pin hardly draws any current at all. You could add a 100k resistor in series with it (VCC side) to use the full range of the pot (usually anything above 1v to Vo is useless). When you've powered it up and initialiased it...give the pot a wiggle.....16x2 lcd's have a test pattern where the *top* line is just black blocks (unless the LCD is negative To be honest, I've spent ages debugging an LCD circuit before, and in my case, its always been hardware, just silly mistakes like wrong connections. Connect everything that needs to go to GND, then the VCC pin, then contrast (Vo) so you're just left with the 4 data lines, R/W, and E. Then connect them up, fire up your micro. If you've checked everything several times, its software. As for your micro not being 'compatable' with the LCD, I seriously doubt it. Let us know how you get on. Blueteeth. Ps: Sorry if I've repeated some stuff that Nigel has suggested, don't wanna steal anyones thunder, he's probably the best person to ask about micros+LCD's anyway.
__________________ Inconsistency is the key to flexibility! | |
| |
| | (permalink) | |
| Quote:
Pull these to ground would just increase the overall LCD current consumption with no benefit at all. I have no idea about other LCD controllers except HD44780.
__________________ L.Chung | ||
| |
| | (permalink) | |
| Quote:
It's normal to leave them 'floating', because (as mentioned by eblc1388) they already have pull-ups - so don't float!. | ||
| |