Discussion in "Project Help" started by    darshini    Sep 19, 2007.
Wed Sep 19 2007, 04:36 pm
#1
am doing a 3rd year project on microcontrollers.
i saw the circuit of your digital clock online
request you to plz help me out with the algorithm of your program as in just gimme an overview of what exactly ur doing.
coz i plan to write the code myself
it would be of great help

and how does one program a port bitwise
thanking you


[ Edited Wed Sep 19 2007, 04:50 pm ]
Wed Sep 19 2007, 08:57 pm
#2
Hi welcome to rickey's world..
sorry for late reply

So.. regarding your problem, can you please tell me which project you are talking about..
I have made three clock projects.. so if you can tell me which one you are talking about it will be easy for me
Thu Sep 20 2007, 03:02 pm
#3
its the one using 89C4051 without an alarm with the 16X2 LCD i have understood the basic funda.. just wanted to know the algorithm of the prog u wrote in KEIL C
Thu Sep 20 2007, 04:11 pm
#4
algo is not too difficult.. its just simple for loops which counts the value of min, sec, hr, day, date and year..
just try to go through the main function you will understand automatically..

outer loop is for year, then comes date and day.. then comes hr after that min and sec. That is the only funda..
algo is...

increment sec, when sec reaches 60, make sec variable 0 and increment min variable.. and when min reaches 60, increment hr, when hr reaches 24 increment date and day, then check if day is more than 7 if yes then make it 1 and when date reaches month's max value(which is determined according to month select) then increment month, and when month reaches 12 make it 1 and increment yr..
thats the algo. tell me if you didn't get anything.
Sat Sep 22 2007, 12:29 pm
#5
The LCD clock in the download section has a 10K hex file. Whereas the 89C51 used in the pro has only 4K ISP. can any1 explain?
Sat Sep 22 2007, 12:32 pm
#6
thats the size of file.. not the hex code
Sat Sep 22 2007, 03:38 pm
#7
hey i did understand the algo earlier.. the KEIL C was the reason of trouble.. well i will still get back in case of any trouble. btw just wanted to ask if the HEX code is perfectly correct??
Sat Sep 22 2007, 04:03 pm
#8
yes hex code is perfectly fine.. but the time might be fast or slow, because not all crystal oscillators are same.. i didn't time to optimize the code.. otherwise i could have made a better 1 sec delay...
I was a noob when i made that program lol! also... if you feel any problem just post with part of code you are having problem with
Thu Oct 04 2007, 05:06 pm
#9
void LCD_CHAR(unsigned char dat)
{
if(k<32){
if(kline==16 && position==line1)
{
kline=0;
LCD_CMD(PUTLINE2);
}
P0=0x01;
EN=0;
RS=1; //Operation is data write
RW=0;

P0=(dat&0xF0)|0x09; // Higher nibble first
PULSE();

P0=((dat&(0x0F))*16)|0x09; // Lower nibble next
PULSE();
k++;
kline++;
}
}




this is a part of the header file "LCD.h".. i wanted to know whether this implies that port 0 is to be connected t pins 7-14 of the lcd..they have earlier defined port 0.0 to 0.2 of the muC to be the control i/p of the LCD (rs rw and en)

plz lemme know asap
Thu Oct 04 2007, 06:29 pm
#10
it looks like LCD is connected in 4-bit mode..
so top 3 pins of Port 0 are connected to control pins and rest connected to data pin of LCD. Also... your doubt is more of hardware instead of code.. so post the circuit too..

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Clydehet
Wed May 01 2024, 06:44 pm
Davidoried
Wed May 01 2024, 06:11 pm
KevinTab
Sun Apr 28 2024, 05:35 am
Tumergix
Sun Apr 28 2024, 12:59 am
StevenDrulk
Sat Apr 27 2024, 08:47 pm
StephenHauct
Sat Apr 27 2024, 09:38 am
Adamsaf
Sat Apr 27 2024, 07:12 am
Robertphype
Sat Apr 27 2024, 12:23 am