#avr | Logs for 2015-06-17

Back
[07:01:18] <LeoNerd> Hrm... having trouble sourcing any IR photodiodes with reverse gullwing legs
[07:01:23] <LeoNerd> Seems farnell have... er.. none
[07:49:46] <Chillum> gullwings legs? like a DeLorean?
[11:52:19] <kwallace> Hello, I just got one of these: http://www.ebay.com/itm/251192714781 . Am I correct in thinking, if I use the ISP connection on this board with my ATtinyUSB programmer, I don't need to worry about the bootloader?
[11:52:42] <LeoNerd> Yah
[11:52:55] <LeoNerd> Though you might want to leave the USB bootloader in place because they're quite useful
[11:53:30] <LeoNerd> Looks quite a nice board though.. I have an Adafruit one. Similar,.. quite expensive though
[11:53:44] <LeoNerd> And certainly a lot nicer than the Arduinio Micro, because this one actually has all the pins :)
[11:55:28] <kwallace> Thank you LoeNerd. I tried using this board with the USB connector and the Arduino IDE but could not figure out how to make it work. I haven't put a lot of time into it, but I have had projects where I put in time and in the end followed the wrong path.
[11:56:43] <kwallace> It seems using the ISP port works in most cases, but it has been a while since I played with AVRs.
[11:58:47] <kwallace> Now I need to walk out to the shop and find my ATtinyUSB. By the way, this is what the board is for: http://www.wallacecompany.com/machine_shop/fire_master_h1818/fire_master_index.html
[11:59:04] <LeoNerd> Press the button :)
[12:03:11] <kwallace> The ad mentioned using FLIP, but I don't do Windows and there isn't a Linux version that works, it seems. I looked at DFU but it's a Greek to me.
[12:06:47] <LeoNerd> Well it'll depend on the particular board in question, but my 32U4 board for instance behaves just fine with avrdude
[12:06:52] <LeoNerd> You just have to press the button in it first
[12:06:59] <kwallace> Do you know off hand if there is anything I can learn about what is loaded on this board by going through the USB port? lsusb gives: Bus 004 Device 002: ID 03eb:2ff4 Atmel Corp. after I press reset.
[12:07:36] <LeoNerd> Ah.. it's enumerating as an Atmel. Probably therefore means it has Atmel's stock bootloader in it
[12:07:56] <LeoNerd> Which I believe will appear like avr109 to avrdude
[12:08:18] <LeoNerd> Press the bootloader button, then use avrdude -p m32u4 -c avr109 -P /dev/ttyACM{whatever; likely 0} ...
[12:08:47] <kwallace> Okay, I'll pull up AVRdude and poke at it. ...
[12:09:17] <Tom_itx> kwallace, are you planning to use the USB to interface to control the kiln?
[12:09:36] <Tom_itx> i'd use the bootloader on the U4 chip if it were me
[12:10:02] <kwallace> I'm trying to figure that bit out.
[12:10:10] <LeoNerd> Yah; the 32U4 bootloader is quite nice
[12:10:15] <Tom_itx> you might wanna have a look at the LUFA lib for usb
[12:10:28] <LeoNerd> Though actually, the Arduino one is eeeeven nicer with its autoreset feature ;)
[12:10:31] <Tom_itx> it will get you on your way to an interface
[12:10:46] <LeoNerd> It means you don't have to touch the button to reflash it
[12:11:04] <Tom_itx> ur just lazy
[12:11:24] <LeoNerd> Some say "lazy". Others say I wanted to put the board inside a case
[12:11:33] <LeoNerd> And that I want to reprogram it without having to unscrew the lid
[12:11:51] <Tom_itx> i put a hole in my case :)
[12:11:56] <LeoNerd> Possibly because the case has mains voltages inside
[12:12:03] <LeoNerd> So.. yaknow.. Not Going There :)
[12:13:21] <Tom_itx> kwallace, fwiw i did a toaster oven using a mega328: http://tom-itx.no-ip.biz:81/~webpage/toaster_oven/toaster_oven_index.php
[12:13:29] <kwallace> While I'm sitting here, any suggestions on an AVRdide command to see if the USB port works? So far I have "avrdude -p atmega32u4"
[12:13:52] <LeoNerd> I wouldn't use avrdude to answer that
[12:13:56] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/how_to/atmega168/using_avrdude_index.php
[12:14:00] <LeoNerd> See if a /dev/ttyACM* exists. If so, then it works
[12:14:02] <Tom_itx> kwallace ^^
[12:14:30] <Tom_itx> but i tend to agree with LeoNerd since it's got a bootloader already
[12:14:34] <Tom_itx> use FLIP instead
[12:14:42] <Tom_itx> and connect direct to the USB
[12:14:53] <Tom_itx> or DFU programmer
[12:14:56] <Tom_itx> for linux
[12:15:14] <LeoNerd> "DFU programmer for Linux" would be avrdude -c avr109
[12:15:34] <kwallace> Oops, no ttyACM
[12:15:42] <Tom_itx> kwallace, my ver of the board you got: http://tom-itx.no-ip.biz:81/~webpage/boards/atmega32u4/atmega32u4_1.jpg
[12:16:51] <LeoNerd> Mm.. Then there's a chance it appears as /dev/ttyUSB* instead
[12:16:59] <Tom_itx> if you use dfu you just gotta make sure you have permission for the USB port
[12:17:11] <LeoNerd> I've never quite worked out what ACM vs USB actually are
[12:17:20] <LeoNerd> They're both USB-CDC devices
[12:19:03] <kwallace> kwallace@jupiter:~$ sudo avrdude -p ATmega32U4 -c avr109
[12:19:03] <kwallace> Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding
[12:19:04] <kwallace> kwallace@jupiter:~$
[12:19:41] <kwallace> dmesg
[12:19:42] <kwallace> [13142.680194] usb 4-1: USB disconnect, address 4
[12:19:43] <kwallace> [13143.416236] usb 4-1: new full speed USB device using uhci_hcd and address 5
[12:19:43] <kwallace> [13143.595334] usb 4-1: configuration #1 chosen from 1 choice
[12:19:43] <LeoNerd> You don't appear to have told it what port to use
[12:19:50] <LeoNerd> I'd expect to see a -P argument there
[12:19:55] <LeoNerd> Also you may have to press that buton
[12:20:00] <LeoNerd> *button
[12:20:17] <LeoNerd> When I press my button, the "boot" LED glows for about 8 seconds. You have to run avrdude within that time or it won't work
[12:22:48] <kwallace> Well this used to power up with three flashing LEDs, but not any more. I must have borked the bootloader.
[12:23:11] <Tom_itx> was that one of paul's boards?
[12:23:26] <Tom_itx> he had a custom bootloader in his
[12:23:56] <kwallace> http://www.ebay.com/itm/251192714781
[12:24:46] <Tom_itx> https://www.pjrc.com/teensy/
[12:24:52] <Tom_itx> those are the ones i was thinking of
[12:25:32] <kwallace> I have the eBay one.
[12:25:53] <Tom_itx> more than likely it has the stock bootloader from atmel
[12:26:02] <Tom_itx> the chip ships with it loaded
[12:26:17] <Tom_itx> if you borked it you can get it from atmel
[12:26:44] <kwallace> I think the next step is to go get my ATtiny programmer.
[12:26:52] <Tom_itx> or compile the avr109 one
[12:27:28] <LeoNerd> It shouldn't be possible to kill the bootloader *from* the bootloader on USB
[12:27:38] <Tom_itx> you wouldn't think so
[12:27:58] <kwallace> kwallace@jupiter:~$ sudo avrdude -p ATmega32U4 -c avr109 -P /dev/tty0
[12:27:58] <kwallace> Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding
[12:27:59] <kwallace> kwallace@jupiter:~$ sudo avrdude -p ATmega32U4 -c avr109 -P /dev/tty1
[12:27:59] <kwallace> Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding
[12:27:59] <kwallace> kwallace@jupiter:~$
[12:28:31] <Tom_itx> did you push the buttons in order? HWB first and while it's down, push reset
[12:28:47] <Tom_itx> err that's to connect to the bootloader in programming mode
[12:29:18] <LeoNerd> It's not /dev/tty0
[12:29:19] <Tom_itx> not sure if you need that if you're using avrdude
[12:29:28] <LeoNerd> /dev/tty0 is the Ctrl-Alt-F1 console ;)
[12:29:32] <LeoNerd> That doesn't relate to a USB port
[12:30:01] <Tom_itx> true
[12:30:05] <LeoNerd> This board will almost certainly be called either /dev/ttyACM0 (or 1 or whatever) or /dev/ttyUSB0 (or 1 or whatever)
[12:30:26] <LeoNerd> Unplug it, ls /dev/tty*; plug it in; ls /dev/tty* again and see if anything new has appeared
[12:30:29] <kwallace> I don't have either at the moment.
[12:30:42] <LeoNerd> If you don't have any, then lsusb and see if you have something likely looking
[12:31:38] <kwallace> Bus 004 Device 010: ID 03eb:2ff4 Atmel Corp.
[12:34:31] <kwallace> Bus 004 Device 010: ID 03eb:2ff4 Atmel Corp.
[12:34:31] <kwallace> Device Descriptor:
[12:34:31] <kwallace> bLength 18
[12:34:31] <kwallace> bDescriptorType 1
[12:34:31] <kwallace> bcdUSB 2.00
[12:34:31] <kwallace> bDeviceClass 255 Vendor Specific Class
[12:34:31] <kwallace> bDeviceSubClass 1
[12:34:32] <kwallace> bDeviceProtocol 0
[12:34:32] <kwallace> bMaxPacketSize0 32
[12:34:33] <kwallace> idVendor 0x03eb Atmel Corp.
[12:34:33] <kwallace> idProduct 0x2ff4
[12:34:34] <kwallace> bcdDevice 0.00
[12:34:45] <LeoNerd> VSC.. so that's no good
[12:34:52] <LeoNerd> Does it not have a CDC as well?
[12:35:19] <kwallace> CDC?
[12:35:55] <LeoNerd> communications device class
[12:36:00] <LeoNerd> AKA "serial port"
[12:37:03] <kwallace> I don't see CDC or serial anywhere in the lsusb output.
[12:37:36] <LeoNerd> Ah.. then maybe it's not claiming to be such
[12:41:00] <kwallace> I'm guessing I should go get my ATtiny programmer.
[12:41:22] <LeoNerd> I'd be surprised if there's no way to bootload it over USB as it stands
[12:41:51] <kwallace> I just don't know that bit yet.
[12:42:37] <kwallace> If there is no USB port showing up, I think I'm stuck.
[12:42:47] <LeoNerd> Hm?
[12:42:53] <LeoNerd> There's no USB TTY but that's not the same thing at all
[12:43:03] <LeoNerd> It appears under lsusb so it's clearly doing something
[12:43:14] <LeoNerd> It may be that avrdude has a method to talk directly over libusb to it
[12:43:22] <LeoNerd> Such as it does with usbasp and similar
[12:45:28] <LeoNerd> Ofcourse it's also possible you just don't have the right kernel module loaded to make the ACM devices :)
[12:45:33] <LeoNerd> Or any of about 50 other such concerns
[12:46:02] <kwallace> My Arduino UNO shows up as an ACM.
[12:46:41] <LeoNerd> Ah
[12:48:10] <LeoNerd> Dunno then.. it's possible the chip on that board has arrived without a CDC-capable bootloader on it :/
[12:48:49] <kwallace> I'll be back with a programmer...
[13:17:07] <kwallace> kwallace@jupiter:~$ sudo avrdude -c usbtiny -p ATmega32u4
[13:17:07] <kwallace> avrdude: AVR device initialized and ready to accept instructions
[13:17:08] <kwallace> Reading | ################################################## | 100% 0.01s
[13:17:08] <kwallace> avrdude: Device signature = 0x1e9587
[13:17:08] <kwallace> avrdude: safemode: Fuses OK
[13:17:08] <kwallace> avrdude done. Thank you.
[13:38:53] <kwallace> Yay, I have blinky LEDs.
[13:39:53] <Tom_itx> it's a start
[13:42:40] <kwallace> Now, I think I'll look at how to check the loader.
[15:29:18] <Jartza> evening
[18:32:41] <ParkerR> Is there a way to use the built-in button on a teensy 2.0 in the code and then have programming mode activated by holding the button down before pluggin in?
[18:34:34] <LeoNerd> You may have wanted #arduino
[18:34:57] <ParkerR> LeoNerd, that would make sense as it is very similar, thanks :)
[18:39:10] <Lambda_Aurigae> yes, you could write your bootloader so it exits and starts the main program if you aren't holding the button when you power it up.
[18:41:03] <ParkerR> And then I would be able to use the button as part of the code? (toggle mouse movement, etc)
[18:41:37] <ParkerR> Basically wondering of the button is hardwired/hardcoded to reset or not
[18:41:45] <ParkerR> If the bootloader handles that then that's a start
[18:42:44] <Lambda_Aurigae> oh..is it a reset button?
[18:43:27] <ParkerR> It throw it into programming mode
[18:44:19] <Lambda_Aurigae> I'm not seeing a schematic on the site readily available.
[18:44:23] <ParkerR> Doesn't reset the device. reset is either via a sent command while in programming mode or power cycle
[18:44:35] <ParkerR> Yeah and I think the bootloader is closed-source iirc
[18:45:16] <ParkerR> I can add ina button. i was just seeing if the built in was usable at all
[18:45:20] <ParkerR> *in a
[18:45:35] <Lambda_Aurigae> if I could find a schematic or documentation of any kind I could tell you.
[18:46:01] <ParkerR> Yeah was searching for those myself too
[18:46:15] <ParkerR> https://www.pjrc.com/teensy/schematic.html
[18:46:41] <ParkerR> https://www.pjrc.com/teensy/schematic2.gif
[18:46:55] <Lambda_Aurigae> ok..that button on the teensy 2.0 is only a reset button.
[18:47:00] <Lambda_Aurigae> it is tied straight to the reset pin.
[18:47:06] <ParkerR> Reset seems to be a pin
[18:47:12] <ParkerR> Hmm
[18:47:14] <Lambda_Aurigae> so, no, you can not use it for input
[18:47:15] <Lambda_Aurigae> unless
[18:47:22] <Lambda_Aurigae> you disable the reset pin in the fuses.
[18:47:29] <Lambda_Aurigae> in which case, it won't work as a reset button anymore.
[18:47:30] <ParkerR> Oh I see the button now
[18:47:39] <Lambda_Aurigae> between RST and GND
[18:48:07] <ParkerR> Which would then just need a small jumper to an available pin?
[18:49:22] <ParkerR> Thanks for the pointers. Dinfinitely have a better understanding of it
[18:49:30] <ParkerR> *Definitely
[18:49:59] <ParkerR> But yeah in that case I would then need another button to trigger reset
[18:50:05] <ParkerR> So I might as well leave it as is
[18:53:14] <Lambda_Aurigae> no...if you disabled reset in the fuses((assuming that chip can do that)) then you won't be able to reset the chip other than a power cycle...or high voltage reset.
[18:53:36] <Lambda_Aurigae> not sure that is an option on that chip anyhow...
[18:55:13] <ParkerR> Atmega32u4. Pretty standard for the arduino. Checking out the datasheet now https://www.pjrc.com/teensy/atmega32u4.pdf
[18:56:02] <Lambda_Aurigae> I know nothing about ardweeny crap.
[18:56:09] <DKordic> ParkerR: Some SFR indicates source of reset. Liek PowerON, ResetPin, WatchDog...
[18:56:14] <Lambda_Aurigae> other than they use the atmega328 a lot.
[18:57:23] <ParkerR> Yeah this is essentially a tiny arduino with a bootloader cabable of USB functions
[18:57:32] <ParkerR> *capable
[19:13:09] <Lambda_Aurigae> http://i.imgur.com/MR4M57d.jpg
[19:43:24] <ParkerR> Lambda_Aurigae, heh