SMART Response XE Tiny Basic Port

4,608

21

16

Introduction: SMART Response XE Tiny Basic Port

About: Lifelong Maker and Educator.

My love of retro computing has sent me on the journey to have a small handheld device that runs a BASIC interpreter. I was so happy to run across the SMART Response XE!

This was a popular classroom device that allowed teachers to setup lessons, quizzes, whatever into a program and then the students would use these devices to interact with the curriculum. The advent of wide spread cell phone use has made these devices obsolete. However, they are rugged, excellent on battery life, and best of all, COMES WITH AN ARDUINO PROCESSOR!!!

Yes, this humble device includes the Atmel ATmega128RFA1 processor with 128k RAM, 4k EEPROM, and external 1Mbit memory chip. It also includes an RF transceiver, but unfortunately, doesn’t use a common BLE or Zigbee interface.

In the battery compartment there are interestingly placed holes. When you crack one of these open, you will find programming pads that align with the holes allowing the units to be programmed without removing the case. This is good, because these units were meant for the classroom and are really hard to open.

Supplies

- SMART Response XE (found on eBay and others)

- SMART Response programming adapter (prototyping board, pogo pins, and wire)

- JTAG Programmer (I used the AVR ISP MkII)

- Tiny Basic Plus for SMART Response HEX file (in the GitHub repository)

Step 1: Make a Programming Adapter

You can construct a programming adapter by using a prototype board and some pogo pins to line up with the holes in the back of the unit. The photos shows the position of the JTAG programming pads. You can then insert the pogo pins in the associated holes and connect to a JTAG programmer. I used two protoboards sandwiched together which allowed the pogo pins to stay relatively vertical. I also soldered one end of wire to each pin and the other had a male header pin connector. I then used a solderless breadboard to connect each wire to the corresponding programming connection.

Step 2: The Software

I was thrilled to discover that Larry Bank had crafted an

Arduino library for interfacing with the keyboard, screen, and external memory.

SmartResponseXE Arduino Library

Then there is the awesome BASIC interpreter available called Tiny Basic Plus. The code was based off of the Tiny Basic Interpreter by Gordon Brandly for the 68000 computer. It was modified for Arduino by Mike Field, Scott Lawrence, and others and made available to the community. There are some great projects out there that use it with a PS/2 keyboard and an oled display. I have made these in the past. But when I saw the SMART Response XE I knew my destiny.

Tiny Basic Plus

Using the code for Tiny Basic Plus and incorporating the Arduino library, I have been able to port this software to the device. There were some challenges.

1) I am not a good programmer and the guys who wrote these programs knew what they were doing. It took a while to figure out the code and conform it to the hardware of the XE.

2) The way the display is hooked up on the board you cannot read from the display RAM. This meant I either had to have a large buffer to mimic the display so scrolling or formatted display options were available, or just use the hardware functions of the display itself to plainly show the text.

3) The external memory can have its memory read by single address, but could only be written to in 256 byte blocks.

I was able to overcome these issues and come up with an implementation that creates an adequate user experience.

I have significantly modified the Tiny Basic and library code so these are not replaceable by the originals. I tried to comment code when I modified it to help you interpret my changes in case you want to take this further.

The code preserves all of the original commands from Tiny Basic and adds or modifies the following:

LIST: The list command will list the program by page. Click any key to continue paging through. If you want to list to the end, press the space bar.

BYE: Bye will shut down the computer and display, and put the processor to sleep. In this state it consumes very little power. To wake it up, press the power button on the top of the unit.

BATT: The Batt command will return the battery voltage in millivolts.

WAIT: This command waits for a key to be pressed to continue program execution.

MSAVE: This will save the current program into external memory. You must follow the command with the data slot you want to use. There are 10 slots labeled 0 through 9. To save the program to memory slot 5, use the command MSAVE5.

MLOAD: Retrieves the program from memory. If you want to load the program in slot 5, use the command MLOAD5.

Del: The delete key is in the most logical place for the Enter key. In the library, Larry Bank mapped this key to Enter and I think it is the right answer. I tried using the navigation pad right pad for enter and it never felt right. Use the Del key for Enter. Deletion is now mapped to the navigation pad left pad.

Also, I don’t check for invalid keys (like the 10 function keys) so they will just put garbage on the display.

**** WARNING ABOUT DELETE ****

Because I opted to use the hardware functions of the display and not keep a display buffer, delete has some issues. If you are on a fresh line, you can delete the prompt and keep going. I can’t really check for this without adding some complexity to the code so I just leave it as a warning. Also, if your line of code carries over to the next line, you can delete things on that line, but if you go further, it will not reset to the previous line. Use it with caution. If you make a spelling error or the keyboard gives you a double letter, you can easily backspace with delete to correct it. But be aware of the limitations.

I have posted the code to GitHub. It includes the original copyrights in the modified code so you can review them. The authors were generous enough to allow us to use and share the code.

Arduino Code Repository

**** NOTE ON THE BOARD LIBRARY ****

I have seen a few people comment that the files won't compile in Arduino (lots of errors). I recently changed out my hard drive and went to a fresh install of files. When I went to compile the code again I got a bunch of errors. I decided to reload the board file (provided by Sparkfun. Instead of downloading the package from Sparkfun's site, I added their repository address in Preferences and selected the 128rf board in board manager and everything compiled again. The instructions to do this are located here:

Installing arduino ide board add ons

I hope you are able to get your hands on one of these
devices and program it. I have had a lot of fun just getting back to simple basic programming. If you do, below is a quick program for a slot machine that you can try out.

I have a few of these and will program them and put them for sale in my Tindie store in case you want one but don’t have the ability to program the unit.

Tindie Store

Thanks, and let me know if you build one.

******** SLOTS PROGRAM *********

5 M=100

10 CLS

20 PRINT "Slots"

30 PRINT

40 PRINT "$", M

50 PRINT "Enter bet"

60 INPUT B

63 IF B=0 END

65 IF B>M GOTO 50

70 X=RND(8)

72 Y=RND(8)

74 Z=RND(8)

80 CLS

90 PRINT "Spinning..."

100 DELAY(2000)

110 PRINT

120 PRINT X, " ", Y, " ", Z

122 DELAY (2000)

125 T=0

130 IF X=Y T=B*2

132 IF X=Z T=T+B*2

134 IF Y=Z T=T+B*2

140 IF T=0 M=M-B

145 M=M+T

150 CLS

152 IF M=0 GOTO 170

155 GOTO 40

170 PRINT "No money left"

180 END

Arduino Contest

Participated in the
Arduino Contest

Be the First to Share

    Recommendations

    • Remote Control Contest

      Remote Control Contest
    • Build a Tool Contest

      Build a Tool Contest
    • Leather Challenge

      Leather Challenge

    16 Comments

    0
    Cryo_Gen
    Cryo_Gen

    Question 11 months ago

    Got the whole thing working, had to use an UNO as a SPI programmer. I have a question though, how do you create the ";" semicolon character on this? I'm noticing a lot of older basic games use this character.

    P.s. in general this is such an awesome idea! A portable retro computer with a 2.4ghz antenna. What fun

    0
    TheWheel2
    TheWheel2

    Answer 21 days ago

    Hi Gryo_Gen,

    I’m still waiting for my units but have not found any infomation about how-to-use the RF transmitter. You seem to have.
    What I would like is using the Smart Response as a wireless terminal using the 2.4GHz transmitter in the unit and an external transmitter with serial to a “device under test”.
    is this possable and do you no how?

    0
    DanGeiger
    DanGeiger

    Reply 19 days ago

    If you go to this repository:
    https://github.com/sparkfun/ATmega128RFA1_Dev
    You will see a sketch called Basic Chat (firmware/sketches/BasicChat). It has a file RadioFunctions.h which has a lot of the functionality you need and the Basic chat is a great example of how to send data between radios.

    0
    TheWheel2
    TheWheel2

    Reply 17 days ago

    @DanGeiger, thanks!

    0
    DanGeiger
    DanGeiger

    Reply 10 months ago

    It is the symbol key and the "i" key. You can check the mapping of all the keys in the SmartResponseSE.cpp file. It shows the normal, shifted, and symbol key map there.

    0
    Cryo_Gen
    Cryo_Gen

    Reply 10 months ago

    Excellent. Thank you for getting back to me. Works like a charm

    0
    djbum66
    djbum66

    Tip 9 months ago

    Anyone looking to do this and runs into trouble, here are a few of the things I learned along the way.
    Buying and installing an inexpensive AVRISP MKII for your windows 10 laptop gets complicated when loading the drivers, its a pain but there is enough info out there to help guide you thru the process. this link was super helpful: https://boseji.com/posts/installing-avrisp-mkii-with-libusb-win32-on-windows10/

    After you get the drivers worked out for the AVRISP the hex file you need for the SmartXE is here https://raw.githubusercontent.com/Subsystems-us/SM... cut and paste that hex code into notepad and save it as a .hex file, this is all the code you need to get running. now the hard part is to get the code into the SmartXE.

    When you build the adapter take your time and do it right, use pogos just like in the pictures. I had to ream out the holes (use a very small drill bit) on my PCB just a tiny bit to press them in, better too tight than too lose, if they are flopping around while you are soldering they will never be straight.
    If the AVRISPMKII is working well and you have a good pogo connection
    the smartxe should power up without batteries and the ISPs led should be
    green, not red.

    After trying AVRDUDE command line, AVRDUDESS and ARDUINO IDE and failing several times I used microchip studio https://www.microchip.com/en-us/development-tools-... to install the hex file onto the SmartXE. microchip studio is a really bloated piece of software and takes forever to install.

    In Microchip Studio go to TOOLS>DEVICE PROGRAMMING and there are my settings in the snip attached to this message. fill out tool(AVRISP mkII), device(ATmega128rfa1) and interface(ISP) fields and click apply. if you are properly connected you will be able to click device signature read and communicate with the SmartXE.

    Point the flash section to the hex file you saved and while you are connecting the pogos to the SmartXE click Program, programming takes less than ten seconds. The SmartXE will immediately display the tiny basic start screen and you are home free.

    Good luck, this is an inexpensive exercise and was fun.







    Capture.JPG
    0
    mrmath
    mrmath

    11 months ago

    I also got compile errors, but the hex file uploaded fine.

    What I've noticed is that the power button no longer works to shutdown the device. I wonder if there's some code to do that.

    0
    secristr
    secristr

    Reply 11 months ago

    Yes, the command "bye" shown at the end of the video.

    0
    mrmath
    mrmath

    Reply 11 months ago

    It was a classic case of RTFM. I admit it. I should have known, but I didn't watch the video to the end. I hang my head in shame.

    (PS: I'm serious. I really feel ashamed that I asked a question that was answered "in the manual." I should know better.)

    0
    DanGeiger
    DanGeiger

    Reply 11 months ago

    The Power button only turns the unit on. Use the command "Bye" to shut down.
    I also started to have issues compiling the code. I think it is something to do with the board definition file.

    0
    DanGeiger
    DanGeiger

    Reply 1 year ago

    They are 1 inch long nd about 1mm in diameter.

    0
    kd8bxp
    kd8bxp

    Tip 1 year ago

    Excellent - I got the hex file to load no problem, but got various compile errors when I tried to compile the sketch. That being said, this works like a charm.
    I've chatted a few times with Larry on twitter, very nice guy, and very helpful when I was starting out with the Smart Responses.
    BTW: the smart response can also do graphics, and I added some basic shapes to Larry's library, as well as updated it with some more advanced graphics from fdufnews repositories. I also gave it the ability to change fonts, and added some fonts that I found around the internet.
    fdufnews also ported a basic, but I think he added an SD card to his: https://github.com/fdufnews/SMART_Response_BASIC
    His low level graphics library: https://github.com/fdufnews/SMART-Response-XE-Low_...
    And my changes: https://github.com/kd8bxp/SmartResponseXE
    If you find anything that needs to be fixed or corrected let me know (if you look at it at all :-) ) I just found these devices a couple of months ago, and have had a lot of fun working with them.

    Thank you for the port of basic, this really does make this a computer palm sized computer.

    IMG_20210611_212444465.jpgIMG_20210611_212432954.jpgIMG_20210611_211137618.jpg
    0
    DanGeiger
    DanGeiger

    Reply 1 year ago

    Thanks so much. And thanks for all of your work. Developers like you just make people want to make.