The Godfather talking
This is god damn my place! Capisci?
Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 06, 2016, 01:47:09 01:47


Login with username, password and session length


Pages: [1]
Print
Author Topic: Need advice for a project in mind  (Read 2107 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, 01:25:54 13: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: 132

Thank You
-Given: 24
-Receive: 54


« Reply #1 on: April 18, 2012, 01:50:39 13: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: 149

Thank You
-Given: 61
-Receive: 47


C15H15NO2S


« Reply #2 on: April 18, 2012, 02:50:35 14: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: 168

Thank You
-Given: 181
-Receive: 267


« Reply #3 on: April 18, 2012, 03:28:16 15: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, 03:57:01 15: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
V.I.P
Junior Member
*****
Offline Offline

Posts: 61

Thank You
-Given: 8
-Receive: 35



« Reply #5 on: April 18, 2012, 04:06:31 16: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: 47

Thank You
-Given: 11
-Receive: 6


« Reply #6 on: April 18, 2012, 06:22:44 18: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, 06:26:54 18:26 by alien » Logged
GunMage
V.I.P
Junior Member
*****
Offline Offline

Posts: 61

Thank You
-Given: 8
-Receive: 35



« Reply #7 on: April 18, 2012, 09:32:44 21: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