Shop OBEX P1 Docs P2 Docs Learn Events
FemtoBasic for the uOLED-96-Prop — Parallax Forums

FemtoBasic for the uOLED-96-Prop

Mike GreenMike Green Posts: 23,101
edited 2007-10-17 16:04 in Propeller 1
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.

Comments

  • BeanBean Posts: 8,129
    edited 2007-10-15 18:42
    Mike,
    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
    ·
  • RaymanRayman Posts: 14,162
    edited 2007-10-15 23:04
    This is great Mike. I'm thinking hard about the uOLED-96-Prop and whether it has enough spare pins to useful for me... Having FemtoBasic ready for it is a definite plus! May tilt the balance...
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-15 23:55
    Rayman,
    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.
  • RaymanRayman Posts: 14,162
    edited 2007-10-16 00:10
    Mike,
    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?
  • RaymanRayman Posts: 14,162
    edited 2007-10-16 00:12
    Mike,
    Does the uOLED-96 use the built-in ROM font? Or, does it's display controller have a font?
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-16 00:22
    1) The onboard EEPROM pins are not accessible. Only pins 30/31 (Rx/Tx) and pins 18/19/20/21.· The display does include a uSD card socket which uses 4 I/O pins.· The display uses around 14 pins for itself

    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
  • RaymanRayman Posts: 14,162
    edited 2007-10-16 00:35
    Mike,
    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
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-16 00:45
    You could use pins 30/31 for an alternate I2C bus. You'd need to modify the Basic for the uOLED-96-Prop so it doesn't use 30/31 for serial I/O. It's not a big deal to do it. You'd want to use the Tx line for SCL and the Rx line for SDA (and you'd need a pullup there). You do have to use the Basic for the uOLED-96-Prop, but it is FemtoBasic with extensions. You could modify it to use the tiny screen for console output if you want.
  • RaymanRayman Posts: 14,162
    edited 2007-10-16 01:16
    Mike,
    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...
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-16 01:37
    The uOLED-96 display has an 8-bit parallel bus for data transfers so it doesn't really need a cog to manage the little bits and there's no real waiting for action. It doesn't need an extra cog. All the I/O is done in the main cog.

    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.
    ·
  • parts-man73parts-man73 Posts: 830
    edited 2007-10-16 02:55
    Mike Green said...
    There's uSD card support

    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
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-16 03:08
    uSD card interfacing is identical electrically to SD card interfacing. The only difference is mechanical (and maximum capacities).
    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.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-16 06:01
    An updated version of uOLED96Prop Basic has been posted to the Object Exchange. Several bugs have been corrected and all of the display statements appear to work except for the SCROLL commands. These will get fixed in the next few days.
  • JT CookJT Cook Posts: 487
    edited 2007-10-16 13:23
    Any chance we can see a screenshot of it running on the OLED?
  • RaymanRayman Posts: 14,162
    edited 2007-10-16 13:29
    I think Mike is saying that it doesn't display anything on the oLED, but just communicates over serial data connection... But, I think he said that it could be modified to display on the oLED. I would prefer this, I think, because I had a stand-alone device in mind...
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-16 14:29
    To clarify:
    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.
  • DufferDuffer Posts: 374
    edited 2007-10-16 16:42
    Mike has done a wonderful job, as usual, in getting the uOLED-96-PROP to work with his OS and FemtoBasic. I think some of the confusion stems from the fact that some people are expecting the 96-PROP to act as a stand-alone development system. It might be helpful to think of the 96-PROP as just anouther Propeller dev board. If you compare it to the Prop Dev board connected to a vga monitor (with those pins tied up) and 4 pins used to interface to a SD card,·you get the idea. The 5 pin programming interface is much like the Prop Plug interface (Gnd,Res, Rx, Tx) with the 5th pin of the group being +5V DC. When connected to a PC using a uUSB-CE5, uUSB-MB5 or some other appropriate level shift circuit it acts just like any other Propeller dev board.

    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
  • RaymanRayman Posts: 14,162
    edited 2007-10-16 17:31
    With 5x7 fonts do you get a 19x9 character display? This sounds like enough for FemtoBasic to use as primary display (maybe?)... I guess what I'd do anyway is use the core Femto routines to implement a menu system, like that of Chip's "Kiosk" example...
  • rokickirokicki Posts: 1,000
    edited 2007-10-16 17:37
    Until you've seen how *small* this device really is, you really can't see what it's going to be like trying to
    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.
  • DufferDuffer Posts: 374
    edited 2007-10-17 16:04
    Rokicki,

    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. smilewinkgrin.gif

    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! smilewinkgrin.gif

    Post Edited (Duffer) : 10/17/2007 4:11:06 PM GMT
Sign In or Register to comment.