The Godfather talking
You may crack software. How about me?
Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 25, 2024, 04:19:12 16:19


Login with username, password and session length


Pages: [1]
Print
Author Topic: Need advice for a project in mind  (Read 4980 times)
0 Members and 1 Guest are viewing this topic.
MicroBox
Junior Member
**
Offline Offline

Posts: 35

Thank You
-Given: 11
-Receive: 0


« on: April 18, 2012, 12:25:54 12:25 »

Hi experts,
Can you give me an advice regarding to my project in mind. I'm not really deep in pics. But I would like to create an application that can do the following.
1. Pic1 , Pic2, Pic3...Picn (max 8pics Pic16F628A) can send data to the main MCU(Pic18F4550)
2. Messages depends on the buttons that they pressed and displays it in the main MCU's LCD
Please see attached file to have a better picture what I'm trying to do. I will Appreciate any suggestions/inputs or links that will help me.

Thanks in advance,
microbox

Logged
zab
Active Member
***
Offline Offline

Posts: 137

Thank You
-Given: 25
-Receive: 58


« Reply #1 on: April 18, 2012, 12:50:39 12:50 »

Hi,
What are looking for is micro controller network. Most of the the controllers have rx tx ,spi i2c pins. these pins are used to link these together.You can use 485 CAN I2C SPI protocols to link these controllers. the difference of these protocol is speed distance and data lines. Choose one of these to do what you are aiming at.
Logged
dotm
Active Member
***
Offline Offline

Posts: 179

Thank You
-Given: 81
-Receive: 75


$$$


« Reply #2 on: April 18, 2012, 01:50:35 13:50 »

use serial daisy chain data for that.
you even may not need micro controllers for the button check.
Push 4x 16bit in through four series connected 74hc676 and you will get 32 bit corresponding to the voltages at the inputs

if you need to use micro controllers , use spi in normal topology. be aware that if you want to use spi in daisy chain topology with pic microcontrollers you have to poll the buffe full flag since spi is not correctly implemented for daisy chaining.

to get long cables (100m) i would recommend you to use the rs485 electrical protocol.

Logged
electrojit
Active Member
***
Offline Offline

Posts: 178

Thank You
-Given: 233
-Receive: 285


« Reply #3 on: April 18, 2012, 02:28:16 14:28 »

The best and easiest way to solve your problem is to use I2C protocol...
As Pic16F628A does not have inbuilt I2C peripheral... you can use the bit banging I2C routines for Pic16F628A.

1) Get the Bitbanged I2C code for Pic16F628A (any Pic16Fxxx will do)
 http://www.microchipc.com/sourcecode/PIC_Hi-Tech_C_Mike_Pearces_I2C_routines.zip

2) Set the Address for all your Pic16F628A as Slave devices (say 0x02,0x04, etc) - I have kept the gap of two between two address as if in future you want to add some device in between it would be easy to expand - (I2C Master address is 0x00 and can go max upto 127 dec)

3) Configure Pic18F4550 as a I2C Master (It has inbuilt I2C peripheral - so u can use the microchip example)

4) Now write a code for Pic18F45500 to read the Slave device

5) Also write a code for Pic16F628A to respond to the read request

Hope this will help you...

Regards,
electrojit
Logged
MicroBox
Junior Member
**
Offline Offline

Posts: 35

Thank You
-Given: 11
-Receive: 0


« Reply #4 on: April 18, 2012, 02:57:01 14:57 »

Thanks everyone for the valuable information, I will try to do my own little research regarding what was posted here and feedback later...

regards,
microbox
Logged
GunMage
Junior Member
**
Offline Offline

Posts: 65

Thank You
-Given: 11
-Receive: 35



« Reply #5 on: April 18, 2012, 03:06:31 15:06 »

We typically use RS485. Our cable runs are much longer that what you've depicted though. Additonally we dont have a need to have a master device. we just address each unit differently and basically run identical code on them with the exception of the device address. This allows us to use any device as the master and query the other devices. It also allows us to be able to see the data being passed by using any terminal emulator on a PC with either a RS232 (Standard computer serial port) to RS485 adapter, USB to RS485 adapter, or Ethernet to RS485 Adapter
Logged
alien
Junior Member
**
Offline Offline

Posts: 55

Thank You
-Given: 30
-Receive: 6


« Reply #6 on: April 18, 2012, 05:22:44 17:22 »

Dear All,
One really interesting stuff you all may find usefull for any present or future slow multidrop communication needs  Smiley >>>

http://www.romanblack.com/blacknet/blacknet.htm

much much more innovative stuff at that website...   Hope you all will fund it help full ...

« Last Edit: April 18, 2012, 05:26:54 17:26 by alien » Logged
GunMage
Junior Member
**
Offline Offline

Posts: 65

Thank You
-Given: 11
-Receive: 35



« Reply #7 on: April 18, 2012, 08:32:44 20:32 »

Dear All,
One really interesting stuff you all may find usefull for any present or future slow multidrop communication needs  Smiley >>>

http://www.romanblack.com/blacknet/blacknet.htm

much much more innovative stuff at that website...   Hope you all will fund it help full ...



It is good stuff. In my tyypical application the timing becomes the issue. Latency will be come a big issue for me. I try to get as close to real time data and comms as I can. I end up having enough of an issue with real long cable runs and satelite uplinks to want to add any more latency. RS485 is also only 2 wire (D+ & D-) as it is a differential signal.

Just my $0.02 for what it is worth
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC