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.

how to write C coing for lcd

Status
Not open for further replies.
Is it the HD44780 based LCD? Start by displaying text on the LCD. Don't take input
from a keypad as that only complicates it further. The first place to start for information on the LCD is its datasheet. Then if you've any question about anything in the datasheet, ask here.
 
Computers are large collection of simple things. If you learn one simple thing at a time they are not difficult. But if try to start in the middle it can be daunting.

The use of a keyboard and LCD are too advanced for a first project.

Start by learning to blink a LCD then read a single switch.

Are you going to use ASM C or BASIC.

3v0 :)
 
Last edited:
i don't know which is best and easy to learn

If you do not know how to program, learning how to program and how to program on a uC at the sime time can be difficult. I suggest you spend time learning to program on a PC first then learn to program on a PC.

That still does not tell you which language to learn first. I suggest you learn C. The C you learn on a PC will be very close to that you will use on a micro controller.

There is an execlent BASIC for the PIC18F family of controlers called Swordfish BASIC. The problem is that you can not learn it on th PC as there is little standardization for BASIC. VISUAL BASIC is popular on the PC but it does not map well to Swordfish.

The complexity of a good BASIC is about the same as C.

3v0
 
ok
I saw a book called Embedded C programming and the microchip PIC in a near by book store . In that book they thought about pic 16F877A series and they give CCS C Compiler demo version software with it.
Is this book is ok
 
Last edited:
ok
I saw a book called Embedded C programming and the microchip PIC in a near by book store . In that book they thought about pic 16F877A series and they give CCS C Compiler demo version software with it.
Is this book is ok
CCS is a very good compiler. It is the first PIC compiler I purchased. The problem is the demo/free version will only use half the memory space on the 16F877A and it will only compile code for one or two chips.

Microchp has a free student version of its C18 compiler for the PIC18F family. About the only restriction is that after 90 days it turns the optimizer off. Many of the 18F chips have a large amount of memory so this is not often a problem.

Another very good compiler is the BOOSTC compiler which can be had for less then $100. It is very similar to C18.

I have not said anything regarding the book because I do not have it in front of me.

The CCS compiler is a good one. If you want a book to use CCS would be a good choice. If I were you I would prefer to start with the C18 but I do not recall any intro level books that use the C18. Perhaps another member does ?

3v0
 
kjennejohn.. Thanks for the input :D i do plan on attending college soon tho. I know nothing comes in 1 shot you have to work your way up. I just hope i find what seems to be a well rounded employer like yours. Most employers are incompetent and got the job by luck. a AS degree is what i must start with. I bet it will look nice on a resume anyway. After that i plan for a bachelors degree. I want a Associates degree first because some schools kill peole with work and i havent been to school in years. So i want to make sure i can keep up and not overwhelm myself and over due it.
 
I would suggest learning C also. But when you program a PIC, ASM is not the same as on a PC really in my view at least.

ASM for a PIC is so simple as you are limited to about 80 instructions and they are well documented. If i try to write a program in ASM for PC i would get lost so fast.

But i can write a program in ASM for PIC no issue at all.

ASM us ver time consuming. If you skip asm and goto C or BASIC, you better make sure you read datasheet good so you know what bits you are setting and stuff.

C is great for larger projects. If your blinking a LED i suggest doing it in ASM because its dead simple and you learn how the uC works with its clock and how jumps and timing are important.

So when you get to C or BASIC it will be like super simple .
 
kjennejohn.. Thanks for the input :D i do plan on attending college soon tho. I know nothing comes in 1 shot you have to work your way up. I just hope i find what seems to be a well rounded employer like yours. Most employers are incompetent and got the job by luck. a AS degree is what i must start with. I bet it will look nice on a resume anyway. After that i plan for a bachelors degree. I want a Associates degree first because some schools kill peole with work and i havent been to school in years. So i want to make sure i can keep up and not overwhelm myself and over due it.

You appear to be a quick learner and so I don't think you will struggle at college.

Mike.
 
Thanks Mike! I take that as a huge complement especially coming from you. I try hard to learn. I have some type of memory issue where i forget alot of things. Im not sure why... i went to hospital and they think im joking. they scan me and just say im fine. I think i need a second opinion.

I cant even remember what i ate for breakfast yesterday unless i really try hard. Now if you ask me what i did 2 days ago its a blank :(

But i seem to remember this stuff somewhat so i like it even more because it seems to want to stick to me. If i can remember it then its good for me.. and its fun so heh :D

I was thinking about making a digital candle where you hold a magnet to it to light it and you can blow it out also. Would be cool. I wan to do it for my son. This way he will like it and want to learn this also. Hes only 2 but he knows how to use a screw driver and drill so far so hes getting there :) (of course hes always supervised)
 
A couple of things.

Be very careful where you get the asociates degree or none of the work you do for it will apply to your 4 year degree.

I would find the 4 year collage/university you want to attend and have them recomend a 2 year program they will accept credits from. It will prevent you from spending 6 years to get a 4 year degree.

I will not disagree that from the lower level many buisnesses seem to be poorly run. But I would not go so far as to generaly say that employers are incompetent! That sort of thinking can cause problems. It pays to remember who signs the checks.

3v0

kjennejohn.. Thanks for the input :D i do plan on attending college soon tho. I know nothing comes in 1 shot you have to work your way up. I just hope i find what seems to be a well rounded employer like yours. Most employers are incompetent and got the job by luck. a AS degree is what i must start with. I bet it will look nice on a resume anyway. After that i plan for a bachelors degree. I want a Associates degree first because some schools kill peole with work and i havent been to school in years. So i want to make sure i can keep up and not overwhelm myself and over due it.
 
Last edited:
Trouble is, some things are explained and inplimented so poorly. For example, some things that use the I2C interface. Well, the datasheet gives a very bad explination of the I2C interface and there is basically no infomation off that. I failed to find any website that could explain it in any simplicity. All I have learned is it sends 16 bits down a line, with the first 8 being the address and second being the data. Well this is the most stupid thing I've heard. Good, for EEPROMs sure, but not for clocks or accelerometers since you waste quite a number of them. There is no simple solution to anything and everything is over complicated.
 
of course i dont mean in GENERAL to all employers just in general the employers i have worked for in the past.

Right now i work for a Electrical Company (electrician) (Shally Electrical) in brooklyn ny. They boss has a masters and all this and that. The only thing is he does no work at all which im not complaining about really.. i complain when he thinks he knows how to fix something without being in the field. Not all book knowledge is used in a lot of occasions. You have to use your head and think of how to fix it.
 
Trouble is, some things are explained and inplimented so poorly. For example, some things that use the I2C interface. Well, the datasheet gives a very bad explination of the I2C interface and there is basically no infomation off that. I failed to find any website that could explain it in any simplicity. All I have learned is it sends 16 bits down a line, with the first 8 being the address and second being the data. Well this is the most stupid thing I've heard. Good, for EEPROMs sure, but not for clocks or accelerometers since you waste quite a number of them. There is no simple solution to anything and everything is over complicated.

You need to consider what I2C was designed for - one simple purpose - to interconnect IC's in TV sets simply and easily, using a two wire bus. It's not supposed to be fast, it's not supposed to be 'simple', it does it's job perfectly, and what more can you ask?.

Previous to that there was no common system for doing it, and the sets were far 'simpler' and needed mechanical adjustments - preset resistors etc.

I2C allowed all chips to be controlled by the main micro, and resulted in sets that have no physical adjustments inside, all done via the remote instead.

If you think I2C is over complicated, then you're not using it for the right applications.
 
danielsmusic:

i2c saves PIN usage thats why it has a address. The only issue with the i2c is that you can only have a limited amount of the same device on board well on the same 2 lines. But its worth it if you need to save lines.(lines = pins)

Its a nice feature tho because you can effectively name your devices like if the item address is 10100110 then you can define it like:

#define eepromA 0b10100110

and if you have many its easier to use them by using there new name. The 16 bit issue doesnt waste alot of time. If you are using a fast pic/atmel around 20MIPs then you should not have any issue with speed. And once you have code ready for i2c its dead simple to implement anywhere.

I²C is simple.. im slow and i get it:
I²C - Wikipedia, the free encyclopedia

If you want to learn it i learned alot from :
I2C (Inter-Integrated Circuit) Bus Technical Overview and Frequently Asked Questions
 
Last edited:
Old cook books were written for people who already knew how to cook. They do not give amounts temperatures or general instructions. Most people can cook a meal but if they tried cooking from these books they would be lost.

Datasheets are often like that. The authors expect you already know how to cook (understand I2C) and only inform you of the additional things you need to know to use their devices.

To use a part like an I2C device you need to understand I2C, and you need to read and understand the specific datasheet. If you do not get I2C go back and have another go at understanding it.

Some things seem and maybe are stupid. But they are what they are.

3v0

Trouble is, some things are explained and inplimented so poorly. For example, some things that use the I2C interface. Well, the datasheet gives a very bad explination of the I2C interface and there is basically no infomation off that. I failed to find any website that could explain it in any simplicity. All I have learned is it sends 16 bits down a line, with the first 8 being the address and second being the data. Well this is the most stupid thing I've heard. Good, for EEPROMs sure, but not for clocks or accelerometers since you waste quite a number of them. There is no simple solution to anything and everything is over complicated.
 
to add on to it 3v0 i think they call that info in the datasheet "Preliminary" meaning only the beginning or somewhat a brief non detailed explanation like a summary. Like 3v0 said it doesnt teach you it.

To learn things like that you need my friend google he can find anything.
Use nice keywords like BUS and SPECIFICATION

So Google "i2c bus specification" and you will find:

First Link:
https://www.electro-tech-online.com/custompdfs/2008/12/39340011.pdf

Second Link: (leads to first link also)
I2C-Bus: What's that?
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top