Discussion forum for the BasicX family of microcontroller chips.
New Member New Problem - c04203420 - Sep 30 6:42:00 2005
New member new problem. Well here goes.
Firstly my name is Marc and I live for Linux. I also go fishing
occasionally and crack open a 24 pack with the mates whilst we are at
it. Now that i got that out of the way, lets CRACK ON.
I have had the bx-24 development station stuck in a box waiting to be
abused for over two years now. She has been eagerly awaiting human
touch. Well she is in for a rude awakening i'll tell you.
I have decided that I want to build an atmosperic climate control
system. The only problem and of course the most important one is where
to start.
Ideally I would like my application to run natively under Linux but I
dont think this is possible. At present Im emulating WindoZe in Linux
using a fantastic program called VMware. It emulates doZe nearly 100%
faithfully and it is fast enough to use for development purposes. I
also have to resort to using the usb-serial connector when I develop
on the laptop. That being said I do have a working environment set up
in which to begin my system.
Some questions before I start to go off on one.
1) Those in the know, 'know' just what a poor platform Microsoft
WindoZe really is and Visual Basic is no exception. Is there any
alternatives to using visual basic to program the bx-24?
2) Would it be possible to program the chip directly under Linux?
3) Is to possible to get VB to communicate with Java and Java with VB?
What I really want is a graphical front end built using the swing apis
for Java. I would also like to do the back end (i.e the core
programming) using Java, c or c++. I dont wanna rely on VB at all if
possible.
If it really came down to it I suppose I could code the app in VB.
Export the data to a text file. This data can then be read by the
graphical front end and the data displayed locally. To manipulate the
microcontroller I would use the Java front end which would export the
data to another text file which would then be read by VB to manipulate
the microcontroller. This all seems like too much communications
overhead but i suppose it would work on an unloaded system.
Finally. When i have built the system I hope to build a web based
interface to my application. This will be realatively easy when the
system is in place.
I would greatly appreciate any input you guys have on the subject
matter. I know it sounds adventurous but If I build the system and it
works I plan to release all my work under open source. That way
everyone will benefit from the project.
Thanks in advance.
Marc. (UK)
Someone please tell me that my only option isn't to code the app in
VB .

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )
Re: New Member New Problem - Tom Becker - Sep 30 8:49:00 2005
> ... Are there any alternatives to using visual basic to program the
bx-24?
Strictly, BasicX is _VB-like_ and most think that is good, since it is
possible to write and test much of the processor code on a desktop
machine (under Windows or in a Windows virtual machine, of necessity),
then incorporate and download that code to the processor using the
BasicX IDE. You don't need to, though - and I don't - preferring to
work in the IDE and test on the processor.
> ... program the chip directly under Linux?
If you mean using Linux-native languages, not today.
Your application will probably take the form of at least two components,
a GUI frontend and the BasicX processor. The processor will likely
communicate with the GUI serially using commands and data formats of
your invention. What language you choose to write the GUI has nothing
to do with BasicX, so you can use C, Java or anything else you like, or
dislike, to talk to your BasicX code.
FWIW, I have used Win4Lin under Xandros Linux to develop for the BasicX
and - with a fast machine - that is a satisfactory development
environment if you cannot tolerate a physical Windows machine. VMWare
or Wine-based solutions should be similar.
Tom

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )
Re: New Member New Problem - c04203420 - Sep 30 11:07:00 2005
> ... Wine-based solutions should be similar.
Im not entirely sure whether it would be the best decision to run my
climate control system through emulation. Perhaps I may resort to
using Windows on a cheap box that is dedicated to the job. I have a
few old dogs lying around the house.
Thanks for the advice. Could someone please elaborate further on the
process of getting the bx-24 to communicate with a Java front end and
also any examples would be much appreciated.
I dont think this is going to be a simple thing to achieve but I do
hope with lots of dedication over the next year or so that one day i
may realise my goal.
Im very new to electronics but i do have the luxury of time on my
side.
I have purchased Physical Computing by Dan O'Sullivan and it is a very
informative easy read so far.
Undoubtedly I will have many questions for this project but I intend
to have all my work available and hosted on-line for all to see, use,
contribute etc.
I was playing around with GUI design last night and it helped flesh
out some of the requirements of the proposed system.
Before i go. Does anyone know the realtionship between motors and the
amount of weight they can lift?
Thanks again.

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )
Re: Re: New Member New Problem - Mike Robert - Sep 30 13:41:00 2005
c04203420 wrote:
> > ... Wine-based solutions should be similar.
> Im not entirely sure whether it would be the best decision to run my
> climate control system through emulation. Perhaps I may resort to
> using Windows on a cheap box that is dedicated to the job. I have a
> few old dogs lying around the house.
>
The only strictly "Windows" part of the whole Basicx universe is the
development environment, which runs very nicely under WINE and VMware in
my personal experience. Once the object code is loaded to the BX, it
executes on the BX without need of any outside devices (other than those
which you decide you need, like sensors, switches, serial links to other
machines of any sort, keypads, LCDs, etc.).
-Mike

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )
Re: Re: New Member New Problem - Sloan Thrasher - Sep 30 16:13:00 2005
----- Original Message -----
> > ... Wine-based solutions should be similar.
> Im not entirely sure whether it would be the best decision to run my
> climate control system through emulation. Perhaps I may resort to
> using Windows on a cheap box that is dedicated to the job. I have a
> few old dogs lying around the house.
I think you may be confused about the difference between development and
production ("run-time"). You would do just the development work using the
BasicX IDE under Windows (or wine, etc.). Once your programming is
completed, you could connect the BX-24 to any machine running any
language/OS of your choice.
Your climate control system would not have to run under an emulation system.
For example, if you wrote the program on the BX-24 to send "datagrams" to
the host via RS-232 (serial), then you could develop an application that
runs on the host to read that datagram. The program on the host could be
written in any language you choose and have available, Java, C, C++, C#, --
literally any language that would allow you to talk via the serial ports on
the host machine.
Not knowing what your climate control system would entail, let's assume for
a moment that it would interface to several temperature sensors, and maybe a
humidity sensor as well. It might also control some relays to turn on the
Heat/AC, or open/close drapes/blinds. With these assumptions, you would then
need a two-way protocol. Since it's your application, you would then define
that protocol.
Let's refine these assumptions further. You have three temperature sensors,
and your code on the BX-24 converts the readings to degrees Farenheight
(sp?) as integers (2 bytes). You also have eight relays controlled by the
BX-24 and want to be able to see how they are set, and to tell the BX-24 how
you want them set.
The following protocol might work for your needs:
Host sends 3 bytes of 255 (all bits set to 1) as a "hello" message
BX-24 responds by sending the current readings as:
byte 1: 255
bytes 2 & 3: Temperature of sensor 1
bytes 4 & 5: Temperature of sensor 2
bytes 6 & 7: Temperature of sensor 3
byte 8: Status of relays, 1 bit per relay, lsb = relay1, msb = relay8. 0 for
open, 1 for closed.
byte 9: 255
If the host wants to set the relays, it sends 3 bytes of 127, followed by:
byte 1: Mask for relays to affect. If a bit is 1, then the relay is changed,
if 0, the relay is left alone. Ordered as byte 8 above.
byte 2: Relay settings. Ordered as byte 8 above.
byte 3: 255
BX-24 responds with the same datagram as above.
Of course, I have chosen the specifics abitrarially in the above protocol.
It doesn't really matter if you send 3 bytes of 255, you could choose
another number of bytes, and a different value to send. What does matter is
that you define the protocol, and then follow it on both the BX-24 and the
host application.
Hope this helps!
Sloan

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