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: BX-01 has CRC included in its Network firmware for RS-485

Discussion forum for the BasicX family of microcontroller chips.

BX-01 has CRC included in its Network firmware for RS-485 - G. Kramer Herzog - Aug 19 11:04:00 2005

I am quite happily surprised.

When I started to look into RS-485 as a better alternative to RS-232,
I assumed that the BX-01 didn't have any CRC. So I spent a bit of
time learning how to program CRC and was preparing to include a
subroutine for such.

I began to wonder what I was doing because the documentation
indicates that the BX-01 will confirm a correctly received message.
So I just asked Netmedia.

The reply was 'YES'.

The BasicX software uses a form of CRC to verify correct transmission
over the Network functions in the BX-01. That eliminates one
programing chore that might eat up a bit of eeprom and ram. And, it
really provides an easy to program network. You just have to focus
on what you want for a packet and what you want for addressing.

My only problem is that I only own one BX-01! Seems that I will have
to go shopping.




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


Re: BX-01 has CRC included in its Network firmware for RS-485 - Mike Perks - Aug 19 11:55:00 2005

G. Kramer Herzog wrote:

> The BasicX software uses a form of CRC to verify correct transmission
> over the Network functions in the BX-01. That eliminates one
> programing chore that might eat up a bit of eeprom and ram. And, it
> really provides an easy to program network. You just have to focus
> on what you want for a packet and what you want for addressing.
>
> My only problem is that I only own one BX-01!

The question is how can a non-BasicX device talk to a BX-01? Each end
needs to use the same CRC algorithm. So what are the details of the
BX-01 algorithm - is it documented somewhere?

Mike





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

Re: BX-01 has CRC included in its Network firmware for RS-485 - G. Kramer Herzog - Aug 20 7:09:00 2005

>
> The question is how can a non-BasicX device talk to a BX-01? Each end
> needs to use the same CRC algorithm. So what are the details of the
> BX-01 algorithm - is it documented somewhere?
>
> Mike

The BX-01 has two serial ports called COM1 and COM2. (So do the BX-24
and BX-35, but they have been named COM1 and COM3 to apparently avoid
the dedicated pinouts of COM2 on the BX-01.) There really is not a
problem with doing so. Also, the SPI devices have CRC that works with
the BX products.

Originally, I purchased only one BX-01 with RAMsandwich because I
wanted the 128K ram. The RS-232 was enough. I wasn't interested in
building networks and didn't understand that RS-485 operation is
cleaner, requires only the +5volts, and goes farther than RS-232. I
was looking at building robots, not the monitoring and control of
electro-mechanical systems at remote sites.

[The reason for COM1, COM2, and COM3 is that the BX-01 is an entirely
different chip with the oscillator, the Vdd, the Vss, and so on placed
in different locations than the BX-35. The COM2 is not a flexible set
of pin locations because the BX-01 seems intended for multiplexing data
and addresses to 64K bytes w/o paging.]

Whilst the COM1 is 'hardcoded' (as Netmedia's BX-01 Hardware Doc calls
it) for use with the Network calls, the regular Serial I/0 may be used
with both COM1 and COM2. So additionally, you likely could write your
own CRC for one RS-232 port or both. You could also include a pin for
direction and have a completely independent RS-485 CRC system outside
of the BasicX set up.

Obviously, the choices are to use BasicX's network firmware [which
would require two BX-01s at least] or to construct a hybrid. And also
obviously, neither BasicX or the other manufacturer would be supporting
hybrid solutions, as the whole idea is to sell more of your own product
and to support customer loyalty.

Netmedia didn't provide me with information on the CRC. I didn't
pursue it because it seemed a mute point. There are 8bit, 16bit, and
32bit formats for CRC. Some are more secure in terms of preventing
their use to crack encryption. But all this seems to lead you to
wanting something very special and that means writing your own code,
not hacking someone elses.

As far as I can tell, the Netmedia BasicX is the only Basic language
Microprocessor provider of a 'network chip' complete with a CRC scheme
and RS-485 software interface. It adds quite of bit of value for
$10USD to someone that doesn't want to hire an expert programer to set
up an irrigation control system or to shut down the signs and lights
around a large shopping malls parking lot via timers and/or remote
control.

Because the packets are inherently small and the programer is not
likely to give a lot of time to this, my guess is that it is an 8-bit
CRC and one of two versions X8+x5+x4+1 or X8+x2+x+1. The first is
used by Dallis 1-wire devices for 8 bytes of info, the second is
commonly sited in text books as being good. (So CRC schemes do not
really trap errors and this has been the subject of a lot of advanced
mathematics.]

Peter Anderson has implemented the Dallas 1-wire CRC on a BX-01 or BX-
35 [I am not sure if both], but most of his presentation is in Assembly
language for a PIC. Still, he has proven that CRC can be read and
compared with another non-BasicX device. And, he had examples to get
you started.

Dallas 1-wire gives a nice 22 page presentation of CRC to help you
along.

Personally, I find the whole concept of RS-485 with CRC packets quite
attractive as it offers easy and flexible remote control for people who
live in a farmhouse and want to know what is happening down at the barn.

Given that BasicX has added the ability to write to specific bytes in a
remote BX-01 micorprocessor, you can do things like reset the clock if
you have a subroutine that interfers with it remaining accurage. Or,
you can peek and poke variables without running down to the barn
everyday to refine your system. It other words, it not only offers
remote control, but remote programming [up to a reasonable limit]. So,
why mix and match your system and have less performance?

Of course, you could add a SitePlayer to all this and I have no idea
where you might be - on your farm or in Boston.

And in closing, I suspect that Netmedia has no interest in helping make
this special 'market niche' generic by offering up the inner workings
of its network firmware. They did the hard work of creating the
concept and making it real, it only seems fair to profit from it.




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