4

I'm working on a project with an ATmega1280 (Atmel) board. I want to take a look at the stack, so I'm trying to do an OCD (On Chip Debugging). In the tutorial it says:

Use this AVRDUDE command to program the fuses on the ATMega1280 to enable OCD and JTAG:

avrdude -P <port> -c <programmer> -p m1280 -U hfuse:w:0x1a:m -v

Replace port with the port to which your programmer is connected, and programmer with the programmer type.

At this point, my question is: How can I find out the port of the USB in Kubuntu?

  • usbview provides technical info on the usb controllers/hubs: see my answer for this question – user76204 Feb 14 '13 at 18:02
  • lsusb -t before and after inserting the USB device, will give you the details you need. – Naseer Jul 15 '17 at 14:56
4

I usually list the files in /dev, plug in the device, list the files in /dev again, and look to see which special file appeared. You could also redirect the output of each listing to two different files and use diff to show you which special file appeared when you plugged in the device:

ls /dev > notplugged
# plug in device
ls /dev > plugged
diff notplugged plugged

Once you know what file corresponds to the device (it's usually something like /dev/ttyUSB0), you just use that file in place of <port>.

Edit: Apparently dmesg can tell you which device file corresponds to your device. Run dmesg | grep tty after plugging in your device. The device file should be apparent in one of the lines.

  • Thank you for the answer it was useful! Yes, it is usually /dev/ttyusb0, but there isn't in my pc. When I do 'ls /dev' the file notplugged and plugged are the same. – DarkCoffee Feb 14 '13 at 18:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.