Rich Testardi

Introducing StickOS BASIC for Tower System and MCF51CN128...

Hi all,

 

My compilers are about to expire next week, so I figured I better get this done now... :-)

 

I just ported StickOS to the Tower System and the MCF51CN128.  (StickOS also runs on the MCF5225x and about a dozen other MCUs -- see http://www.cpustick.com/mcus.htm)

 

StickOS is an MCU-resident interactive embedded system programming environment intended for hobby and education use, including an easy-to-use editor, transparent line-by-line compiler, interactive debugger, profiler, and flash filesystem, where external MCU pins can be mapped to special "pin variables" for manipulation or examination, and internal MCU peripherals are managed by BASIC control statements and BASIC interrupt handlers.

 

In literally minutes, using nothing but a terminal emulator, you can be interactively using most of the components and capabilities of the MCF51CN128, including:

  • digital I/O pins
  • analog input pins
  • analog output (PWM) pins
  • frequency output pins
  • servo output pins
  • UART I/O pins
  • interval timers
  • non-volatile storage

Just as a trivial example, to read the accelerometer axes and print the millivolt values from the ADC is as simple as:

> list
  10 dim x as pin pte2 for analog input
  20 dim y as pin pte1 for analog input
  30 dim z as pin pte0 for analog input
  40 while 1 do
  50   print "x =", x, "; y =", y, "; z =", z
  60   sleep 1 s
  70 endwhile
end
> run
x = 1491 ; y = 1577 ; z = 2533
x = 1506 ; y = 1586 ; z = 2536
x = 1487 ; y = 1582 ; z = 2539
x = 1514 ; y = 1583 ; z = 2545

<Ctrl-C>
STOP at line 60!
>

You can also use StickOS "absolute register variables" to manipulate all of the MCU registers interactively, right from the command prompt.  For example, to display the mod and cnt values for the RTC, you can do:

 

> dim rtccnt as byte at address 0xffff82c1
> dim rtcmod as byte at address 0xffff82c2
> print rtcmod
7
> print rtccnt
1

 

You can even update the mod value (causing the LED blink to slow down) with:


> let rtcmod=15
>

 

Unfortunately, I did not have enough time to get the Ethernet interface working on the MCF51CN128 like it works on the MCF52233...  I'm not actually sure that the part has enough flash for that, but the bottom line was I ran out of time (I only had a day to do the port).

 

StickOS also supports 2.4GHz wireless zigflea communications between MCUs when they are attached to an MC1320x transceiver via SPI.  Unfortunately, the Ethernet Phy on the Tower Serial card conflicts with those pins, and can't be jumper disabled, so you have to hold the Phy in reset using TP6.

 

Anyway, if you want an infinite amount of information on StickOS, it is on the web at: http://www.cpustick.com/index.htm

 

There is also a skeleton source code project on the Downloads page from which you can both rebuild StickOS as well as easily port finished BASIC programs to C, taking advantage of all of the pin/peripheral functionality embedded in StickOS.

 

"Our hope is to enable casual users to again become creators of technology, rather than simply consumers of it."

 

-- Rich

rich@testardi.com

Tags: BASIC, MCF51CN128, MCF5225x, StickOS, education, hobby

Reply to This

Replies to This Discussion

Wow!!

This looks exactly what hobbiests, like myself, have been looking for. I am a ham radio operator and I am using my tower to control my antenna rotator.

What I'm doing is receiving a serial command on TTYA in the tower which is formatted for a particular make and model of rotor and then sending it on via TTYB in the tower in the format for the actual make and model of the rotor I have. I am doing this so I can use a particular software support package available for ham radio which is otherwise great but it does not support my rotator.

The Freescale tower is great! However, the programming support which causes you to have to pay for an annual license to do "real world" stuff is not well suited for hobbiests, like myself. I have my application working fine but the build is so large that I have to have a licensed version of Codewarrior to develop and test my application. The overhead required by the MQX to support tasking, etc is huge.

I started my code development using a Freescale sample which has a single task which says "Hello World". As I recall that build took around 400K!!!??? Amazing!!

I could not figure out how to strip away stuff I didn't need because MQX is so tightly wound with cross dependancies that it seemed that the build would break if I took out any of the MQX libraries or runtime libraries.

So I just "gave up" and used the sample project as a basis for my work.

I am going to explore your web site. This should open up tons of opportunities for students and hobbiests to use the Freescale tower. Hobbiests are not going to stay with a system where the annual license fee for software support is more than the cost of hardware.

Roger Simpson Oklahoma City Ham Radio K5RKS

Reply to This

That was exactly my reasoning -- I wanted to have simple projects around the house where I did all the hard work once, and then could leverage it over and over just changing the upper level logic.

I've been wanting to get string support into StickOS forever now to make it easier to do things like that as well... For now, everything has to be done by characters and arrays, unfortunately.

Reply to This

RSS

Advertisement Click Here

Spread The Word!

Follow TowerGeeks on TwitterTowerGeeks on FacebookShare This
Towergeeks has their own pages on Twitter as well as Facebook. Find us there and help spread the word about the Tower System!

© 2010   Created by TowerGeeks.

Badges  |  Report an Issue  |  Terms of Service

Sign in to chat!