Discussion in "Project Doubts" started by    JoshG    Feb 6, 2007.
Tue Feb 06 2007, 07:36 pm
#1
Hello,

I'm new to microcontrollers and am working on the old DS1307 project. I'm trying to run the C code on my 8051 however the software I am using is microC and this software only allows for one .c file, but as many .h files as need be. So my question is could I combine all the .c's into one and would it still run? Or am I horribly wrong?

Thanks for any advice,

JoshG
Tue Feb 06 2007, 08:58 pm
#2
Yes there is an alternative for you...
copy all the C files in the respective H files except the main C file.. eg...

copy the code from LCD.C to LCD.H and include the H file.
like that.. do for all other files except the mail clock file.. i hope you understood.
Wed Feb 07 2007, 09:11 pm
#3
Ok I think I get you I just edited all the .c files and copied their contents into their respective .h files.

I also removed from the original .c files the #include<____.h> where the line is the .h file it would have called but it is now in that file.

One question is should I delete the endif statement from the original .h file or leave it?

JoshG

PS: I included the files that I edited in a .zip file, if you get a chance could you look them over? Thanks
[/html]
Thu Feb 08 2007, 02:49 am
#4
I checked the files everything is fine.. just.. few things
well.. i was having some free time.. so i edited the files for you. i am attaching them. dont edit them now. just add them in project and compile.
Thu Feb 08 2007, 04:34 am
#5
Rickey you are so incredibly awesome, I'll have free time to check it Friday and I'll post the results.

Thanks so much
Thu Feb 08 2007, 05:21 am
#6
You are welcome
Wed Feb 21 2007, 05:38 am
#7
Sorry for the huge delay I have been busy trying to figure out where I went wrong with the C code.

I decided to at least try to see if the circuit I built was functional so I downloaded your HEX file with Micro-IDE to my Atmel AT89C51ED2 and tried to power it up. Unfortunately it seems to me that I screwed up the circuit somewhere because I'm not even displaying power on my LCD display.

Going to try and work on it some more and will get back to you later with my results.

-JoshG
Wed Feb 21 2007, 05:48 am
#8
A quick update I was able to figure out the problem with my LCD display, the 1k resistor on pin 3 was too much for the contrast so I stuck a variable resistor and dialed into the correct resistance.

Now the bad news on my display I see only 16 black boxes on the bottom of the 2X16 display. So I have to figure out what else needs to be corrected.

More later

-JoshG
Wed Feb 21 2007, 06:30 am
#9
Here's a picture of what the LCD is currently able to display what I am going to try and do is run the data pins to a bunch of LED’s to check to see if I'm even sending data to be written since the seconds need to be updated constantly I should see at least one pin have an output signal.

I'm going to assume if I am sending data then I crossed a wire or my LCD is not functioning. If no data then something is wrong with connections to the 8051.

More later

-JoshG

*Note: sorry about the image it's my camera on my phone



[ Edited Sun Mar 25 2007, 06:26 pm ]
Wed Feb 21 2007, 03:43 pm
#10
Well if you ask me.. the LCD is fine. but it is not getting initialized. and there is problem with the code inside the controller.
Just try putting simple LCD program to check the LCD is ok or not.. do not forget to check the controller connections. RST circuit and crystal..
will be waiting for your reply!

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm
Bernardwarge
Tue Mar 26 2024, 11:15 am