APC Smart Signaling cable

+-----------------------------------------------------------------+
|                                                                 |
|  Black APC 940-0024C Smart Signalling UPS Cable Wiring Diagram  |
|  This information is verified and tested to be 100% correct.    |
|                                                                 |
+-----------------------------------------------------------------+
|                                                                 |
|       DB9M(UPS)            2m Cable          DB9F(Computer)     |
|       ---------            --------          --------------     |
|                                                                 |
|         (SHELL)<---------+----//----+----------------<(SHELL)   |
|                          |          |                           |
|                          -          -                           |
|                         | |        | |                          |
|       CHASSIS 9<--------------//---------------------<5 SG      |
|                         | |        | |                          |
|           TXD 2<--------------//---------------------<2 RXD     |
|                         | |        | |                          |
|           RXD 1<--------------//---------------------<3 TXD     |
|                         | |        | |                          |
|                          -          -             +--<1 DCD     |
|                                                   |             |
|                                                   +--<4 DTR     |
|    NOTES:                                                       |
|    Cable type is shielded 28AWG.                  +--<7 RTS     |
|    The DB shells are connected                    |             |
|    to each other via the shield.                  +--<8 CTS     |
|                                                                 |
+-----------------------------------------------------------------+
|                                                                 |
|    Operation:     The UPS communicates with the Computer via    |
|    ordinary RS-232 serial protocol at 2400-8N1 with software    |
|    flow control. Jumpered pins in the DB9F connector are for    |
|    automatic or PNP cable identification by UPS software.       |
|                                                                 |
+-----------------------------------------------------------------+
|                                                                 |
|                           Male (pins)        Female (holes)     |
|   DB9 RS-232  PC                                                |
|   type connector          1         5         5         1       |
|  ----------------       _______________     _______________     |
|  Pinout numbering       \  . . . . .  /     \  o o o o o  /     |
|  looking into the        \  . . . .  /       \  o o o o  /      |
|  end of the cable         -----------         -----------       |
|                             6     9             9     6         |
|                                                                 |
|  NOTE: Solder a wire to the metal shell for use as a FRAME-GND  |
|                                                                 |
+-----------------------------------------------------------------+

https://serverfault.com/questions/524443/is-apcs-smart-signaling-cable-940-0024-really-proprietary

Had to order some connectors to get the pinouts correct for my USB-serial adapter.

LGA 771 MOD problem update

Had one little glitch and Linux kernel reported that

Kernel panic – not syncing: Timeout: Not all cpus entered broadcast exception handler

Long story short: decided to force Microcode reload;

# echo 1 > /sys/devices/system/cpu/microcode/reload

After which dmesg showed following:

# dmesg|grep "microcode"
[ 0.379109] microcode: CPU0 sig=0x1067a, pf=0x40, revision=0x0
[ 0.379122] microcode: CPU1 sig=0x1067a, pf=0x40, revision=0x0
[ 0.379133] microcode: CPU2 sig=0x1067a, pf=0x40, revision=0x0
[ 0.379144] microcode: CPU3 sig=0x1067a, pf=0x40, revision=0x0
[ 0.379227] microcode: Microcode Update Driver: v2.00 <tigran@aivazian.fsnet.co.uk>, Peter Oruba
[ 947.508200] microcode: CPU0 sig=0x1067a, pf=0x40, revision=0x0
[ 947.509150] microcode: CPU0 updated to revision 0xa0b, date = 2010-09-28
[ 947.512629] microcode: CPU1 sig=0x1067a, pf=0x40, revision=0x0
[ 947.513623] microcode: CPU1 updated to revision 0xa0b, date = 2010-09-28
[ 947.516941] microcode: CPU2 sig=0x1067a, pf=0x40, revision=0x0
[ 947.517003] microcode: CPU2 updated to revision 0xa0b, date = 2010-09-28
[ 947.521374] microcode: CPU3 sig=0x1067a, pf=0x40, revision=0x0
[ 947.522365] microcode: CPU3 updated to revision 0xa0b, date = 2010-09-28

The first lines are from the boot, but the later ones from the action above. So it couldn’t update the microcode at boot for some reason, and when Kernel was manually requested to do so, it found that revision was 0x0 and microcode was updated to revision 0xa0b. In other words, there was available microcode but it couldn’t find it at boot time. Perhaps Fedora 22 ships with old microcode in their stock Kernel.

So hopefully this will make the system stable. It was only one panic since the mod was made so the machine has been stable, no doubt about that.

Gigabyte P43-ES3G LGA 771 mod

I can confirm that E5430 runs very smoothly with Linux and Gigabyte P43-ES3G.

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 23
model name      : Intel(R) Xeon(R) CPU           E5430  @ 2.66GHz
stepping        : 10
cpu MHz         : 3352.053
cache size      : 6144 KB

8x419MHz with no settings tuning.

Socket was easy to modify with sharp carpet knife and the board booted right after CMOS was cleared with the jumper.

Some simple tasks such as switching browser tabs are faster and it can play 1080p50fps from Youtube.

This Xeon would definitely do more than 419MHz but with this motherboard and with this chipset it is not worth the hassle.

Was this worth spending 50€? It is difficult to say. My usage is not processing intensive, but while working with large number of tabs open and a lot of going on, the two extra cores help a lot. If you got the heatsink ready it is definitely upgrade worth doing. It will extend the life of that LGA775 system by another year or two. And this isn’t even the highest rated CPU supported by this motherboard so there is still room to squeeze as prices of those higher end Xeons keep dropping in the future.

snap1038

One core always runs hotter than the rest so not sure what’s with that. It may have gotten damaged as it ran momentarily without heatsink. But the system is perfectly stable and it does not seem to be uncommon to have one core running hotter.

$50 pure sine wave inverter?

Amazing how these old UPS can be reconditioned and reconfigured to do the work of 1000 € devices:

Check the whole series. Real hardware hacking.

Also the guy knows a lot about inverters and a lot of that seems to apply to UPS as well, and just like cheap inverters; cheap UPS too provide modified sine wave which can even be damaging to sensitive electronics and motors.

So if I ever want to get an UPS I will make sure to get one of these rack/professional units which are of higher quality.

Restoring bricked counterfeit SEGGER J-link on Linux

Purchased counterfeit Segger j-link for ARM development two years ago and paid perhaps 10-13 € for it but it stopped working awhile ago and I suspect Windows driver bricked it. FTDI did similar thing to counterfeit chips but those too can be restored. The FTDI bricking worked by changing the USB chip identification information after which the host system could no longer identify the chip and hence was could not decide which driver to use.

So I am now following this post and currently running something like this:

snap488

And in case that forum post goes away here is the essential:

First, download and install the software SAM_BA_2.12.exe
Download from here:http://www.atmel.com/tools/atmelsam-…rogrammer.aspx

Second, open your Jlink shell

1 ERASE jumper shorting
2 Connect the USB cable to the PC
3 Wait approximately 120 seconds
4 Disconnect the USB cable
5 Disconnect the ERASE jumper
6 TST jumper shorting
7 Connect the USB cable to the PC
8 Wait for approximately 120 seconds
9 Disconnect the USB cable
10 Disconnect the TST jumper
11 Connect the USB cable to the PC
12 search install the driver pointing SAM-BA installation folder, if it is XP system, there will be a atm6124.Sys ATMEL AT91xxxxx Test Board hardware, if it is Win7, there will be a GPS Camera Detect (COMx) Hardware
13 Open the SAM-BA, where there would be a connection, if it is 0, you need to check the above steps
14 Keep the default settings, select a Jlink firmware moment to
15 of Jlink.dll first covered with 4.40b MDK drive, and then automatically update
16 completed

And after the erase of the Atmel microcontroller’s FLASH you should see the following in lsusb

Bus 006 Device 019: ID 03eb:6124 Atmel Corp. at91sam SAMBA bootloader

And after you’ve programmed it with this firmware you should see it like this instead:

Bus 006 Device 020: ID 1366:0101 SEGGER J-Link PLUS

And save another 10-15 € or 150 € if you went for the original.

And now moving forwards to testing this toolchain for development under Linux.

This bricking problems also demonstrates a problem which exists with Windows but could not really exist with Linux. In Windows because it is closed system you can push these sorts of functionalities through Microsoft’s Update mechanism while in Linux this could only happen with closed drivers. And in Linux it is very rare to have to use closed source drivers and these sort of simple devices almost without a doubt have open source driver available, which obviously cannot have these sort of brick mechanisms built in.

There are Linux binaries from SEGGER to have support for j-link but since I believe it was their driver which bricked it on Windows I am not looking towards OpenOCD as an alternative.

And in fact OpenOCD seems to now work:

# openocd -f interface/jlink.cfg -f target/stm32f1x.cfg 
Open On-Chip Debugger 0.8.0 (2014-06-07-21:57)
Licensed under GNU GPL v2
For bug reports, read
  http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m reset_config sysresetreq
Info : J-Link initialization started / target CPU reset initiated
Info : J-Link ARM V8 compiled Jan 31 2018 18:34:52
Info : J-Link caps 0xb9ff7bbf
Info : J-Link hw version 80000
Info : J-Link hw type J-Link
Info : J-Link max mem block 8368
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0x0
Info : Vref = 3.338 TCK = 1 TDI = 0 TDO = 1 TMS = 0 SRST = 0 TRST = 0
Info : J-Link JTAG Interface ready
Info : clock speed 1000 kHz
Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints

One thing that was just overly complicated last time and I simply gave up on it was the ARM boot process. It was so much more complicated than anything on AVR core.

Things seem to quickly escalate since I am not compiling http://sourceforge.net/p/gnuarmeclipse/qemu/ci/gnuarmeclipse-dev/tree/ which is QEMU and presumably used to simulate the environment.

But after half an our battle with wrong Project type selected this is now what I have:

snap489

It prints text from the device to my console, counting seconds, and everything worked practically out of the box. So maybe now I can move from AVR to ARM and use this 72MHz device costing around 4€.

Takes about 35 seconds to calculate 800 decimals of π (Pi) using this code.

int r[2800 + 1];
int i, k;
int b, d;
int c = 0;

for (i = 0; i < 2800; i++) {
    r[i] = 2000;
}

for (k = 2800; k > 0; k -= 14) {
    d = 0;

    i = k;
    for (;;) {
        d += r[i] * 10000;
        b = 2 * i - 1;

        r[i] = d % b;
        d /= b;
        i--;
        if (i == 0) break;
        d *= i;
    }
    printf("%.4d", c + d / 10000);
    c = d % 10000;
}

One example of Pi calculation on Arduino Uno uses 7000ms to calculate 5 digits while this ARM STMF103C8T6 takes 220ms which is also faster than Arduino Due. But I am not using the same algorithm. Still over an order of magnitude faster than basic Arduino. In comparison, it takes about 60µS on my 10 year old 3.2GHz Intel Core 2 Duo.

Back to electricity

For a change switched from electronics engineering back to basic electricity and boiled water with resistors. Or almost did and got up to 85°C and then realized that water conductivity may increase as a function of its temperature and decided to halt.

Not that it is very likely that 12V would conduct in drinking water any time soon at any large currents but wanted to find out. But it seems to be much simpler said than done. Lot of formulas which I have never seen and a lot of concepts which I know nothing about.

But the least it takes a lot of energy to boil water. Ran 12V over 0.3Ω in three quarter liter open container and it would have taken probably another 20 minutes to get from 85°C to 100°C. Some localized boiling at the surface of lowest resistance resistor thought.

Maybe I should try simple water resistor and dissolve some salts in it.

In fact one page referenced that the conductivity increases by 2-3% per degree of Celsius. And that plain water conductivity is 0.05 of some unknown unit known as S.

And just when I went Googling for more about that unit I found this:

1280px-WiderstandWasser

So it shouldn’t be that big of a deal if room temperature conducts some 20MΩ per centimeter. At 1MΩ it would still be only 10µA and I could boil water as long as I want.

So let’s get that water to boiling and hope those 100W rated resistors don’t pop. They shouldn’t, water is too good of a thermal conductor for that to happen.

The setup is a bit squishy as I use one 2Ω 100W resistor, one 0.5Ω 100W resistor and one 2.3Ω resistor which consists of ceramic 10W resistor wired in parallel and in series.

I do have one 0.3Ω 100W resistor but I’m afraid to put 480W of power through it. Be that in water and especially without water. It would boil if immediately.

Back to the resistance of water and it seems it depends on area (rather expected) and the conductivity over that pool of water could therefore be an order or two magnitudes greater than that 1µA I suppose.

The commonly used standard cell has a width of 1 cm .. https://en.wikipedia.org/wiki/Conductivity_%28electrolytic%29

But in scheme of things it won’t short circuit. And the power supply is 45A so it could conduct an amp and it wouldn’t matter to me.

Also it seems commonly used 2.5mm² wires are heavily over-spec’d since they only get slightly warm with 24A running through them.

Something’s going on because the water is starting to color.

I suppose, theoretically, if it conducted that amp then that current could (or would?) heat the water and decrease the resistance further, increasing the current. Similarly to lightning where large enough potential difference agitates the air, creating conducting ions through which the current then flows to equalize the difference.

Quantum mechanics

I am yet to come across good/clear explanation of how quantum computers would in practise work but hopefully this young man is able to make it.

[embedyt]https://www.youtube.com/watch?v=1PcseLsYZ9Y[/embedyt]

As far as I am aware of; the quantum “reality” of, say, an electron is so that it does not exist in “any state” until you measure the state. So it doesn’t quite fit into my head how can you make anything work on this principle.

Or if as they say; it is in every state simultaneously; what good does this make? Probably a great random number generator. Excuse the sarcasm but I just don’t get it yet.