RTC for Miac(Part One)

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

Moderators: Benj, Mods

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(Part One)

Post by Enamul »

If your PIC KIT3 is working we can move on with that..
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times
Contact:

Re: RTC for Miac(Part One)

Post by JohnCrow »

Hi Stuart

Just check your jumpers
J29 below reset button = PSU
J20 to right of J29 = USB
J6 between Port D & D sockets = Default
J5 To left of LCD display = I/O

You could try pulling the jumpers off and on a couple of times make sure they are making good contact.
Also make sure the PPP firmware chip is seated in its socket.
Ensure the board is powered off and the usb cable disconnected - Just in case

Dont think amy of the other jumpers will effect the programming side of things.
1 in 10 people understand binary, the other one doesn't !

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(Part One)

Post by acestu »

OK Enamul just programmed the chip, I am going to put it togethor on a breadboard now, back soon

thanks
Acestu
pickit3_ok.jpg
(79.27 KiB) Downloaded 4198 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
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(Part One)

Post by acestu »

Hi Enamul,

Do you have a schematic for this circuit 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(Part One)

Post by Enamul »

Hi,
I am not sure which schematic you are looking for..Page 4 has CAN bus schematic which we are using and RTC schematic is in page 1.. SCK is RC3 and SDA is RC4.
so just put RTC module in slave of CAN test board..SCK and SDA
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(Part One)

Post by acestu »

Sorry Enamul, I have got really confused with all this chip swapping, I need the circuit for the chip that I have just programmed with the pickit 3 as I am putting it together on a breadboard and the fcf file only shows an LCD...

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(Part One)

Post by Enamul »

This circuit..but LCD in PORTD for both master and slave..not in PORTC
Attachments
13405303.png
(448.64 KiB) Downloaded 8384 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(Part One)

Post by acestu »

Thanks,

In the diagram Enamul, 1x unit is called DISPLAY and the other is called COLLECTETOR, what does collector mean ?

Is the display a slave, and the collector a Master ?


Also am I right in thinking that the Master will eventually be the miac unit and the slave has the set date time program on 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(Part One)

Post by Enamul »

In the diagram Enamul, 1x unit is called DISPLAY and the other is called COLLECTETOR, what does collector mean ?
Is the display a slave, and the collector a Master ?
Display is slave..Collector is Master..RTC time & Date collector.
Also am I right in thinking that the Master will eventually be the miac unit and the slave has the set date time program on it ?
Yes..you are 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(Part One)

Post by acestu »

Right Enamul,

Am I right in thinking that I am now making the circuit that I made a schematic for on page 4, with the 18f4580 that I have just programmed with the RTC_PIC18f4580_NO_SET code ?

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(Part One)

Post by Enamul »

If your CAN transmission which you have tested earlier is OK we can go to slave_RTC and Master communication..In that case you can simply test slave using the program you mentioned..if clock is running..let me know.
I will post program for Master and modified slave with CAN.
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(Part One)

Post by acestu »

Hi Enamul,

I am sending a picture of the rtc board, I have just plugged it in and the time and date are correct

Thanks
Acestu
RTC_working.jpg
(88.05 KiB) Downloaded 4175 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(Part One)

Post by Enamul »

Ok..nice to see that..I think understand that this board will now have CAN IC MCP2551 as well in RB2 and RB3 to connect with Master..I will post shortly the program to transfer this data to Master.
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(Part One)

Post by acestu »

P.S. Don't forget Enamul that the chip in the picture above is a Pic18f458 and NOT Pic18f4580

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(Part One)

Post by Enamul »

Please put PIC18f4580 in the circuit shown in Picture..with the program RTC_PIC18f4580_NO_SET
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
Contact:

Re: RTC for Miac(Part One)

Post by Enamul »

Here is the code for slave and Master where Slave will run RTC and send the data to Master via CAN and Master will receive that data and display.
Attachments
RTC_PIC18f4580_MASTER.fcf
(23.79 KiB) Downloaded 276 times
RTC_PIC18f4580_SLAVE.fcf
(48.17 KiB) Downloaded 286 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(Part One)

Post by acestu »

Hi Enamul,

I have just got my new chips Pic18f4580, I? have loaded the program RTC_PIC184580_NO_SET and I have just put it in the Dev board and clicked on Build/Compile To Chip, now after a few dots appear on the screen the chip configuration window opens but the settings do not look right, ie Watchdog Timer is enabled etc, and I am not sure what all the settings should be, is this right ?
config_screen.jpg
config_screen.jpg (223.06 KiB) Viewed 13458 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
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(Part One)

Post by acestu »

Ok Enamul , touch wood I think I have sorted it, I now have a programmed chip with the RTC_PIC18F4580_NO_SET code on 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(Part One)

Post by Enamul »

Here is the configuration...Be careful PORTB<0:4> as digital not analog.
Attachments
config.png
(30.88 KiB) Downloaded 8194 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(Part One)

Post by acestu »

Hi Enamul,

Back on track now I think after all the trouble I have had with duff chips etc.

Anyway I now have two 20 x 4 LCD modules and I am posting a diagram of the circuit which is what I am going to build next.
RTC.jpg
RTC.jpg (103.22 KiB) Viewed 13377 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
Contact:

Re: RTC for Miac(Part One)

Post by Enamul »

Hi Stuart,
Exactly this what I want from you to make in the circuit and put appropriate program. You should see clock running in both display. Later on we will replace Master by MIAC. You are close now. We can open another thread(part two) when this part will finish.
MIAC testing we will do in new thread.
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(Part One)

Post by acestu »

Hi Enamul,

I have set up the circuit as per diagram but I don't get the date on any of the lcd displays, it just shows what is in the pic I have posted.

thanks
Acestu

Do the unused pins on the MCP2551 need to be earthed ?
Final_Setup1.jpg
Final_Setup1.jpg (84.54 KiB) Viewed 13349 times
Final_Setup2.jpg
(112.73 KiB) Downloaded 3898 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
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(Part One)

Post by acestu »

Ok sorry,

I have had to reprogram the chips they had the old code in them,


Now the Master LCD says "Master RTC Unit" but the Slave LCD says nothing

P.S. Do I have to set the first time before i program the chip in order to get something on the LCD screen ?

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(Part One)

Post by acestu »

Hi Enamul,

I have a spare pic18f4580 chip so I have programmed it with the slave code and set it up on a breadboard but this too does not show anything on the LCD unit

Do you have any ideas 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(Part One)

Post by Enamul »

Do the unused pins on the MCP2551 need to be earthed ?
No you don't need to do that..
What I can only think you have loaded wrong program..
please just try the following two..put those in a folder with today's date so that you can mark them easily..
Attachments
RTC_PIC18f4580_SLAVE.fcf
(48.17 KiB) Downloaded 257 times
RTC_PIC18f4580_MASTER.fcf
(23.79 KiB) Downloaded 245 times
Enamul
University of Nottingham
enamul4mm@gmail.com

Post Reply