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
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: RTC for Miac(Part One)

Post by Enamul »

Hi,
I made the program in Flowcode V4.5 It should work in Flowcode V5.4 but I am getting the same error..seems they are not compatible..Don't worry allow me some minutes..I am posting program using FCv5
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: RTC for Miac(Part One)

Post by acestu »

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: RTC for Miac(Part One)

Post by Enamul »

Hi Stuart,
I have linked the FCV5 bug correction earlier and I forgot that now..Here is the bug correction link..
http://www.matrixmultimedia.com/mmforum ... 512#p38512

You will see FC5_PIC_CAN.c file to download in the link...Replace the old one in "Flowcode/v5/Components" directory..

Edit: so last posted program will compile after fixing the bug.
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: RTC for Miac(Part One)

Post by acestu »

Hi Enamul,

Not having much luck, problems with the dev board now, the green power light will not come on now and the voltage regulator on the board is red hot ?

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: RTC for Miac(Part One)

Post by Enamul »

ohh.. :(
Did you manage to compile the code?
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: RTC for Miac(Part One)

Post by acestu »

Ok that was weird, its working now, yes I have just programmed the chip, getting late now though so I will carry on tomorow Enamul, and
as always thank you for your time and help

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: RTC for Miac(Part One)

Post by Enamul »

Glad it worked finally..No problem we will start tomorrow..Good Night :)
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: RTC for Miac(Part One)

Post by acestu »

Hi Enamul,

I am building the send receive master first, the switch on port b4 would this connect to +5v or ground

thanks
Acestu
Master.jpg
Master.jpg (33.58 KiB) Viewed 14345 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

Re: RTC for Miac(Part One)

Post by Enamul »

Hi Stuart,
You have to connect RB4 to Vcc via 4.7K resistor..a switch from RB4 to GND. Pressing sw, RB4 = 0 and normally high.
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: RTC for Miac(Part One)

Post by acestu »

Hi Enamul,

the switch, is it a momentary action or latching ?

thanks stuart
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: RTC for Miac(Part One)

Post by Enamul »

You can use momentary switch as whenever you press switch data will send to slave and master will be in another loop for data receiving..
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: RTC for Miac(Part One)

Post by acestu »

Hi Enamul,

I have just finished the second node, I am going to join them both on the canbus now, do the end of line resistors have to be dead on 120 ohms because I dont have any at this value ?

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

Re: RTC for Miac(Part One)

Post by JohnCrow »

Hi Stuart

I dont think the value its too critical.

I'm using (measured with the DVM) 118.3 ohms on the termination for my miac expansion modules (the miac end is built in)
That is also the value I get if I measure across the CAN terminations on the E-block can board.
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

Re: RTC for Miac(Part One)

Post by acestu »

Thanks John,

The nearest I have is 100 ohms, but I have read articles that say people have used 60 ohm resisters, so I don't know, what is the worst that will happen, it won't work ?

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: RTC for Miac(Part One)

Post by Enamul »

Hi Stuart,
According to datasheet of MCP2551, you should be fine if you use even 60 ohm. So I think you can simply connect 100 ohm for both terminals.
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: RTC for Miac(Part One)

Post by acestu »

Hi Enemul, I have connected up the bus with the 100k resisters but nothing seems to work unfortunately, 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
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

Re: RTC for Miac(Part One)

Post by JohnCrow »

Hi
Hi Enemul, I have connected up the bus with the 100k resisters but nothing seems to work unfortunately, any ideas ?
100 k or is that a typo? hopefully you mean 100 ohm :)
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

Re: RTC for Miac(Part One)

Post by acestu »

Sorry you are right John, its a typo

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: RTC for Miac(Part One)

Post by Enamul »

Hi Stuart,
What is shown in slave and master display? Because the program is tested one and should work straight way.
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: RTC for Miac(Part One)

Post by acestu »

Hi Enamul, the Master says "NO-TRANSMISSION" and the slave says "NOT-RECEIVED"

When the button on the Master is pressed the Master says "CAN-TRANSMISSION 84" and then changes to "NOT-RECEIVED"

The slave does not change

thanks
Acestu

P.S. I am using the temp sensor for the analogue input
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: RTC for Miac(Part One)

Post by Enamul »

When you press the button, you should see "CAN Transmission" in first line and 84 in second line. Are you getting that? You mean in slave you always see "Not-Received"?
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: RTC for Miac(Part One)

Post by acestu »

Hi Enamul,

Yes that is what the master does, but the slave never changes it always says "NOT-RECEIVED"...

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: RTC for Miac(Part One)

Post by Enamul »

Hi,
I have modified the code for you that John used couple of days earlier. It is tested in FCV5..If it doesn't work in your case; I have to think in circuit connection and programmer issue.
Attachments
ADC-Switch TX.fcf
(18.38 KiB) Downloaded 304 times
ADC-Switch RX.fcf
(34.59 KiB) Downloaded 270 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: RTC for Miac(Part One)

Post by acestu »

OK, I have checked all my connections and found both mcp chips pins 5 to 8 back to front, I changed them and now it is sending info and returning info


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: RTC for Miac(Part One)

Post by Enamul »

SO you mean now you can get data sending from master to slave and slave returning to master using the previous programs? If so, great well done! I am sending now one program for RTC with set options..
Enamul
University of Nottingham
enamul4mm@gmail.com

Post Reply