FemtoBasic for the uOLED-96-Prop
Mike Green
Posts: 23,101
I've been working on several versions of FemtoBasic (actually BoeBotBasic) including a stripped down version for use with Bean's Prop Dongle and now a version for 4D Systems' uOLED-96-Prop. I'm still testing the uOLED statements, but most of them are already tested and I've converted their demo program to Basic. There's uSD card support and you can auto-run a program from the SD card. It normally uses the programming port for the console, but the demo will run without that. Since a couple of Prop I/O pins are available, you could even hook up a couple of pushbuttons and run a mini-kiosk with only a USB power pack (for charging USB devices) or other 5V supply.
Once I've checked this version out further and applied some bug fixes to BoeBotBasic and the version for the Prop Dongle, I will post all 3 to the Object Exchange.
There's a ReadMe file in the archive. Please read it for installation instructions.
Once I've checked this version out further and applied some bug fixes to BoeBotBasic and the version for the Prop Dongle, I will post all 3 to the Object Exchange.
There's a ReadMe file in the archive. Please read it for installation instructions.
Comments
Thanks for supporting the Prop Dongle.
How about a version for the HC-OSD ? It already has video output and keyboard input ? I'll send you a free one....
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My goal is to live forever...Or die trying.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
There are only four spare pins, but it's easy to add a serial I/O expander or I2C I/O expander. BoeBotBasic already has I/O routines for using an HB-55 compass via an I2C I/O expander and those can be modified and copied.
How easy is it to access the I2C pins used for the onboard EEPROM? I would want at least 4 pins for direct access at clock speed. But, if I could expand using already used I2C pins, a lot of possibilities open up... Are these the pins they mean when they refer the the RX/TX pins being available?
Does the uOLED-96 use the built-in ROM font? Or, does it's display controller have a font?
2) The display controller doesn't have a font. It handles lines, rectangles, and points. Have a look at the Basic source. 4D Systems sent me their normal font and it's included in the OLED_Driver file for text output. You could theoretically use the ROM font, but it's 32x32 while the OLED display normally uses an 8x8 font. You could use the ROM font with a 4x4 area used to represent the OLED pixel and use a variable intensity depending on the number of pixels that are on in the 4x4 area, but that seems like a lot of work.
Post Edited (Mike Green) : 10/16/2007 12:27:43 AM GMT
If I put FemtoBasic in the EEPROM, can I safely then use pins 30/31 for an alternate I2C bus? If the programs I need are on the uSD card, I don't really need 30/31, right?
Or, am I missing something?
Post Edited (Rayman) : 10/16/2007 1:14:50 AM GMT
One last question (I hate reading manuals [noparse]:)[/noparse]... How many cogs are free on the uOLED-96-Prop? Or, how many are used up driving the OLED display?
Ok, another question: What do you mean by "You could modify it to use the tiny screen for console output if you want."? I kinda assumed your modified femtoBasic was using the OLED display...
Because the uOLED screen is so small (96 x 64 pixels or 12 x 8 characters), the uOLED-96-Prop Basic uses the serial port for all console operations (statement entry / INPUT / PRINT). There are statements for driving the uOLED display including graphics and text display, but the text display statement only displays a string of text starting at a designated text row and column. There are no control codes. If the interpreter only runs the "autoexec.bas" program off the uSD card, it won't actually use the serial input stream (although it checks for ESC characters in the buffer). It does output some identification text during initialization, but that can be ignored. If you're going to reuse the serial I/O pins, you'll have to disable the serial driver and "fake out" the places where it looks for an ESC character and other serial I/O. It's not hard to do.
The uOLED-96-Prop Basic uses 1 cog for the interpreter, 1 for the FullDuplexSerial driver, and 1 for the I2C/SPI low level driver.· That leaves 5.
·
forgive my ignorance on this subject, but is uSD interfacing different than SD interfacing? I was assuming the same code could do either. I have a uSD for my cell phone that I have an adapter for to insert it into a regular SD socket, I've tested it in my own SD Adapter and it performed as expected. But I was contemplating changing it's design to uSD for a smaller footprint.
Or were you just referring to the uOLED's onboard uSD slot?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian
uController.com - home of SpinStudio
I am referring the the uOLED's onboard uSD slot since that's attached to 4 Prop I/O pins and works fine with the same code that the other Basic versions use ... just change the I/O pin numbers.
Most Basics use a "console" where all commands, statements, and INPUT / PRINT output are done. FemtoBasic will use either the TV or VGA driver plus the keyboard driver for this data. The BoeBotBasic derivatives use a serial channel, usually the one used for programming. This Basic (like BoeBotBasic) uses the programming serial port. Like the other FemtoBasics, it will automatically run a program off an SD card. If this program doesn't exit and doesn't use the INPUT statement or KEYCODE function, it doesn't have to have anything attached to the serial port.
I've rewritten 4D Systems' demo program (from their website) in Basic and it's saved to the uSD card under the name "autoexec.bas". When the Basic interpreter finishes its initialization, it attempts to mount an SD card and looks for a file by this name. If it finds one, it attempts to load and run it. If you take the demo program from the archive, put it on a uSD card under the name "autoexec.bas", and download the Basic interpreter into the EEPROM on the uOLED-96-Prop, when you connect the device to +5V/Gnd, it will begin the demo within about 20 seconds.
The display is really too small (12 x 8 chars) for any kind of reasonable program development. The intention is that you use the serial port for programming and testing. Your program does all it's output using graphics and "little bits of text" on the uOLED display and takes its input somehow (like pushbuttons or a keypad) via the 4 I/O pins brought out to the display's header. When you're done debugging it, you just unplug the serial port and you've got a stand-alone device.
If you'll take a look at the uOLED-96-PROP object and demo posted on the 4D site (both are just normal SPIN code), and think of the 96-prop as a dev board with a display and uSD card interfaced to it, I think it will make more sense.
I'm working on a new (and improved) version of the object and demo that has text support for 8x8 and 5x7 fonts in the object. I should have that ready for 4D to post on their site this evening. Please keep in mind that the object posted on the 4D site is intended as a "starter" object. A prototype, if you will, to get folks started using the 96-PROP display. I contains the display initialization routines (the really tricky part of interfaceing a display like this) and enough graphics and character/text premitives to demonstrate how to extend the capabilities of the display by expanding and adding methods to the base "starter" object.
If you look at the documentation for one of the serial interface displays, such as the uOLED-128-GMD1, you can get an idea of the number and types of commands that can be built for the display. The "Circle" command is an example. The serial devices have a draw circle command. That command is not implemented in the current 96-PROP object (please feel free to write one).
Duffer
write BASIC programs with the display as the output device. The screen is about the size of a quarter.
I can't wait to try this on mine. It's sufficiently expensive (I've bought one) that I plan to be exceedingly
careful how I hook it up though.
i really understand your concern. beleive it or not, I have "lost" some of mine in the clutter on my work bench. I now leave them hooked up and running the demo. That way I can just turn off the lights and find them by the glow.
Seriously though, I have put together several little "carrier" boards with 10 pin headers on them and then wire-wrapped out to·headers for the 5 pin programming interface and the 4 available I/O pins and Vcc from the other 5 pins. I feel more comfortable when handling the displays this way and it also gives me more choices on how I orient the uUSB-CE5.
Even as small as it is, with the 5x7 font, you get 8 lines of 16 characters each and because the display is so bright an clear, it's very readable.
The new (I finished them VERY early this morning) Object code and demo (V4) are available on the 4D site this morning. http://www.4dsystems.com.au/downloads/micro-OLED/uOLED-96-PROP/Object-Code/
I added both·the 8x8 and·5x7 fonts along with improved Character and Text Methods, and hardware scrolling.
Enjoy,·· Duffer
BTW - Even though this isn't directly about FemtoBasic on the uOLED-96-PROP, I dont think that using FemtoBasic and the Propeller object and Spin code are mutually exclusive. Mike Green actually started with the Object code as a basis for the basic commands that he implemented in FemtoBasic. So there! I am not a thread hi-jacker!
Post Edited (Duffer) : 10/17/2007 4:11:06 PM GMT