extreme press’n’peel: prototyping MP2109DQ

Okay, I’m still around here. Somewhere. 😉
If you haven’t heard, there are some really cool&tiny stepdowns: MP2109DQ. I got a bunch of ’em nearly as cheap as AMS1117 linear lowdropouts.
These are synchronos stepdowns, 2 of them in one package. Unlike some bulky LM2596 – no diode needed. Only 2.2uH inductor and a few capacitors and resistors.
Cool things come in small packages: it’s packed into QFN10 (3×3 mm).
However, I didn’t want to put them on my BIG project without testing, so I decided to throw up a small board to test it, as usual. And also check, if my “press’n’peel” and “soldering ninja” skills are high enough for QFN10 (The first time I’ve done that to QFN, actually). Result was a success, from the very first time. Obligatory pics follow, more under the cut.

(more…)

Beware: USB killer-hubs

A few days ago a friend told me he had a nasty crash. An externally-powered USB hub screwed up his motherboard on the laptop just after he plugged in the power brick. He even showed me that hub. A 10-port hub just like the one I got from china (DX or aliexpress – I do not recall). The only difference – he picked up his at a local shop for twice its actual price. So, once I got to my lab, I cracked mine open to have a look what the heck could deal such a damage.

(more…)

stcdude 0.1-rc1 is here.

Well, that was fun, and I can now finally show off with the first release of the stcdude.
stcdude is an opensource ISP programmer for the STC microcontrollers designed to run under linux from commandline. A long awaited sane replacement for the retarted STC ISP Tool written in VB6.
Finally you can get on with the development using the tools you like: sdcc and make.

(more…)

Some fun calculus

Fun with STC goes on. This time it came down to a nice&shiny maths task. So. The Host computer determines the frequency the MCU is running at using 8 16-bit numbers transmitted in the infopacket. These are the raw timer values of 8 samples, that measure some part of a timing diagram. What part of 2 bytes being transmitted ( {0x7f, 0x7f} ) is measured – we do not yet know. From these we have to determine the MCU frequency. Fun calculus under teh break.

(more…)

Say hello to stcdude.

Okay, it’s been a while, since I made any (real) progress on the issue, but now, well, there’s at least something to show.
I happened to be an idiot and spent a few days trying to crack a CRC-16 with a non-standard polynome, and didn’t see that it was a plain sum of the payload bytes. Afterwards, stuff was quite trivial and the protocol – simple as hell. Right now I wrote some quick and dirty parsers in bash and lua to get me the mcudb out of KEIL CDB file processed with ‘strings’. Right now it’s just a plain lua table dump, that can be updated with info extracted from a keil cdb file or by hand. Kind of slow, but for this purpose I think it’s ok for now.
Anyway, my ‘proof-of-concept’ code already does the basic things like getting and partially decoding the info packet:

[necromant@lamia stcdude]$ ./stcdude -d ./mcudb/stc12x.lua -p /dev/ttyUSB1 -i
STC ISP Tool. (c) Necromant 2012
Using mcudb file: ./mcudb/stc12x.lua
Loading mcudb ./init.lua
Done with result 0
Loading mcudb ./mcudb/stc12x.lua
Done with result 0
Using /dev/ttyUSB1 @ 19200
fd is 3
Waiting for an infopacket from MCU...
 --- 8< ---
Part name:       STC12C5A32S2
Magic bytes:     D170
IRAM size:       256 (0x100) bytes
XRAM size:       1024 (0x400) bytes
IROM size:       32768 (0x8000) bytes
Tested ops: FixMe: implement reading of tested ops
Description:
        8051-based microcontroller with 1T(1-clock) High-Speed Core,
        Dual DPTR, 36-44 I/O Lines, 2 Timers/Counters, 2 PCA Timers,
        Alternative build-in oscillator,
        Independent Baud Rate Generator, Programmable Clock-Out,
        32K bytes flash ROM, 1280 bytes data RAM,
        On-chip EEPROM, 2 UARTs, WDT, ISP/IAP, A/D, CCP/PWMm
--- 8< ---

Further stuff is still work-in-progress, diggings showed up, that there might be at least 3 different variations of the ISP protocol, so we're far from full-blown support. But since most things stay the same, after the initial skeleton is ready, adding support for further variations should be straightforward.
For those who want to try out this stuff, grab your copy at my github.

Windows XP: transferring an installation from one partition to another (worst case)

Okay, a lot of people hate windows these days, few can say why.
A have quite a few reasons to do so. Especially, since quite a few retarted developers write software that I _have_ to use, to get some the work done, I eventually have to boot it, and, even, work in it. Luckily, thanks to the fact emacs feels nicely even there, that’s not big deal … But the tale is about how I wasted a whole evening trying to move a windows installations from one hdd to another. If in case of *NIX that takes a few minutes and a few config files to edit, here… Well, it’s a different reality.
So, my setup:
Old hdd, now in a usb-hdd enclosure:
/dev/sdс1 – / of the installed linux (Agilia)
/dev/sdc2 – swap
/dev/sdc3 – A temporary field for experiments with moblin/android x86/etc
/dev/sdc4 – WinXP

On the new drive, now fitted into my asus n10j the table was as follows:
/dev/sda1 – A spare place for Windoze
/dev/sda2 – / of Arch Linux
/dev/sda3 – swap

(more…)

STC 8051: Some research notes

I picked up a bunch of those uCs + a dev board quite some time ago. I even did some initial digging, but due to the lack of free time postponed any work on them. These uCs may not seem that tasty as stm32, but are still quite powerful and dirt cheap. (If you want to flood the market with something).


(more…)

utool for android: run a script once you insert a flash.

Looks like I’ve been kind of productive these days, making the third app this week. This time it’s a very weird one.
It is a small android app that allows you to run a custom script, once a device with a special markerfile in its root dir is mounted by the system.
That’s it. Too bad we don’t have anything similar to udev here, otherwise we’d only need to write one rule.
Create the script file with whatever you want to, place it somewhere in the device, create an .IOMARKER file in the root of the flash jump drive, or microsd (or change the filename in settings), fill in the path to the script, pick if you want to run as root.
Done.


(more…)

Another android app: FixNet

Okay. Android is not a perfect platform, but so far the best for me. Anyway, quite a few thingies are shitty. one is how dhcp hostname is handled. The default dhcp hostname is ‘android_’ + a huge device id. Not a big pain if you have a static mac address, and can therefore assign a readable hostname for the device on the home net.
However that was not the case for wired ethernet on my flytouch2 tablet that I’m turning into a standalone terminal. Due to teh fact that whoever made this was retarted enough the device was getting a random mac everytime it booted.
Just awesome. Just a nice anon’s tablet…
Anyway, I needed a way to fix that. The fast way was repack the ramdisk image and add some stuff to init.rc. I could fix the mac there, but still no way to fix the hostname, since it is set by java code after the init.rc.

(more…)

NetTTS 0.2 released!

Finally found a little bit of time, and here we go. NetTTS 0.2 release with most bugs I knew of fixed, maybe some new added.
For those who aren’t familiar – NetTTS is my app for android that allows you to use android’s TTS engines remotely with primitive tools like netcat or telnet around.
(more…)