RTC for Miac(Part One)

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

Moderators: Benj, Mods

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

RTC for Miac(Part One)

Post by acestu »

Hi,

Does anybody have a schematic for RTC for Miac please...

thanks in advance
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
Contact:

Re: RTC for Miac

Post by Enamul »

Hi Stuart,
MIAC has it's CAN transceiver on board..so you will see MIAC has two connection point labeled L and H which are for CAN bus. You can follow this datasheet..
http://www.matrixmultimedia.com/resourc ... C-60-2.pdf
But you have to follow the following link for more about MIAC hardware...
http://www.matrixmultimedia.com/resourc ... -guide.pdf
In page 11 of above document, you will see MIAC already has MCP2551 in it which produces CAN bus and this is needed to be connected with your RTC custom module.
You need to know a bit about CAN bus before proceeding to use that. One important issue is terminating impedance..If you have only MIAC and RTC module in the CAN bus in that case it's pretty straight forward..You can simply connect TA and TB of MIAC to have that terminating resistor in act(which actually connect 120 ohm resistor between L & H line of CAN bus)..but in RTC module end you will need to put.
I am suggesting you to read carefully the operation and programming guide..At the same time if you have RTC module in hand and PIC18f4580 or 458, you can try to interface RTC with the PIC. If you need help for that please let me know.. John's post on RTC is a good point to start :)
Enamul
University of Nottingham
enamul4mm@gmail.com

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: RTC for Miac

Post by medelec35 »

Hi Stuart,
I would like to add that if you want to connect a RTC up directly to a MIAC, with no can skills at all (you don't even have to drag a CAN component macro on to your flowchart, as the can part is already built in and woks behind the scenes) then there is the MIAC Advance expansion Module:

http://www.matrixmultimedia.com/product ... PHPSESSID=

I have created a flowchart that works with MIAC Advance expansion Module to enable you to set time and date which I can post if your interested.
Martin

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

Re: RTC for Miac

Post by Enamul »

But Martin I guess you missed Stuart's earlier post regarding RTC in MIAC..he wants have a cheap solution.
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: RTC for Miac

Post by Benj »

Hello,

For my two pence you could always use a timer interrupt on the MIAC to monitor the passing of time. Obviously if the power goes off then the time and date will have to be reconfigured but this is the cheapest solution. The next best option would probably be to get a low cost CAN based RTC module (if they exist) though there might be other options.

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

Re: RTC for Miac

Post by acestu »

Thanks for the ideas guys, I created this post knowing that Enamul was going to show me how to build a canbus rtc module for the MIAC, we agreed to do a post in this section so that it would be helpful to others. Enamul has already given me a shopping list of components which I have now received in the post. It should be a handy post for a lot of people and I can't wait to get started....

Thanks to all
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
Contact:

Re: RTC for Miac

Post by acestu »

Hi Enamul, you mention John's thread on RTC, do you have a link for that 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
Contact:

Re: RTC for Miac

Post by Enamul »

Hi Stuart,
The following link is for John's thread...
http://www.matrixmultimedia.com/mmforum ... hilit=+rtc
I have attached here a schematic for RTC module interfacing with PIC...
LCD is connected to PORTD so that PORTB remains free as CAN bus is in PORTB.
In the code there is macro called FIRST_TIME in which you can set initial time which will be tracked by EEPROM..so if power cut happened and RTC module has it's coin battery..Time will be maintained and next time when powers up you will see real time.
Attachments
RTC.png
(25.38 KiB) Downloaded 13083 times
RTC_PIC18f4580.fcf
(42.82 KiB) Downloaded 446 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
Contact:

Re: RTC for Miac

Post by acestu »

Hi Enamul,
On your schematic the ds1307 connections are different than my connections on the RTC module that i bought, I will post a pic of it so you can see what i mean..
I have SDA but not the SCK
thanks
acestu
RTCmod.jpg
RTCmod.jpg (16.89 KiB) Viewed 19432 times
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
Contact:

Re: RTC for Miac

Post by Enamul »

Hi Stuart,
SCK and SCL are same; so SCL will be connected to RC3 and SDA will be connected to RC4 and make sure that both are pull up to Vcc (+5v) by 4.7 K (which should be already in your RTC module that's why I haven't shown in diagram)
Enamul
University of Nottingham
enamul4mm@gmail.com

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: RTC for Miac

Post by medelec35 »

Enamul wrote:But Martin I guess you missed Stuart's earlier post regarding RTC in MIAC..he wants have a cheap solution.
Sorry, I did not read that post prior to reading first post within this thread.
Martin

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

Re: RTC for Miac

Post by acestu »

Thanks Enamul

I will have a go at building this on a breadboard tomorrow

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
Contact:

Re: RTC for Miac

Post by acestu »

That's ok Martin, the more suggestions the better for me, I was going to ask you about your expansion module method anyway ie:

"I have created a flowchart that works with MIAC Advance expansion Module to enable you to set time and date which I can post if your interested."

cheers
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
Contact:

Re: RTC for Miac

Post by Enamul »

@Martin,
No problem :) No doubt that the expansion modules will make life much easier. I have a look in the operation guide and seems me superb modules.
This thread is actually Stuart has made to have idea about RTC without expansion modules. I could reply him in PM but I want to have expert opinions like MM and you guys.
@Stuart,
I guess you will be using your new HP-488 Board for programming the PIC IC. There is a 18f4580.FCD fix for PORTD LCD in minor fix list if you didn't download that yet..
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
Contact:

Re: RTC for Miac

Post by acestu »

Thanks Enamul, I will have a look for that fix now

cheers
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
Contact:

Re: RTC for Miac

Post by acestu »

Where would I find that fix Enamul, I have tried a search and looked in the forum but I can't find 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
Contact:

Re: RTC for Miac

Post by Enamul »

Hi Stuart,
Here is the link for FCD fix...
http://www.matrixmultimedia.com/mmforum ... 46&t=11000

and this is for all minor fix..
http://www.matrixmultimedia.com/mmforum ... 46&t=11214
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
Contact:

Re: RTC for Miac

Post by acestu »

Hi Enamul, thinking about it will I need these fixes because I have only just bought Flowcode 5 and it is version 5.4.

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
Contact:

Re: RTC for Miac

Post by Enamul »

Actually your version I think is 5.4 what you bought. Although you bought recently, still you need those fix as in next release may be 5.5 or later those fixes are going to be effective..so your version is same as us..And need those fix.
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
Contact:

Re: RTC for Miac

Post by acestu »

Ok I will update it tomorrow...

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
Contact:

Re: RTC for Miac

Post by acestu »

Hi Enamul, I downloaded the fixes but how do I install them, do I just overwrite the originals in the Flowcode folder ?

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
Contact:

Re: RTC for Miac

Post by Enamul »

Hi,
In the Flowcode folder you will get an FCD folder..just overwrite the existing one with the new one..I guess you did that right..
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
Contact:

Re: RTC for Miac

Post by acestu »

HI Enamul, No I haven't done it yet I thought I would ask you first, I will do it now.

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
Contact:

Re: RTC for Miac

Post by acestu »

Hi Enamul, I think I may have the wrong chip, it says pic18f458-I/P on it and not pic18f4580 when I try to programme it with my pickit 3 it says invalid device, have you any ideas ?

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
Contact:

Re: RTC for Miac

Post by Enamul »

Hi,
That's why I asked you earlier which one you bought. I will change the code and check fcd and config..Just wait for a while..
Enamul
University of Nottingham
enamul4mm@gmail.com

Post Reply