If you’ve ever built anything with a microcontroller, some sort of sensor, and a connection to the outside world, you’re probably wondering how those places in China can pump out cheap electronics for a mere percentage of what it costs you to pull a DIY. It’s not just volume – it’s engineering; if something has Bluetooth, you find a Bluetooth module with a built-in microcontroller so you can write firmware to it.
The BC417 is the System on Chip found in the very popular BlueCore4-Ext Bluetooth module featuring 8Mbits of Flash (75% of which is used for Bluetooth related stuff), somewhere around 12 kB of RAM, with everything run in a virtual machine. [pfalcon] wrote an extremely experimental firmware for this device that allows anyone to create a wireless sensor node for peanuts. These devices are almost as cheap as a bare ATMega, so the possibilities are interesting, to say the least.
At this point, the hardest part of putting custom firmware on these devices is programming them. For that, [Elastic Sheep] comes to the rescue with a parallel port to SPI interface. There’s also a firmware dumper and some breakout boards available. These modules are pretty cheap, and the pitch isn’t too bad, so you might be able to etch your own boards should you want to experiment a little.
Thanks [Peter] for sending this in.
maybe should be “It’s not just volume – it’s engineering – reverse it’s engineering – it’s stolen designs”
often we may see the numbers scraped off an ic so a company cant go ” hey that is our stolen design”
Unless you have the expensive Toolchain all of this is pretty difficult to make any use of.
Yep… I guess most of people get that toolchain off torrents anyway.
How exactly does the firmware run in a VM? Why on earth would they do this when there is only 12KB of RAM?
The customer code (in this case the ‘firmware’ mentioned) runs on the VM. The real CSR firmware runs elsewhere.
Wonder why that kind of setup? Does it make it easier to code for? Or is it more for isolating certain features, to be paid for selectively?
It’s due to wireless regulation compliance. Locking the module down means that they can get the module FCC/CE/whatever certified, and that certification isn’t invalidated just by sticking it on your own board – since you can’t make the module do things that violate the regs. Otherwise, just by putting the module on your board forces you to pay $$$ to get a full recertification.
Who the hell has a parallel port on their computer these days?
anyone who uses mach3 or linuxcnc…
I keep several around with both serial and parallel, there are countless uses for these ports. Plus the fact the usb to either if you are using them for timing sensitive situations can cause real problems and the need for a real time clock saves so many headaches.
the way I see it … old-ish computer with parallel port = nearly free cnc controller, if you put linuxcnc on it… even better with a old agp video card…
No need for old computer, for $10 you can get PCI or PCI-E card with parallel port.
Or an old computer. :P
thegoodhen: the PCI card wont use nearly as much energy, saving money in the long run.
Me, and what’s more, it is a motherboard for a chip (socketed Kabini) that was only released a couple of months ago. I don’t actually give a damn about the pport, but the board had other desirable features, like an extra two SATA 3 ports and USB3 ports.
He uses a Teensy to supply power to the bluetooth module and as a USB to serial interface but neglects to use the Teensy’s dedicated SPI interface (3.3 V so you don’t need to use voltage dividers)? Instead he uses a parallel port on a computer to emulate SPI. Makes me confused as to whether to scratch my head in confusion or apply face to palm.
The reason he is using the parallel port is so he can use the official CSR software.
Here’s a firmware for the stellaris launchpad that turns it into a clone of CSR’s abusively expensive USB-SPI device, allowing you to use their programming tools without a parallel port:
https://github.com/Frans-Willem/CsrUsbSpiDeviceRE
The motherboard I bough a year ago has a parallel port (FM2A75 pro4-m)
i would love to have them stuffed with HID code…
I believe there are already firmwares floating around for just that. I have a cheap BT micro keyboard that appears to have one of these soldered to it
I’ve seen some datasheets for the bc417 and also know that it is possible, but wondered why they would not offer a better system for tinkerers to set them to HID mode. I guess it is not so common to use a bluetooth HID stack rather then a serial one and this is were they earn their money. There are solutions out there, but not that cheap or easy to order within Germany, except the RN-42-HID maybe. But 20euros versus 5euros still makes a difference.
Programando el bluetooth HC-06 y HC-05 con Stellaris Laucnh Pad http://blog.theinventorhouse.org/programando-el-bluetooth-hc-06-y-hc-05/
FT232HQ and FT2232D support SPI at a level of difficulty of a USB-to-serial converter.
It is easy to work with and runs both with FTDIs ftdi_libmpsse and the libusb-based open libmpsse. I cleaned up the API a bit and wrote a COM to SPI tool (add a com0com loop and you can control SPI via hterm).
I can’t see how anyone would still bother using parallel ports. Instead, I encourage everyone to give these chips (or equivalents from other manufacturers) a look.
ps. some JTAG programmers are also equiped with these chips :)
Because built-in parallel ports just works.
Minimal fuzz and low level access.
When USB gets thrown into the mix, things often goes haywire due to the sheer complexity of any USB-to-X converter.
Same reason some people still uses PS/2 keyboards.
n-key rollover is also nice
The programming interface for the module is a proprietary protocol over SPI. You might be able to make a SPI interface easily enough, but the closed-source utilities that know how to program the module don’t recognise that hardware. The parallel port is the simplest hardware a user can build that is supported by the CSR tools. Another option is the firmware I linked elsewhere in the comments that requires a specific Launchpad board.
Now if only someone can show me a BIP stack on one of these…lots of bluetooth chips with high bandwidth audio, but not a one with a simple command for image push.
Obsolete: Try this https://www.nordicsemi.com/eng/Products/Bluetooth-R-low-energy/nRF51822
So I can get those for under $10 easily? Awesome, gimme the link.
Search Ebay for HC-05 or HC-06 (same module different firmware)
http://www.ebay.com/sch/i.html?_trksid=p2050601.m570.l1311.R1.TR8.TRC1.A0.H0.XHC-0&_nkw=hc-05&_sacat=0&_from=R40
That’s the easy part… Now is there a legal place to get the tool chain needed to build these devices? Even been looking at the MFG website and it is not clear what you need to purchase to get up and running on these things.
Aren’t they mbed compatible? There’s definitely an mbed dev board for this. Otherwise IIRC the standard dev board is like £80 and comes with a key for the software and access to docs!
Got a link to that dev board? Last time I went looking the only thing I could find started around $4k. But kit did have a lot of extra bells and whistles.
pelrun Looks like those may be obtainable at <$10 http://www.ebay.com/itm/2-4G-NRF51822-Wireless-Module-Wireless-Communication-Module-/121342311888
:-))
OK … it’s $13 Qty 1, but it’s an FCC certified BLE module with built-in smartBasic programming language and more. Like I said the BC417 is obsolete.
http://www.mouser.com/ds/2/223/Laird_BL600-300439.pdf
Too bad even though the commercial toolchain used to code for these chips is gcc based, it is not open and you need to purchase it do do anything interesting.
Got a link to where one can buy the tool chain? Know it is expensive but have not found a link to buy for the exact price.
I’m just guessing, but I think you have to request it to CSR, and they might only sell it to you if you are from a company and sign some NDAs.
that toolchain is illegal, I dont even know how CSR UK can sell it.
These are really old modules, you can get the full tool chain for them when you buy the dev kit digikey part number BCES01-EP-ND. Once you buy that you can get on csr support can get new firmware and more example apps etc..
My advice is move to Bluetooth SMART- the uEnergy starter kit is $100 for the full tools and firmware (DK-CSR1010-10169-1A-ND digikey), with many example apps including HID keyboard and mouse apps. The modules are £10 from BCDmicro in the UK and probably many other places. This dev board also has an official USB to SPI adapter that you can use in blueflash and can be jumpered off the board for programming Bluecore devices as well as uEnergy devices.
unit price 700…. o.O
Does anyone know if the CSR chip can be persuaded to support audio streaming and RS232 at the same time?