microcontroller thread #3

Status
Not open for further replies.
cato said:
yeah, I am not worried about the compiler, I already found a few. what I meant was that it is hard to follow a LCD tutorial when you don't know the programming language =].
LCD's do not have a programming language.

LCD's operate on digital ones and zeros

the most obvious reason you cannot find any tutorials in C/C++ is because most actuators are analog based with some being digital.
unless the situation has changed drasticly your I/O chip will be programmed in assembly language.
the chips i am familiar with operate on bytes
for example you would send the chip a control byte to configure it
the chip will put a byte on the data bus or it will latch a byte off the bus

like i said unless the situation has changed you will need to learn assembly for your pic
 
there are several compilers out there that can turn C into assembly. I did it all last semester with the 68hc11 I was working with. what I meant was, it was hard to see what operations the person's program were performing without understanding the language.
 
hmm, I think I figured out a project. I think I will try and make an autonomously guided vehicle, on a small scale. unless you guys have a better way, I was thinking about making the little robot-car have a directional antenna, that would rotate, and 2 NDBs (non-directional beacons) to allow triangulation of position. I could narrow the width of the antenna down really far, so I could get a precise measurement of the two signals.

what do you think?
 
I think that three beacons would be better. You could also use a pair of dipole antennas at right angles to each other so you don't have to deal with the rotating mechanism.
 
MetaKron said:
I think that three beacons would be better. You could also use a pair of dipole antennas at right angles to each other so you don't have to deal with the rotating mechanism.
you could feed one dipole a certain frequency and the other a different frequency.
 
They read the same signal and the ratio determines the vector. Even with a moving antenna it takes some doing to get a good front to back ratio so you need three beacons at three different frequencies to be able to get three lines that intersect.
 
i think blue_uk was thinking about a sonar type of deal to measure their room.
that is very hard because you don't know what you are looking at, all you know is how far away it is. with 3 external signals for guidance, you can figure out exactly where you are, and where you are going.
You could also use a pair of dipole antennas at right angles to each other so you don't have to deal with the rotating mechanism.
that sounds good, but I will have to figure out how dipole antennas work. I have never dealt with them before. I am sure I can figure it out though. I will go to wikipedia =]
 
ok, I think I understand dipole antennas enough to use them. although, I am nore sure how I can get around making it rotate.
 
Cato, are you trying to make a device that displays a caller ID, or simply trying to interface an LCD unit?

I've got the LCD working, if that helps

edit: I say 'the', I mean the standard Hitachi interface that 99% of 2x16 alphanumeric LCDs use.
 
yeah, I am not sure what I am going to do first. also, I may not end up doing a project until winter, since fall (college) is coming so fast. I need a project I can do in a month =]. which is why I wanted to do the LCD thing. however, I would like to automate something. like a robot arm, or little car, or something.

edit: but yeah, I was just trying to use the LCD. I don't really want to make a caller ID.
 
Last edited:
You should know that to use the LCD is actually very easy. What is not easy is to initially grasp the initialisation steps. The HD44780 (any 2x16 LCD you buy on ebay will most likely use this controller) needs to be sent some data to start up. The sequence - and the timings - aren't intuitive (at all). E.g. to start up: wait 15ms, send 0x18, wait 5ms, send 0x18 again, wait 100us, send 0x10, wait 40us.

Unlike many things where you can build up slowly, correcting as you observe the progress - all of this (and more) needs to be done before anything visible happens.

I was pulling my hair out trying to decipher the datasheets. I gained confidence, however, by downloading other people's routines and seeing how they worked. (I can give you the 'C' code if you like).

I strongly recommend trying to get an LCD to work, as they're cheap and provide useful experience.

Here's a picture of a simple program in action that runs a timer and converts the binary into decimal and into then ascii.

<a href="http://img96.imageshack.us/my.php?image=2607060131bg7.jpg" target="_blank"><img src="http://img96.imageshack.us/img96/2708/2607060131bg7.th.jpg" border="0" alt="Free Image Hosting at www.ImageShack.us" /></a>
 
ok, I will try that. I will go to goodwill sometime and pick up an LCD for like 1$ and see whats inside (chip wise).
 
eh, I could not find anything at goodwil. perhaps I should just get one off ebay.
 
Last edited:
hey everyone! I got my programmer finally. well, it came Monday, but I was at work, and cold not get it till today.

anyway, does anyone know of a sample program I could use just to make sure everything is working fine? its a PIC18FL458.

I don't want to start programming until I test everything, what a waste of time that would be =].
 
uhh, I downloaded some MPLAB stuff with the c18 compiler addon, but I don't know how to compile =].

does anyone hae experience with MPLAB and/or C18?
 
Status
Not open for further replies.
Back
Top