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
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 sorry gettin a bit confused

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 »

NO problem..I have found same problem in FCD file of PIC18f458.FCD...so thank you. Because of you it now fixed..
18F458.fcd
(15.19 KiB) Downloaded 273 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 »

Thanks Enamul, I have replaced the file restarted flowcode and programed the chip, however as soon as I switch on the breadboard the lcd has a row of blocks so I think that is configured wrong, I connected it to port D as you said, I think the connections may be different on this lcd unit and they are not shown on the shematic ,

my lcd connections are:

1. vss
2. vdd
3. vo
4. rs
5. rw
6. E
7. D0
8. D1
9. D2
10. D3
11. D4
12. D5
13. D6
14. D7
15. A
16. K

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,
I have changed the code for PIC18f458. It's easy because both the ICs are 40 pin and pin to pin almost same. I have changed the configuration as well.
I think it's better to try LCD test program first as you are using this chip for the first time..I am attaching here that for you..If you use 20MHz crystal and can see "TESTING LCD" is changing line in 1 second then everything is fine.
LCD_458.fcf
(8.5 KiB) Downloaded 255 times
Try now using your programmer and please let me know how you are getting..
RTC_PIC18f458.fcf
(42.79 KiB) Downloaded 250 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 »

Yes still getting the blocks when I programme the lcd test..

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 »

So I was right..before looking at your post I make a program for LCD test for you. Your LCD is standard one and have standard 16 connection points and the schematic I posted is for this LCD. But I think I need to explain you how they need to be connected..But be careful in LCD connection..so that no connection point can get more than 5V because that will damage the LCD
Same is true for PIC power supply..
Now come to your connection description..
1. Vss...connect it to GND
2. Vdd...connect it to +5v Power supply (Vdd of PIC)
3. vo....Contrast control (you need a 10k pot whose middle terminal, wiper will be connected to this point but other terminals of pot will be connected to Vcc and GND)
4. rs.....Connect it to RD<4>..PIN 27 of PIC
5. rw....connect it to GND
6. E.....Connect it to RD<5>..PIN 28 of PIC
7. D0....Keep open (NC)
8. D1....Keep open (NC)
9. D2....Keep open (NC)
10. D3...Keep open (NC)
11. D4...Connect it to RD<0>..PIN 19 of PIC
12. D5...Connect it to RD<1>..PIN 20 of PIC
13. D6...Connect it to RD<2>..PIN 21 of PIC
14. D7...Connect it to RD<3>..PIN 22 of PIC
15. A....Connect it to Vdd(+5V) through 1K resistor
16. K...connect it to GND
Note: you have to adjust the contrast control pot so that you can see characters in display...the voltage in the pin should be above 0V but close to 0V
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, yes I will check all my connections now I have that info, also I will post a pic of my breadboard

thanks
Acestu
rtc.jpg
rtc.jpg (69.18 KiB) Viewed 12166 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

Post by acestu »

I have just changed pins 4 and 6 and all is now working ie LCD TESTING is alternating between line 1 and line 2

So I guess it is time to try the other programme,

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,
Looking at your picture it seems to me that you have connected LCD data bits to PORTB and PORTD mixed..may be wrong it looking..But please ensure the connection as I have mention in my last post..
Edit: It seems you find your issue..it works fine..Good
Now you can load the RTC program..
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 loaded the rtc programme and the lcd goes blank and nothing happens ? , so i reloaded the lcd programme and that works fine again ?

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 »

It shouldn't be like that..Can you just open the SDA and SCL connection from PIC and see is there anything in the display like..
45:85:85
45/25/2165
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, I disconnected the 2 wires from the rtc unit to the pic but still nothing just blank 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

Post by acestu »

I have just spotted a capacitor missing off the MCLR could this be the reason ?

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,

Two things need to know..one is where you bought your RTC module exactly from so that I can check..Secondly is there any 4.7K pull-up resistor in SDA and SCL lines in the RTC board?
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

Post by Enamul »

PIC MCLR pin need to be high by 10 K resistor which I guess you have done..Capacitor is to avoid noise reset issue of PIC..For test just pulling up MCLR via 10K should be pretty OK..Even though it's better to put capacitor but that's not causing the issue.
I also put "TIME:" and "DATE:" in the program so that at least those should display which will help to debug..
Attachments
RTC_PIC18f458.fcf
(43.49 KiB) Downloaded 168 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 »

NO there are no pull up resisters whoops , where do I put them ?

The rtc module is this one:

http://www.hobbytronics.co.uk/real-time ... c%20module

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 »

Ok..you have to put 4.7K pull-up resistor from SDA to +5V and SCL to +5V individually. So resistors can be connected to RC<3> to Vdd and RC<4> to Vdd.
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 for all your help tonight Enamul, is it ok if we carry on tomorrow because I am out early in the morning.

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 »

No problem at all..I was just waiting for you finish..I am sleepy too
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 »

Once again thank you very much for your time it is most appreciated Enamul,

I will continue tomorrow

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 »

Hi Enamul,

When I program the LCD test it works fine so the LCD must be wired correctly but when I program the chip with the RTC code the screen is blank, now the LCD connections are the same on both projects, ie D port, does the RTC module have to be connected for anything to come up on the 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
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 »

Have you used the last program for RTC in which I have added TIME: and DATE: in lcd display to check..If you have used that..for debugging just open the RC<3> and RC<4> connection from PIC..if you can see those TIME: and DATE: in display..in that case LCD connection and PIC programming OK..something is wrong in RTC module but if still blank in that case something wrong..other than RTC
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 »

Yes I am using the Time, Date version but just blank, I have removed the rtc module and still nothing, the 4 pins that I am using on the rtc are:

GND to ground
5V to +5v
SDA and SCL to the RC3 and RC4 pins


is there a way to test the rtc unit ?


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,
It's really strange..You can just try this program in which I have disabled all for RTC..just LCD is running..
Let me know is still LCD blank or not.
Attachments
RTC_PIC18f458.fcf
(43.49 KiB) Downloaded 147 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, yes that works I get the Time & Date on the LCD

thanks
Acestu

P.S. I found this https://www.sparkfun.com/products/99

this is the module, do I need to put the resisters in the circuit or are they built in to this module ?
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.

Post Reply