Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Ads

Discussion Groups

Discussion Groups | BasicX | Re: link basicX together

Discussion forum for the BasicX family of microcontroller chips.

link basicX together - mechatronicsccc - Oct 31 11:17:08 2006

how can I link 2 or more basicX together.
I like to be able to say slave out one basicX to control the motor and
say another to check all the sensors and have a master take everything
in and control everything.
Can this be done?
If so how?



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )


Re: link basicX together - Yuri Bernikov - Oct 31 17:20:52 2006

Two BasicX can interact via serial protocol and command language. For
instance, if the master would like to start a motor in forward
direction with 100RPM it sends "F100" string to the slave. The slave
has an endless loop waiting for a command (or a pending task if you
would like to use the interruptions - this will yield better response
time, but the coding is more complicated). Once the command is
received, the slave tries to interpret it. If interpretation is
succeeded it executes the command and sends OK feedback to the master.

In the case of sensors, the slave sends back the readings as a
formatted string.

There can be multiple slaves, but a dedicated serial link has to be
established for each one. It is probably OK for a few slaves, but if
you need many of them it is better to use something like I2C bus.

Huge benefit of using this approach is that the slave can be any kind
of microcontroller, not necessary BasicX. Also, a slave can be
originally designed using one kind, and later be "upgraded" to a
different kind of microcontroller. As long as the command language is
the same, this change should be transparent to the master.



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Re: link basicX together - Robert Dolhen - Nov 2 6:50:21 2006


----- Original Message -----
From: "Yuri Bernikov"
To:
Sent: Tuesday, October 31, 2006 8:37 PM
Subject: [BasicX] Re: link basicX together
> Two BasicX can interact via serial protocol and command language. For
> instance, if the master would like to start a motor in forward
> direction with 100RPM it sends "F100" string to the slave. The slave
> has an endless loop waiting for a command (or a pending task if you
> would like to use the interruptions - this will yield better response
> time, but the coding is more complicated). Once the command is
> received, the slave tries to interpret it. If interpretation is
> succeeded it executes the command and sends OK feedback to the master.
>
> In the case of sensors, the slave sends back the readings as a
> formatted string.
>
> There can be multiple slaves, but a dedicated serial link has to be
> established for each one. It is probably OK for a few slaves, but if
> you need many of them it is better to use something like I2C bus.
>
> Huge benefit of using this approach is that the slave can be any kind
> of microcontroller, not necessary BasicX. Also, a slave can be
> originally designed using one kind, and later be "upgraded" to a
> different kind of microcontroller. As long as the command language is
> the same, this change should be transparent to the master.
>



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )