Difference between revisions of "Project:Nanode/PoorMansCable"

From London Hackspace Wiki
Jump to navigation Jump to search
Line 180: Line 180:
 
avrdude done.  Thank you.
 
avrdude done.  Thank you.
 
</nowiki></pre>
 
</nowiki></pre>
 +
 +
 +
===Other Solutions===
 +
 +
Here's how to do a RS232 to TTL level converter with a couple of [http://www.uchobby.com/index.php/2007/06/11/ttl-to-rs232-adaptor-explained/ transistors]

Revision as of 16:53, 28 August 2011

Health Warning: This build is experimental and has not yet been verified.

What?

The Poor Man's Cable (PMC). An attempt at a sub-£3 cable to program the nanode. Current build price: ~£2.04 PMC Laptop.jpgPMC Overview.jpgPMC Nanode.jpg

Proposed BOM

1 x MAX232A at 86p each+vat

OR

1 x *202* at 61p each+vat

OR

1 x SMD ones are around 30p

4 x '100nF Capacitor' at ~2p each

1 x 9 pin D connector at 31p each+vat

1 x header socket 1 by 6 sub-20p

1 x pcb todo: add link to file

1 x USB to RS232 at £1.14

Overall cost, under £2+the pcb

Why?

The current solution for programming the Nanode costs £12 on Ebay

Puzzle Pieces

Here are all of the current pieces to the puzzle.

SP232ACP Board PCB Schematics

SP232ACP IC Datasheet

File:SP232ACP.pdf

FTDI Cable Pinout

  1. (Black) GND
  2. (Grey) /CTS
  3. (Red) VCC (5V)
  4. (Orange) TXD
  5. (Yellow) RXD
  6. (Green) /RTS

Nanode Pinout

  1. Gnd
  2. no connection
  3. Vcc
  4. Rxd
  5. Txd
  6. /Reset

Test Results

Crossover Connection

It was possible to talk from one serial terminal to another and back again. The two COM ports were linked by making a crossover connection between PMC and a known working FTDI TTL-232R-3V3 cable and opening up two serial terminals.

Cross Over Connection Table
FTDI Pin PMC
(Black) GND GND
(Grey) CTS RTS
(Red) VCC (5V) VCC
(Orange) TXD RXD
(Yellow) RXD TXD
(Green) RTS CTS

Listening to Serial Output

Flash arduino with

void setup()
{
  Serial.begin(9600);
}
void loop()
{
  Serial.println("Hello World!");
  delay(1000);
}

Hello World! using the PMC could be seen in terminal with:

 screen /dev/ttyUSB0 9600

avrdude

Command:

 avrdude -p atmega328p -b 57600 -P /dev/ttyUSB0 -U flash:r:./blah.hex -v -c arduino

Terminal output:

avrdude: Version 5.10, compiled on Mar 23 2010 at 15:03:00
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/home/samuel/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     5     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xe0

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xe0
         Hardware Version: -1074437604
         Firmware Version: 151804672.-1215592768

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xe0

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xe0

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xe0
         Vtarget         : 15004184.0 V
         Varef           : 307937452.8 V
         Oscillator      : 0.027 Hz
         SCK period      : 12268194.5 us


avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xe0

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0xe0
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0xe0

avrdude done.  Thank you.


Other Solutions

Here's how to do a RS232 to TTL level converter with a couple of transistors