Difference between revisions of "USB-CAN"
(Imported from TWiki by twiki2mediawiki.py) |
(Added image of RJ45 cable soldered to the back of USB-CAN board) |
||
(18 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | Two step programming procedure: |
||
+ | |||
== STEP ONE == |
== STEP ONE == |
||
+ | MProg.exe (actually in 'C:\Documents and Settings\eche027\Desktop\USB_CAN\ftdi\MProg 3.5 release' dir) |
||
− | MProg.exe |
||
+ | |||
+ | use USB_CAN.ept on Desktop (in 'C:\Documents and Settings\eche027\Desktop\USB_CAN\ftdi' dir) |
||
+ | |||
+ | Select "Scan", then "Program": |
||
+ | |||
+ | [[Image:MProg.jpg|400px|thumb|center|MProg.exe programing the FTDI]] |
||
− | use USB_CAN.ept on Desktop |
||
== STEP TWO == |
== STEP TWO == |
||
+ | Connecting the programmer (don't forget power from the USB as well): |
||
+ | [[Image:Programing_usb_can.JPG|400px|thumb|center|Programming the USB-CAN atmel chip]] |
||
+ | |||
− | Atmel parallel programmer (STK200 complient?) C:\Documents and Settings\eche027\Desktop\firm>avrdude -c stk200 -p ATmega162 -U flash:w:firmware_1.07.hex |
+ | Atmel parallel programmer (STK200 complient?) C:\Documents and Settings\eche027\Desktop\USB_CAN\Firmware\firm>avrdude -c stk200 -p ATmega162 -U flash:w:firmware_1.07.hex -U hfuse:w:0xD9:m |
+ | |||
+ | Or <tt>Make Program</tt> will do the same thing. |
||
+ | |||
+ | The following nearly works - it lacks the JTAG fuse disable, which breaks functionality |
||
{| cellpadding="5" cellspacing="0" border="1" |
{| cellpadding="5" cellspacing="0" border="1" |
||
|- |
|- |
||
− | <tt>C:\Documents and Settings\eche027\Desktop\firm>avrdude -c stk200 -p ATmega162 -U flash:w:firmware_1.07.hex<br /><br />avrdude: AVR device initialized and ready to accept instructions<br /><br />Reading || ################################################## || 100% 0.02s<br /><br />avrdude: Device signature = 0x1e9404<br />avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed<br /><br /> To disable this feature, specify the -D option.<br />avrdude: erasing chip<br />avrdude: reading input file "firmware_1.07.hex"<br />avrdude: input file firmware_1.07.hex auto detected as Intel Hex<br />avrdude: writing flash (5178 bytes):<br /><br />Writing || ################################################## || 100% 2.56s<br /><br />avrdude: 5178 bytes of flash written<br />avrdude: verifying flash memory against firmware_1.07.hex:<br />avrdude: load data flash data from input file firmware_1.07.hex:<br />avrdude: input file firmware_1.07.hex auto detected as Intel Hex<br />avrdude: input file firmware_1.07.hex contains 5178 bytes<br />avrdude: reading on-chip flash data:<br /><br />Reading || ################################################## || 100% 2.25s<br /><br />avrdude: verifying ...<br />avrdude: verification error, first mismatch at byte 0x0000<br /> 0x0c ! |
+ | <tt>C:\Documents and Settings\eche027\Desktop\USB_CAN\Firmware\firm>avrdude -c stk200 -p ATmega162 -U flash:w:firmware_1.07.hex<br /><br />avrdude: AVR device initialized and ready to accept instructions<br /><br />Reading || ################################################## || 100% 0.02s<br /><br />avrdude: Device signature = 0x1e9404<br />avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed<br /><br /> To disable this feature, specify the -D option.<br />avrdude: erasing chip<br />avrdude: reading input file "firmware_1.07.hex"<br />avrdude: input file firmware_1.07.hex auto detected as Intel Hex<br />avrdude: writing flash (5178 bytes):<br /><br />Writing || ################################################## || 100% 2.56s<br /><br />avrdude: 5178 bytes of flash written<br />avrdude: verifying flash memory against firmware_1.07.hex:<br />avrdude: load data flash data from input file firmware_1.07.hex:<br />avrdude: input file firmware_1.07.hex auto detected as Intel Hex<br />avrdude: input file firmware_1.07.hex contains 5178 bytes<br />avrdude: reading on-chip flash data:<br /><br />Reading || ################################################## || 100% 2.25s<br /><br />avrdude: verifying ...<br />avrdude: verification error, first mismatch at byte 0x0000<br /> 0x0c ! 0xff<br />avrdude: verification error; content mismatch<br /><br />avrdude: safemode: lfuse changed! Was 62, and is now ff<br />Would you like this fuse to be changed back? [y/n] n<br />avrdude: safemode: hfuse changed! Was 99, and is now ff<br />Would you like this fuse to be changed back? [y/n] n<br />avrdude: safemode: Fuses OK<br /><br />avrdude done. Thank you.<br /><br /><br />C:\Documents and Settings\eche027\Desktop\firm></tt> |
+ | |||
|} |
|} |
||
Line 16: | Line 31: | ||
===== 1) ===== |
===== 1) ===== |
||
− | SJA1000 Chip Select (pin4) needs grounding. Using a resistor or direct short to groud works (HW solution). SW solution preferred - output LOW Signal from Atmel |
+ | <strike>SJA1000 Chip Select (pin4) needs grounding. Using a resistor or direct short to groud works (HW solution). SW solution preferred - output LOW Signal from Atmel PC.</strike> |
⚫ | |||
⚫ | |||
− | -work our how to compile for atmel (winavr or equiv) |
||
+ | == NOTES == |
||
+ | ====== Fuses: ====== |
||
+ | http://www.engbedded.com/fusecalc/ |
||
− | -program the fix. |
||
+ | |||
⚫ | |||
+ | Ebay device fuse settings: h,l,e 0xD1, 0xD0, 0xFB |
||
+ | |||
+ | Mictronics recommended 0xD0, 0xF7, 0xFB |
||
+ | |||
+ | Our fuse settings: 0xD9, 0xD0, 0xFB |
||
+ | C:\>avrdude -c stk200 -p ATmega162 -U hfuse:w:0xd9:m -U lfuse:w:0xd0:m -U efuse:w:0xfb:m |
||
⚫ | |||
+ | == CAN PINOUT == |
||
+ | * Can pin out for USB<->CAN: <br /> [[Image:CAN_PinOut.PNG||500px|CAN PinOut]] [[Image:USB-CAN_to_RJ45_wiring.jpg||200px|RJ45 cable + USB-CAN]] |
||
+ | * RJ45 Pinout: <br /> [[Image:rj45pinout.gif|left|rj45pinout.gif]] |
||
− | -- Main.PhilipCourt - 2011-04-20 |
||
+ | JF2 [[LATA_Switch|Lata]] cables connect to CAT5 cables as follows (using T568B termination http://en.wikipedia.org/wiki/TIA/EIA-568#T568A_and_T568B_termination): |
||
+ | * CANH to CAT5 pin 1 (PIN One - White/Orange) |
||
+ | * CANL to CAT5 pin 2 (PIN Two - Orange)) |
||
+ | [[File:T568B wire color.png|400px|thumb|left|T568B wire color]][[File:T568A wire color.png|400px|thumb|center|T568A wire color]] |
Latest revision as of 00:20, 5 February 2018
Two step programming procedure:
STEP ONE
MProg.exe (actually in 'C:\Documents and Settings\eche027\Desktop\USB_CAN\ftdi\MProg 3.5 release' dir)
use USB_CAN.ept on Desktop (in 'C:\Documents and Settings\eche027\Desktop\USB_CAN\ftdi' dir)
Select "Scan", then "Program":
STEP TWO
Connecting the programmer (don't forget power from the USB as well):
Atmel parallel programmer (STK200 complient?) C:\Documents and Settings\eche027\Desktop\USB_CAN\Firmware\firm>avrdude -c stk200 -p ATmega162 -U flash:w:firmware_1.07.hex -U hfuse:w:0xD9:m
Or Make Program will do the same thing.
The following nearly works - it lacks the JTAG fuse disable, which breaks functionality
C:\Documents and Settings\eche027\Desktop\USB_CAN\Firmware\firm>avrdude -c stk200 -p ATmega162 -U flash:w:firmware_1.07.hexavrdude: AVR device initialized and ready to accept instructions
Reading || ################################################## || 100% 0.02s
avrdude: Device signature = 0x1e9404
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "firmware_1.07.hex"
avrdude: input file firmware_1.07.hex auto detected as Intel Hex
avrdude: writing flash (5178 bytes):
Writing || ################################################## || 100% 2.56s
avrdude: 5178 bytes of flash written
avrdude: verifying flash memory against firmware_1.07.hex:
avrdude: load data flash data from input file firmware_1.07.hex:
avrdude: input file firmware_1.07.hex auto detected as Intel Hex
avrdude: input file firmware_1.07.hex contains 5178 bytes
avrdude: reading on-chip flash data:
Reading || ################################################## || 100% 2.25s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0x0c ! 0xff
avrdude: verification error; content mismatch
avrdude: safemode: lfuse changed! Was 62, and is now ff
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: hfuse changed! Was 99, and is now ff
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: Fuses OK
avrdude done. Thank you.
C:\Documents and Settings\eche027\Desktop\firm>
FAULTS
1)
SJA1000 Chip Select (pin4) needs grounding. Using a resistor or direct short to groud works (HW solution). SW solution preferred - output LOW Signal from Atmel PC.
2)
V1.07 has baud rate irregularity, see http://www.mictronics.de/projects/usb-can-bus/ user comments ~jan2011 -- Main.PhilipCourt - 2011-04-20
NOTES
Fuses:
http://www.engbedded.com/fusecalc/
Ebay device fuse settings: h,l,e 0xD1, 0xD0, 0xFB
Mictronics recommended 0xD0, 0xF7, 0xFB
Our fuse settings: 0xD9, 0xD0, 0xFB
C:\>avrdude -c stk200 -p ATmega162 -U hfuse:w:0xd9:m -U lfuse:w:0xd0:m -U efuse:w:0xfb:m
CAN PINOUT
- RJ45 Pinout:
JF2 Lata cables connect to CAT5 cables as follows (using T568B termination http://en.wikipedia.org/wiki/TIA/EIA-568#T568A_and_T568B_termination):
- CANH to CAT5 pin 1 (PIN One - White/Orange)
- CANL to CAT5 pin 2 (PIN Two - Orange))