<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://bitwizard.nl/wiki/index.php?action=history&amp;feed=atom&amp;title=Old_USB-SATA_powerswitch</id>
	<title>Old USB-SATA powerswitch - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://bitwizard.nl/wiki/index.php?action=history&amp;feed=atom&amp;title=Old_USB-SATA_powerswitch"/>
	<link rel="alternate" type="text/html" href="https://bitwizard.nl/wiki/index.php?title=Old_USB-SATA_powerswitch&amp;action=history"/>
	<updated>2026-04-05T18:48:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.6</generator>
	<entry>
		<id>https://bitwizard.nl/wiki/index.php?title=Old_USB-SATA_powerswitch&amp;diff=3007&amp;oldid=prev</id>
		<title>Rew: moved Old USB-SATA powersiwtch to Old USB-SATA powerswitch: typo</title>
		<link rel="alternate" type="text/html" href="https://bitwizard.nl/wiki/index.php?title=Old_USB-SATA_powerswitch&amp;diff=3007&amp;oldid=prev"/>
		<updated>2014-11-28T13:45:57Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/wiki/index.php/Old_USB-SATA_powersiwtch&quot; class=&quot;mw-redirect&quot; title=&quot;Old USB-SATA powersiwtch&quot;&gt;Old USB-SATA powersiwtch&lt;/a&gt; to &lt;a href=&quot;/wiki/index.php/Old_USB-SATA_powerswitch&quot; title=&quot;Old USB-SATA powerswitch&quot;&gt;Old USB-SATA powerswitch&lt;/a&gt;: typo&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:45, 28 November 2014&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key wikidb:diff:wikidiff2:1.12:old-3006:rev-3007:1.13.0 --&gt;
&lt;/table&gt;</summary>
		<author><name>Rew</name></author>
	</entry>
	<entry>
		<id>https://bitwizard.nl/wiki/index.php?title=Old_USB-SATA_powerswitch&amp;diff=3006&amp;oldid=prev</id>
		<title>Rew: Created page with &quot;= USB SATA powerswitch =  This is the documentation page for the USB SATA powerswitch PCB.   == overview ==  The USB SATA powerswitch PCB has an USB connector and connection p...&quot;</title>
		<link rel="alternate" type="text/html" href="https://bitwizard.nl/wiki/index.php?title=Old_USB-SATA_powerswitch&amp;diff=3006&amp;oldid=prev"/>
		<updated>2014-11-28T13:44:10Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= USB SATA powerswitch =  This is the documentation page for the USB SATA powerswitch PCB.   == overview ==  The USB SATA powerswitch PCB has an USB connector and connection p...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= USB SATA powerswitch =&lt;br /&gt;
&lt;br /&gt;
This is the documentation page for the USB SATA powerswitch PCB. &lt;br /&gt;
&lt;br /&gt;
== overview ==&lt;br /&gt;
&lt;br /&gt;
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.&lt;br /&gt;
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.&lt;br /&gt;
&lt;br /&gt;
== External resources ==&lt;br /&gt;
&lt;br /&gt;
== pinout ==&lt;br /&gt;
&lt;br /&gt;
* led1 is connected to VCC&lt;br /&gt;
* led2 is connected to PD6&lt;br /&gt;
* led3 is connected to PD5&lt;br /&gt;
* led4 is connected to PD4&lt;br /&gt;
* led5 is connected to PD3&lt;br /&gt;
* led6 is connected to PD0 (12V FET)&lt;br /&gt;
* led7 is connected to PD1 (5V FET)&lt;br /&gt;
* led8 is connected to PD2 (3,3V FET)&lt;br /&gt;
* led9 is connected to 12V in&lt;br /&gt;
* led10 is connected to 5V in&lt;br /&gt;
* led11 is connected to 3,3V in&lt;br /&gt;
&lt;br /&gt;
Viewing with the USB connector on the left side, and the power pads on the lower side:&lt;br /&gt;
* 12V OUT (12V IN for V1.1)&lt;br /&gt;
* 12V IN (12V OUT for V1.1)&lt;br /&gt;
* GND&lt;br /&gt;
* GND&lt;br /&gt;
* 5V IN&lt;br /&gt;
* 5V OUT&lt;br /&gt;
* GND&lt;br /&gt;
* GND&lt;br /&gt;
* 3,3V IN&lt;br /&gt;
* 3,3V OUT&lt;br /&gt;
&lt;br /&gt;
Mind the reversed order for the 12V pads on version 1.0, compared to the 5V and 3,3V pads!&lt;br /&gt;
&lt;br /&gt;
== Default operation ==&lt;br /&gt;
&lt;br /&gt;
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).&lt;br /&gt;
&lt;br /&gt;
At BitWizard, we use the following script for turning om our harddisks:&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 tty=/dev/ttyACM0&lt;br /&gt;
 stty -echo -icrnl -onlcr &amp;lt; $tty&lt;br /&gt;
 cat $tty &amp;amp;&lt;br /&gt;
 pid=$!&lt;br /&gt;
 (sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) &amp;gt; $tty&lt;br /&gt;
 sleep 0.5&lt;br /&gt;
 kill $pid&lt;br /&gt;
&lt;br /&gt;
&amp;quot;s0&amp;quot; means &amp;quot;set output zero&amp;quot;, which is the 12V output. &amp;quot;s1&amp;quot; id the 5V output, and &amp;quot;s2&amp;quot; is the 3V3 output. The four status LEDs are connected to output 3,4, 5, and 6.&lt;br /&gt;
To turn off an output, simply send &amp;quot;c0&amp;quot;, meaning &amp;quot;clear output zero&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Reading from the device is necessary, because it needs to dump its output. If you don&amp;#039;t read it&amp;#039;s output, the device may (or will) freeze.&lt;br /&gt;
&lt;br /&gt;
John tells us that he uses the following windows script. &lt;br /&gt;
 ::startsatabat&lt;br /&gt;
 ::port parameters&lt;br /&gt;
 MODE COM3:96,N,8,1&lt;br /&gt;
 ::For reading info from COM port&lt;br /&gt;
 type COM3&lt;br /&gt;
 ::For sending info to COM port&lt;br /&gt;
 sleep -m 200&lt;br /&gt;
 echo s2 &amp;gt; COM3&lt;br /&gt;
 sleep -m 200&lt;br /&gt;
 echo s1 &amp;gt; COM3&lt;br /&gt;
 sleep -m 200&lt;br /&gt;
 echo s0 &amp;gt; COM3&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;type COM3&amp;quot; line is controversial. I would expect that line to block and the script to stop processing there. On windows, it seems it works  fine without it.  Then, I think John put the line back, but maybe as &amp;quot;copy com3: con:&amp;quot;. Apparently that does not block. Please let us know how your experience is.&lt;br /&gt;
&lt;br /&gt;
The parameters like &amp;quot;baud rate&amp;quot; and parity are ignored in the device. I don&amp;#039;t see the need for the &amp;quot;mode com3:96,N,8,1&amp;quot; line. Maybe the act of initializing is neccessary on windows. Or maybe it resets other parameters like is neccessary on Linux. (On Linux the echo &amp;#039;&amp;#039;&amp;#039;needs&amp;#039;&amp;#039;&amp;#039; to be off: otherwise the first character that is echoed from the device back to the PC starts bouncing back and forth between the PC and the device). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The devices are shipped with the following .hex file programmed:&amp;lt;br&amp;gt;&lt;br /&gt;
[[file:Usb-sata_powerswitch.hex‎]]&amp;lt;br&amp;gt;&lt;br /&gt;
For info on how to flash this .hex into your controller, see the section on programming below.&lt;br /&gt;
&lt;br /&gt;
== programming ==&lt;br /&gt;
&lt;br /&gt;
This section describes how you get your program into the processor. &lt;br /&gt;
&lt;br /&gt;
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you&amp;#039;re done developing your program, that&amp;#039;s the way you&amp;#039;ll use it: Powerup, run. &lt;br /&gt;
&lt;br /&gt;
If there is no program loaded or if you press the reset button the chip comes up in &amp;quot;firmware upload mode&amp;quot;. This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone. &lt;br /&gt;
&lt;br /&gt;
=== Linux ===&lt;br /&gt;
&lt;br /&gt;
Get the dfu-programmer for atmel chips package. (link?) &lt;br /&gt;
&lt;br /&gt;
On sufficiently recent Ubunu distributions that is as simple as: &lt;br /&gt;
&lt;br /&gt;
  sudo apt-get  install dfu-programmer&lt;br /&gt;
&lt;br /&gt;
I recommend creating a script called &amp;quot;dfu&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 if [ -z &amp;quot;$CHIP&amp;quot; ]  ; then &lt;br /&gt;
   chip=at90usb162&lt;br /&gt;
 else&lt;br /&gt;
   chip=$CHIP&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 hex=$1&lt;br /&gt;
 sudo dfu-programmer $chip erase&lt;br /&gt;
 sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex&lt;br /&gt;
 sudo dfu-programmer $chip start&lt;br /&gt;
&lt;br /&gt;
TODO: figure out how to get rid of the &amp;quot;sudo&amp;quot; commands here... &lt;br /&gt;
&lt;br /&gt;
Now downloading and starting a program is as simple as pressing the reset button and then: &lt;br /&gt;
&lt;br /&gt;
 dfu &amp;lt;yourbinary&amp;gt;.hex&lt;br /&gt;
&lt;br /&gt;
TODO: When I&amp;#039;m developing, I&amp;#039;m likely to modify the code, and when I want to program the chip I hit the &amp;quot;reset&amp;quot; button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu &amp;lt;mycurrentbinary&amp;gt;.hex the moment the chip has enumerated. Once that&amp;#039;s running downloading and starting the latest code becomes as simple as hitting the reset button. &lt;br /&gt;
&lt;br /&gt;
Apparently the FLIP program is now available for Linux too. See below.&lt;br /&gt;
&lt;br /&gt;
=== windows ===&lt;br /&gt;
&lt;br /&gt;
Get the &amp;quot;flip&amp;quot; program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886&lt;/div&gt;</summary>
		<author><name>Rew</name></author>
	</entry>
</feed>