![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
Hi Robert,
Maximum respect. I give thanks for all your help. I am working on the device and I will tell you the outcomes as soon as I finished. I hope this time things will go the right way. Thanks! Ras Creation King |
|
|
|
|
|
|
(permalink) |
|
Ooops! I nearly forgot, I connected the LCD in 8 bit mode to the PIC. I use PORT B as outputs for the LCD Data.
Thanks for the link... Ras Creation King |
|
|
|
|
|
|
(permalink) |
|
I have also write date , month , year, hour,min,sec, day with seven segment display ,at89c51,ds 12887. but some problem the rtc cant send acurate time , some time it send after one month 1min delay or fast. so i want to divert with ds1302 and pic 16f72. iam new with pic, can u send me full asm code for multiplex seven segment display set button etc.
I am waiting for ur reply |
|
|
|
|
|
|
(permalink) |
|
Would you like fries with that order?
Like I have said, this is old code, and at that time I was using a serial LCD. The routines to read and set the clock will probably work for you, but you may have to make some minor changes. If you want some help with your project, then start out with what you want to do. Try writing the code your self, and if you have some problems, you can get some help getting things to work. Here are some links to get you started with 7 segment displays: http://www.google.com/search?q=7-segment+using+PIC This is what you should have done first. The first hit is Nigel's tutorial for using 7 segment displays (something you might know if you spent enough time looking on this board: http://www.winpicprog.co.uk/pic_tutorial10.htm Here are some others: http://www.mikroelektronika.co.yu/en..._08chapter.htm http://microengineeringlabs.com/reso...les/ledart.htm |
|
|
|
|
|
|
(permalink) |
|
Can u Help me to send ur programme? I can change it myself. otherwise it will be take time.
please help |
|
|
|
|
|
|
(permalink) | |
|
Quote:
I am currently working on a project RTC DS1307 with 16f877,so i would be very glad if you share your source code with me. Thanks |
||
|
|
|
|
|
(permalink) |
|
[quote=pyrodigy]Hi phamthaihoa,
I am currently working on a project RTC DS1307 with 16f877A CAN YOU SEND ME PLEASE CODES ON MY EMAIL ADRESS MY EMAIL ADRESS IS FALSAMI@YAHOO.COM I M WAITING YOUR REPLY THANX |
|
|
|
|
|
|
(permalink) |
|
it is use keil for at89c51 and ds1307.
simulate with proteus |
|
|
|
|
|
|
(permalink) |
|
Greetings Everyone!
After some time putting things together, I have thought to come up with the project that will monitor the BATTERY VOLTAGE(24 V) and display it on LCD.I am currently researching about the similar design. I thought it will be best to share this with my Online friends and tutors to help me with ANALOG to DIGITAL converter using PIC16f877 to monitor input(Battery) voltage and display it on LCD. Any help is greatly appreciated. Yours Truly, Ras Creation King |
|
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) |
|
SIR, Phamthaihoa
i read ur quote that u have code for Pic16f877a with rtc ds1307, sir need ur help i want to develop code for display date/time in normal and while taking reading with the any detector signal which is 0-5volt Analog and does 10bit adc and display result in precentage 0.0-100.0% on LCD 16x2 and keep hold till button is not pressed for other reading and then store that read with date and time in its flashmemory. and suggest keypad numder is required for clock setting and other perpuse. thank u PK SURYA "Originally Posted by phamthaihoa If you use DS1307, i will post my source code I done 1 year before. I've done it, I used 16F877A and DS1307, display year, data, time on LCD 16x2." |
|
|
|
|
|
|
(permalink) |
|
Sigh, if only you knew how easy this would be in a higher language such as Proton PIC Basic..
Code:
Device = 16F876
Xtal = 4
ALL_DIGITAL = True
PORTB_PULLUPS = True
' Setup the LCD
LCD_DTPIN = PORTB.4
LCD_RSPIN = PORTB.2
LCD_ENPIN = PORTB.3
LCD_INTERFACE = 4
LCD_LINES = 2
LCD_TYPE = 0
' Define I2C bus ports
SDA_Pin = PORTA.0 'DS1307 SDA pin
SCL_PIN =PORTA.1 'DS1307 SCL pin
Dim Temp1 As Byte
Dim Temp2 As Byte
Dim TempVal As Byte
Dim Secs As Byte
Dim Mins As Byte
Dim Hrs As Byte
Dim day As Byte
Dim Date As Byte
Dim Month As Byte
Dim Year As Byte
Dim Ctrl As Byte
Dim Secs_last As Byte
'Initialize LCD
Delayms 100
Cls
' Set initial DS1307 time / Date
Secs = 0 ' Set seconds
Mins = 30 ' Set minutes
Hrs = 12 ' Set hours
Day = 1 ' Set day of week value
Date = 30 ' Day of month value
Month = 11 ' Month value
Year = 6 ' Year value
Ctrl = 0 ' Set the control byte (leave as 0 in this example)
' The DS1307 works with data in BCD format, so convert BIN to BCD
TempVal=Secs
GoSub BIN_TO_BCD
Secs=TempVal
TempVal=Mins
GoSub BIN_TO_BCD
Mins=TempVal
TempVal=Hrs
GoSub BIN_TO_BCD
Hrs=TempVal
TempVal=Day
GoSub BIN_TO_BCD
Day=TempVal
TempVal=Date
GoSub BIN_TO_BCD
Date=TempVal
TempVal=Month
GoSub BIN_TO_BCD
Month=TempVal
TempVal=Year
GoSub BIN_TO_BCD
Year=TempVal
BStart
' The datasheet specifies the first byte is 1101000x where x is read(1) or write(0).
' The second byte tells the DS 1307 where to start reading, 0 is at the start.
' The Ctrl byte contains advanced features, read the datasheet for more info
Busout 11010000, 0, [Secs, Mins, Hrs, day, Date, Month, Year, Ctrl] 'Write initial values for time / Date
BStop
Delayms 20
Main:
BStart
' The datasheet specifies the first byte is 1101000x where x is read(1) or write(0).
' The second byte tells the DS 1307 where to start reading, 0 is at the start.
BusIn 11010001, 0, [Secs, Mins, Hrs, day, Date, Month, Year, Ctrl]
BStop
' The DS1307 sends it data in BCD, therefore it must be changed to
' BIN so that it can be easily used (eg, print onto an LCD)
TempVal=Secs
GoSub BCD_TO_BIN
Secs=TempVal
TempVal=Mins
GoSub BCD_TO_BIN
Mins=TempVal
TempVal=Hrs
GoSub BCD_TO_BIN
Hrs=TempVal
TempVal=Date
GoSub BCD_TO_BIN
Date=TempVal
TempVal=Month
GoSub BCD_TO_BIN
Month=TempVal
TempVal=Year
GoSub BCD_TO_BIN
Year=TempVal
If Secs - Secs_last = 0 Then Goto Main 'If there is update in Secs, display time and Date
' The Dec2 modifier makes sure that each value will have 2 characters, eg 1 becomes 01
Print At 1,1,"Time: ",Dec2 Hrs, ":", Dec2 Mins,":", Dec2 Secs
Print At 2,1,"Date: ", Dec2 Date, "-", Dec2 Month, "-", Dec2 Year
Secs_last = Secs
Goto Main
BCD_TO_BIN: ' Convert the BCD values into BIN
Temp1 = $0F & TempVal ' Clear off the top four bits
Temp1 = DIG Temp1, 0
Temp2 = TempVal >> 4 ' Shift down four to read 2 BCD value
Temp2 = DIG Temp2, 0
TempVal = Temp2 * 10 + Temp1
Return
BIN_TO_BCD:
Temp1 = Dig TempVal, 0 ' GET THE DEC DIGIT FOR THE FIRST NIBBLE
Temp2 = Dig TempVal, 1 ' GET THE DEC DIGIT FOR THE FIRST NIBBLE
Temp2 = Temp2 << 4 ' MOVE NUMBER OVER TO 2ND NIBBLE
TempVal = Temp1 ^ Temp2 ' XOR THEM TOGTHER TO MAKE THE WHOLE BCD NUMBER
Return
Click here to watch this circuit in action
__________________
Spency. PIC Micro's - Your mind is the limit PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net |
|
|
|
|
|
|
(permalink) |
|
Can any of you help me in getting the instruction sets and thier functionalities for PIC16F877. Please give me the link.
__________________
Thanks & Regards Vinodh Simon |
|
|
|
|
|
|
(permalink) |
|
__________________
Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ |
|
|
|
|