24 Hour Heating Timer for RTC MIAC

For MIAC users to discuss projects, applications, and any other issues related to the MIAC unit.

Moderators: Benj, Mods

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by acestu »

Hi Enamul,

I have tried new code but same thing happens, maybe there is something wrong with the MIAC ?

I don't know, just a thought but is there an updated file for the MIAC perhaps..

I might try and modify the code tomorrow so that it will work on the pic18f4580 that is already set up next to my slave, and that would eliminate the MIAC,

What do you think ?

thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by acestu »

Hi Enamul,

I don't know why it does this but if I try and put 08 mins in the periods I get an error, is that causing anything ?
period_error.jpg
period_error.jpg (31.18 KiB) Viewed 24492 times
thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by Enamul »

Hi
You can ignore the problem by just putting "8" rather putting "08". I have noticed this issue too. I have to ask Jonny why is that happening.
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by Enamul »

I might try and modify the code tomorrow so that it will work on the pic18f4580 that is already set up next to my slave, and that would eliminate the MIAC,
That's very good idea
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by acestu »

Hi Enamul,

Not having much luck, I have just tried programming the 4580 with the code, but the dev board has destroyed the 2 chips that I have saying that programming failed and so on, so I think that there must be something wrong with it.

The 1 thing that has happened is the dev board the other day said board voltage too low, so I checked the 12 volt unit and it was saying 8.7 volts, so I swapped the supply for another, I am just wondering if that has done something to the chips while the voltage was low ?

I think I will order some more chips and stick to the pickit3 as I have had no problems with it.

thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by Enamul »

I think I will order some more chips and stick to the pickit3 as I have had no problems with it.
If you are struggling to use DEVv3, you should stick to PICKIT3. I will test in my PIC18f4580 the code and let you know.
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by Enamul »

Hi Stuart,

I have made the heater control module using PIC16f877a and RTC unit and tested the timings and I found problem in starting of the first period. I have solved the issue in the code it now works in hardware. Tested for the following periods..

Code: Select all

//Period 1
HOUR1_START = 19
MIN1_START = 18
HOUR1_STOP = 19
MIN1_STOP = 19
//Period 2
HOUR2_START = 19
MIN2_START = 20
HOUR2_STOP = 19
MIN2_STOP = 21
//Period 3
HOUR3_START = 19
MIN3_START = 22
HOUR3_STOP = 19
MIN3_STOP = 23
I have modified the code for MIAC..so that you can test immediately and you don't need to wait for new PIC18f4580 IC. You can even test PIC16f877a version. I am posting that one as well. Here is the picture of my set-up..
251120121828.jpg
251120121828.jpg (56.66 KiB) Viewed 24463 times
Attachments
RTC_MIAC_HEATER_Final_V1.02.fcf
(42.78 KiB) Downloaded 569 times
HEATER_CONTROL_RTC.fcf
PIC16f877a version with 2 line LCD
(79.16 KiB) Downloaded 575 times
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by acestu »

Hi Enamul,

If I don't want the heating to come on at one of the periods, Can I turn it off by setting the on time the same as the off time, or is there another way ?

thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by Enamul »

I have to check that to let you know..bcz it's tough to say without test in hardware.
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by acestu »

Ok thanks Enamul

Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by Enamul »

Hi stuart,
I have tried to skip period 1 by setting following..

Code: Select all

//Period 1
HOUR1_START = 19
MIN1_START = 19
HOUR1_STOP = 19
MIN1_STOP = 19
//Period 2
HOUR2_START = 19
MIN2_START = 20
HOUR2_STOP = 19
MIN2_STOP = 21
//Period 3
HOUR3_START = 19
MIN3_START = 22
HOUR3_STOP = 19
MIN3_STOP = 23
It worked fine..
Then tired to skip 2nd while enabling first one..

Code: Select all

//Period 1
HOUR1_START = 19
MIN1_START = 18
HOUR1_STOP = 19
MIN1_STOP = 19
//Period 2
HOUR2_START = 19
MIN2_START = 20
HOUR2_STOP = 19
MIN2_STOP = 20
//Period 3
HOUR3_START = 19
MIN3_START = 22
HOUR3_STOP = 19
MIN3_STOP = 23
It also worked..
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by acestu »

Hi Enamul,

The other device that I have and was going to program is an 18f4580, but you have done the code for a 16f877a, can I just change the device in the program or will I have to set more parameters for the chip ?

thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by Enamul »

Here is the PIC18f4580 version..
Attachments
HEATER_CONTROL_RTC_18f4580.fcf
(79.44 KiB) Downloaded 500 times
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by acestu »

Thanks Enamul,

That's great because I can do that now...

Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by acestu »

Hi Enamul,

I have programmed the code into the 4580 but I have been trying all night to get something on the lcd screen but to no avail.

I hace changed the lcd back to a 20 x 4 instead of a 2 x 16 and written "RTC TIMECLOCK" on the third line, I then reprogrammed and the lcd now says "RTC TIMECLOCK" on the third line but that is all, would you have any ideas why the time/date is not showing please ?

thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by Enamul »

Hi,

It's really strange! I can't find anything wrong in the code..As I have tested that in hardware only changed the chip and config for PIC18f4580. Have you connected RTC module with Pull-up resistors in RC3 & RC4? Because this is similar to slave module except it can now control the heater.
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by acestu »

Hi Enamul,

I have just used the setup from before ie slave board and master board connected by can bus, but there are no resisters in c3 & c4, I will try that, I thought I just had to put an led in port b1 to test the output.

thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by acestu »

Hi Enamul, now that I have put the resisters in the circuit, the lcd is showing time/date butit is not working like the slave, it says

TIME:45:85:85
DATE:45/25/2165

thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by acestu »

Hi Enamul, have I got this completely wrong, should there be a slave unit with rtc module and a master 4580 unit, or should there now be just one board only with the 4580 code and rtc module also ?

thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by Enamul »

The program I have posted here is for standalone module for heater control without any slave or master..just need to put RTC module's SCK in RC3 and SDA in RC4 with 4.7 K pull up resistors. RB1 will control heater which you can see by LED. LCD is in PORTD<0:5>. So no CAN bus, no master & no slave just above mentioned components.
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by acestu »

Ahhh right

that explains it Enamul, you have done away with the canbus as that is only needed to communicate with the MIAC.....

thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by Enamul »

Hi Stuart,
Is it working now?
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by acestu »

Hi Enamul,

Yes it is all working now thanks and I have tested the time periods etc... :D

thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by Enamul »

Well done :D
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
AbhijitR
Posts: 300
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 283 times
Been thanked: 80 times

Re: 24 Hour Heating Timer for RTC MIAC

Post by AbhijitR »

Hi! Enamul

First of all salute to your patience, I went through all the post between you and Stuart, it was such a fantastic explanation for all the doubts, to be honest it is my first time to use RTC and your post were very helpful to understand.

Thank you again.

Regards
Abhi

Post Reply