__________________________________________________ _______________Originally Posted by BobK
To tell you the truth, i have right now 15 programs related to real time clock and elapsed time and i'm not able to use any of them...
as i said before, i don't know anything about PicBasic Pro, nor PIC, nor RTC. I just got stuck with this situation and should make it pass.. i'm simply a biomedical engineer..
so for example, i'll tell you what i did yesterdsay night. This is a program from Melanie (thanks Melanie for providint such important program) :
http://www.melabs.com/resources/samp...ted/MN1307.txt
i will not paste it here because it's too long...
but she's using PIC16F628. For me, i didn't find it; i found 16F628A which must be similar.... right?
i did the circuit as she was saying (bought 2 Lines LCD), connetions to PIC and for DS1307, there was a suspicious part in some lines she wrote:
++++++++++++++++++++++++++++++++++++++++++++++++++ +++++
" ' 10K Resistors required from PORTB.1 and PORTB.2 to Vdd
' PORTB.0 relies on weak pull-up's (for future use)
'
SQWpin var PORTB.0
' You don't actually need to wire this pin... but...
' If you're observant, you'll notice I've wired the DS1307's
' SQW to RB0. Rather than 'poll' and display the time/date
' as in this example code, you can have an interrupt
' on RB0 each second to do this. In fact if you look at
' my code for setting the DS1307 you'll see I've already
' programmed it for a 1 second 'Tick' for exactly this
' purpose...
SCLpin var PORTB.1
SDApin var PORTB.2
'
' Setting Buttons
' ---------------
' Buttons are connected between PORTB.4, 5 & 6 down to Vss
' No Resistors required - we're using weak pull-up's
'
DecButton var PORTB.4 ' Press to Decrement Button
SetButton var PORTB.5 ' Press to Set/memorise Button
IncButton var PORTB.6 ' Press to Increment Button
"
++++++++++++++++++++++++++++++++++++++++++++++++++ +++++
so i just "connected": SQWpin of DS to PORTB.0
SCLpin to PORTB.1
SDApin to PORTB.2
and for ports B.4 ,B.5 and B.6, i have put "push buttons" to ground.
and also i have put 10K resistors as she said.
so i got the same unused ports that she mentioned and was happy because i felt that it will work!
now the programming section came....
i just copied and pasted the whole program on PicBasic Pro, compiled it, things were fine.
Then, using the programmer (i'm using ICPROG), i put the PIC, chose 16F862A and programmed but it gave:
"verify error at location 0000xH"
so i retuend to the program and paid attention to some sentences Melanie wrote in the beginning:
++++++++++++++++++++++++++++++++++++++++++++++++++ +++++
@ DEVICE pic16F628, INTRC_OSC_NOCLKOUT
' System Clock Options
@ DEVICE pic16F628, WDT_ON
' Watchdog Timer
@ DEVICE pic16F628, PWRT_ON
' Power-On Timer
@ DEVICE pic16F628, BOD_ON
' Brown-Out Detect
@ DEVICE pic16F628, MCLR_OFF
' Master Clear Options (Internal)
@ DEVICE pic16F628, LVP_OFF
' Low-Voltage Programming
@ DEVICE pic16F628, CPD_OFF
' Data Memory Code Protect
@ DEVICE pic16F628, PROTECT_OFF
' Program Code Protection
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++
i tried to add "A" near each "8" but didn't work... so i noticed that i am already doing these setting from ICPROG (by checking what i need) so i removed all this section and programmed without it. It worked.
it was time to test..
LCD is just giving black rectangles.. nothing else :-( :-( !!!!
i don't know what to do... i downloaded all this program to PIC... we do not program DS1307 also? no program should be inserted inside it?
i also used a crystal for it... 32.768 as i remember...
so here it is, i explained one case...and i previously fell in many previous similar cases... no one here around me is ready to help so i just thought that maybe i can find help on the internet. This is why i am sending many posts.... i should finish this whole work by next friday... i'm working on the biomedical part and do not have too much time to sit, read manual, try exercises, build more circuits and test.... i can't lay my legs Bob! i'm working on this project 20 hours a day since 3 months! can you beleive it? so i "really" cannot sit and just be in the mood to learn PicBasic Pro and I2c and RTC.....
in case someone would be able to help i'll be grateful..




Bookmarks