Smart Response XE Re-purposed into Arduboy


(serisman) #323

I plan on using the SDCC compiler (free), and < $5 SmartRF04EB downloader module.

https://www.aliexpress.com/item/p/32862698125.html

The same compiler and downloader module can be used for the Smart Response PE devices with the CC2430 MCU.


(serisman) #324

Just ran across this too:

http://www.moonbaseotago.com/cheaprf/

They even built a custom programmer that is based on a Atmel AT90USB162 (which looks almost identical to the ATmega16U2). Wonder if we could modify the firmware to run on an Arduino Pro Micro (or similar)?


(Larry Bank) #325

I played with SDCC and I have the $10 CC Debugger from China. Still no go for me. It’s a hot mess and not worth the time and stress to get things working.


(serisman) #326

Yeah, I have used SDCC to program some STM8’s. It wasn’t that bad, but nowhere near as easy or convenient as the AVR-GCC/Arduino environment.

In looking at it more, I’m convinced that an Arduino Uno R3 could be easily converted into a CCxxxx capable programmer using the work mentioned two posts above: (http://www.moonbaseotago.com/cheaprf/programmer1/programmer1.html) The AT90USB162 and ATmega16U2 are pin and binary compatible, meaning one should be able to just flash the provided hex file (after putting it in USB bootloader mode by shorting D7/HWB to ground and resetting the ATmega16U2). The Arduino Uno R3 schematic indicates that all the required pins (GND, 3v3, PB4, PB3/MISO, PB3/MOSI, PD3/TxD, and PD2/RxD) are accessible, meaning a very simple adapter could be created to support the TI CCxxxx programming interface. I may have a go at it tonight.


(Simon) #327

UHI love this thread and are monitoring it closely as I have a pair of these that I want to use.

I am getting very confused as to want streams of activity are going on and suggest we split the conversation into separate threads, something like -

  • Using the Smart Response XE as Arduboy (simply flashing the SR XE to act like an Arduboy)
  • Communicating directly between two SR XEs
  • Flashing the Smart Response XE via WiFi
  • Adding additional hardware features to the Smart Response XE

#328

…had no idea reading this who Dr. Cadic is, but after a quick search found their dedicated ‘Smart Response XE Mods’ website - awesome! :slight_smile:

http://www.srxe-hack.org/


(Simon) #329

Ignore my previous message … this new site is the obvious place for this sort of discussion.


(serisman) #330

I had a go at it last night and made some good progress.

Using the AVR-GCC code associated with the link above, it was pretty easy get compiled and uploaded to the ATmega16U2 of an Arduino Uno R3. I did have to re-compile the code for 16MHz instead of 8MHz, and I moved one of the outputs to a different pin, but that was pretty easy.

The associated software was a bit more challenging. It is only available as source code for Linux based systems. My development machines are all Windows based still (although I love Linux for other things). But, I was able to use the source code to whip up a node-js app that at least proved that the hardware was communicating properly. I was able to successfully connect to a Smart Response PE (CC2430) device I have lying around and read the chip id, read the status registers, and perform a chip erase. It is more complicated to actually program the flash, and I ran out time, so I left that for today. Also, I didn’t have anything ready to program in yet.

So… today (after getting very little sleep last night), I decided to take a bit of a different approach. I’m not real keen on requiring that people have access to an ATmega16U2. There isn’t anything particularly special with the code that requires that MCU. In fact, I had run across another similar option a few weeks ago that I wanted to give a try (http://akb77.com/g/rf/program-cc-debugger-cc2511-with-arduino/). I think one of these is based off of the other one because a lot of the source code is very similar.

The benefit of using this other sketch is that it should run on just about any Arduino. It has very lightweight requirements (only uses 3 digital IO pins and compiles down to less than 4kB). I happen to be using it on an Arduino Nano.

There is also a compiled Microsoft .NET Windows GUI application available through the linked repo. I ended up fixing a bug in the .NET application and converted the Arduino sketch to use FastGPIO for better performance. My fork is here: https://github.com/serisman/CC.Flash

I also threw together a fairly quick Hello-World sample application to prove that I can compile code for the CCxxxx MCUs and upload it to them. And, it works! I can blink LEDs at a specific time interval (using Timer 4). Sample code here: https://github.com/serisman/Smart-Response-PE

For ease of development, I am doing all of this with a Smart Response PE Receiver which has the same CC2430 IC as well as a CP2102 USB-to-serial IC hooked up (and 4 LEDs). My next step is to get the UART working for better debugging, and then start working on some RF code.

So, long story short, I still think using CCxxxx based devices for the RF ‘hub’ is the way go to. I have proven (at least to myself) that if we were able to come up with a firmware, just about anyone with an Arduino should be able to flash it to one of those CC2531 based USB modules (or a Smart Response PE Receiver like I am playing with).


(Larry Bank) #331

That looks very promising. I have the PE “clicker”, not the receiver. If you can figure out how to access the hardware on that board, I’ll join in and contribute to the software. I can’t spare too much time on it at the moment.


(serisman) #332

I probably won’t pick this back up for a few days (working on finalizing the PCB design for my ArduBigBOY), but certainly plan on doing more work with this.

What hardware specifically are you interested in working?

I already have general I/O figured out and wired up basic serial port functionality. The keyboard should be pretty easy to get working (it is just a simple matrix like the SRXE). The RF should be reasonable as well (it is all documented in the data sheet). The LCD might be challenging (or may and up being extremely easy depending on the quality of existing libraries).


(Larry Bank) #333

If you can figure out the keyboard mapping, how to use the RF and the LCD that would be ideal :slight_smile:
The LCD does look challenging because it’s definitely custom and may be an alpha-only (internal character ROM), or a row of symbols plus a 128x48 array.


(serisman) #334

Yeah, that’s what it looked like to me.


(Larry Bank) #335

Has anyone thought of using them as a smart IR remote control? Maybe even use the RF as a repeater to a second one which would serve as an IR blaster. You could put a pair of IR LEDs in series with a transistor and the 6v battery output - probably sink > 100mA of current without a sweat.


(serisman) #336

Got the keypad, and LCD working!

But, I really need to go to bed now (5:30 AM here) so no code posted until later. :crazy_face:


(serisman) #337

@bitbank: The code has been cleaned up and uploaded to my GitHub repo:

There is now a Hello-World-Clicker sample application that:

  • Draws text and graphics on the 128x48 LCD
  • Displays a millisecond counter (wired up to Timer 4)
  • Displays a keymap indicating which keys are currently pressed
  • Sends data over the serial port (wired up to USART1 Alt. 2)
    • TxD (P1_6) can be pulled off of JP2 (connect to USB-to-serial’s RxD)

Right now the display library is pretty basic. It only allows 5x7 text on a 6 row by 21 column layout. Bitmaps can only be drawn on a row boundary as well (no partial overlap).

Also, all drawing is done straight to the display right now. It should be relatively straightforward to introduce the screen buffer concept like we have with the Arduboy library and then pull over many of the same drawing routines.

I already have the uc7101 code broken out to it’s own file that is separate from the display code. I was intending for the uc7101.c/.h to stay pretty much about the hardware. It really only needs to expose the init and paint screen (currently commented out) methods. The actual screen buffer and all the drawing routines can then go into the display.c/.h file.

It’s too bad the actual usable screen is only 128x48 instead of 128x64. :angry: I have not tried to use the ‘icons’ yet, but I think they are wired up to ‘page 8’ in the display memory.

I also haven’t done anything with RF yet.

But, the code is fairly clean (though there is always room for improvement!), and compiles down to a measly 3,394 bytes (of which 878 or so is font and bitmaps)!


(serisman) #338

I must be a glutton for punishment cause I just bought 6 more XE receivers off of eBay today (for a pretty good price). Not sure what I will do with them all yet, but seems like the hardware alone is easily worth the price I paid.


(Larry Bank) #339

Excellent work! I’ll see if I have time over the next few days to try some experiments.

I also ordered one of the new Nordic nrf52840 eval boards. Looks like it might work to use it as a hub instead of a butchered XE unit. It’s $10 and for me, the shipping+tax was another $4.

https://www.nordicsemi.com/eng/Products/nRF52840-Dongle


(Larry Bank) #340

The Smart Response PE “clickers” are quite cheap when bought as a lot. Anyone interested in splitting a set if I can get them for < $2 each?


(serisman) #341

Yes, they certainly are. I bought a 30 pack (plus receiver) for $23.23 (shipped) which made them less than $1 for me. I don’t need any more at this point. Not sure what to even use them for other than learning a new system.


(Larry Bank) #342

I couldn’t resist - I got a set of 33 and it included 3 “Smart pens”. I have no idea what the pens are, but it looked interesting enough to buy it.

37%20PM