Page 7 of 10

Re: RTC for Miac(Part One)

Posted: Tue Oct 16, 2012 10:29 pm
by Enamul
Hi stuart,
No. I am just assuring you that program is fine after changing to 2 line. This is same as 4 line version. so switch causes some issue..I can't find out where is the problem in your case..That's why I am suggesting you to try in PIC18f458.
Even if you have PIC16f877a we can try on that to make sure..there is no hardware issue; just programming issue.

Re: RTC for Miac(Part One)

Posted: Tue Oct 16, 2012 10:43 pm
by acestu
Ok Enamul

thanks for that, the LCD should be here tomorrow and if that does not work I will put another board together with a different chip...

thanks
Acestu

Re: RTC for Miac(Part One)

Posted: Sat Oct 20, 2012 5:34 pm
by Enamul
Hi stuart,
Have you got your LCD in hand and how is your test going on? If setting does't work...still we can start transfer data from slave to Master to show in master.

Re: RTC for Miac(Part One)

Posted: Sun Oct 21, 2012 1:13 pm
by acestu
Hi Enamul,

I have replaced the LCD with the new 4 line one and tried to program the chip (18f4580) with the original 4 line LCD code on my Matrix Dev board, but when I try it opens up the chip configuration window and stops....I had a quick look and Watchdog timer is enabled and so on..

thanks
Acestu

Re: RTC for Miac(Part One)

Posted: Sun Oct 21, 2012 2:50 pm
by Enamul
I am not sure which one you were trying..I have downloaded the program that I posted in Page6..Configuration is OK in that one.

Re: RTC for Miac(Part One)

Posted: Sun Oct 21, 2012 3:50 pm
by acestu
Hi Enamul,

I am having problems with the dev board I think it may be duff, so I have programmed the generated hex file into one of the chips using MPLAB and my Pickit 3, however it is the same as before, mode set comes on screen but the buttons don't do anything and the screen stays the same, if I dont push any buttons then I am assuming that the date will come up as per the simulation in flowcode ?

thanks
Acestu

p.s. I have ordered the Miac unit today

Re: RTC for Miac(Part One)

Posted: Sun Oct 21, 2012 4:14 pm
by acestu
Hi Enamul,

When I run the program in flowcode, if I don't push the set button then after 5 seconds the time and date show, once this happens then If i push the set button then nothing happens, is this correct ?

thanks
Acestu

Re: RTC for Miac(Part One)

Posted: Sun Oct 21, 2012 4:45 pm
by acestu
Hi Enamul, I am enclosing a pic of my setup

thanks
Acestu
setup.jpg
setup.jpg (71.44 KiB) Viewed 14555 times

Re: RTC for Miac(Part One)

Posted: Sun Oct 21, 2012 7:59 pm
by Enamul
When I run the program in flowcode, if I don't push the set button then after 5 seconds the time and date show, once this happens then If i push the set button then nothing happens, is this correct ?
Sorry i wasn't in desk..The program waits in set mode for 5 seconds to press set button..If you press by this time it should enter in set mode..But if you don't press within 5 second it will show time and date which can be anything but clock should run..normally it runs from 00:00:00 if not set. If you can't sort button feature in this one as well..no problem we can forget that for the time being..we can proceed to CAN transfer of time and date.

Re: RTC for Miac(Part One)

Posted: Sun Oct 21, 2012 8:48 pm
by acestu
Hi Enamul, I think the dev board is a duff so I have reverted to the pickit3,

I have just made a test program for the same chip ie 4 x lines of text and 2 flashing LEDs, I programmed the chip with pickit3 and it worked perfectly, I then programmed the RTC_SET program the same way and it didn't work again, so I don't know what's going on with it.

thanks
Acestu

Re: RTC for Miac(Part One)

Posted: Sun Oct 21, 2012 8:58 pm
by acestu
Hi Enamul,

I have just compared the chip options of my working test and the RTC_SET program, and the only differences are:

On the RTC_SET program port B inputs are set to digital, is this right ?

Also the Brown Out Detect is different

thanks
Acestu

Re: RTC for Miac(Part One)

Posted: Sun Oct 21, 2012 9:18 pm
by Enamul
Hi,
Yes the PORTB must be digital to work as switch..You can disable brown-out.

Re: RTC for Miac(Part One)

Posted: Sun Oct 21, 2012 9:34 pm
by acestu
OK Enamul,

Does my picture look right, the can tranceiver is dissconnected and the only things that are connected are the LCD, the 3 resisters and crystal and caps, would a 19.6 meg crystal make a difference if it is set to 20 meg ?


thanks
Acestu

Re: RTC for Miac(Part One)

Posted: Sun Oct 21, 2012 9:43 pm
by Enamul
19.66 or 20 MHZ doesn't matter..everything looks fine

Re: RTC for Miac(Part One)

Posted: Sun Oct 21, 2012 9:47 pm
by acestu
Well, I am at a loss Enamul, I think I have tried everything, It is a mystery, shal we move on then like you say

thanks
Acestu

Re: RTC for Miac(Part One)

Posted: Sun Oct 21, 2012 11:16 pm
by Enamul
Can you just go back to your RTC program that runs normally you said without setting option? Also the slave and Master CAN transmission. Is those still in working mode? If that please let me know. I will send program for slave which will have now RTC module connected to send time and date to master.

Re: RTC for Miac(Part One)

Posted: Sun Oct 21, 2012 11:23 pm
by acestu
Hi Enamul.

I have rtc board, a board with temp sensor and switch which I have taken chip off to try and get set_date working, and a board that I am trying to build the set_date on.


thanks
Acestu

Re: RTC for Miac(Part One)

Posted: Sun Oct 21, 2012 11:25 pm
by Enamul
So can you please go back to your earlier RTC circuit which one was working..

Re: RTC for Miac(Part One)

Posted: Sun Oct 21, 2012 11:31 pm
by acestu
Yes,

I have the working rtc one with rtc module battery backup

thanks
Acestu

Re: RTC for Miac(Part One)

Posted: Sun Oct 21, 2012 11:33 pm
by acestu
Pic18f458 though

Re: RTC for Miac(Part One)

Posted: Sun Oct 21, 2012 11:39 pm
by Enamul
Ok. I am sending program for that using PIC18f4580 so that we become certain that it works in 4580 as well.

Re: RTC for Miac(Part One)

Posted: Mon Oct 22, 2012 12:17 am
by Enamul
Here is the program..

Re: RTC for Miac(Part One)

Posted: Mon Oct 22, 2012 6:20 pm
by acestu
Hi Enamul,

When I use my dev board and ppp to program the chip I get this message, what do you make of this ?

thanks
Acestu
error.jpg
(91.19 KiB) Downloaded 2667 times

Re: RTC for Miac(Part One)

Posted: Mon Oct 22, 2012 7:24 pm
by JohnCrow
Hi Stuart

Ive just tried your program on my Dev board and it will program into an 18F4580 with out any problems
Left your settings as is although my board has the default 19.66MHz xtal.

Re: RTC for Miac(Part One)

Posted: Mon Oct 22, 2012 7:38 pm
by acestu
Thanks John,

I think this dev board that I have just bought is a duff, I have not managed to get it to program a single chip yet, I keep having to resort to my pickit 3, also my pc finds new hardware every time I plug the usb cable in ie I have to install the driver for the board every time I want to use it, if you look at the chip settings in the fcf file there is no code protect enabled, I think I will have to speak to flowcode about it.

thanks
Acestu