#avr | Logs for 2014-08-13

Back
[04:03:55] <mux_> at the risk of appearing like a stalker...
[04:04:04] <mux_> abcminiuser, are you available?
[04:06:03] <abcminiuser> Nearly dinner time, just got home
[04:06:22] <mux_> okay, can you give me a ping when you have time maybe?
[04:10:13] <specing> Lambda_Aurigae: one read
[04:10:20] <specing> Lambda_Aurigae: I'm making another one now
[04:16:01] <specing> https://paste.debian.net/hidden/7078635f/
[04:16:06] <specing> diff of the second read
[04:16:34] <specing> Should I be looking into wires or the AVR itself (and how for the latter)
[04:16:45] <specing> programming wires are 0.5 m long
[04:20:27] <Valen> slow the clock?
[04:20:59] <specing> k, I'll tell you tomorrow how it went
[05:40:31] <mux_> abcminiuser: you there?
[05:40:37] <abcminiuser> Heyo
[05:40:42] <abcminiuser> Yeah, burnt out but here
[05:41:03] <abcminiuser> I've exceeded maximum safe rage thresholds for the day, so be careful
[05:41:04] <mux_> I have just the relaxing thing to do
[05:41:33] <mux_> you want to talk about it? my gf is a phych
[05:41:36] <mux_> *psych
[05:42:30] <Valen> I'm a pervy bastard, I can pretend to be one if it helps
[05:42:47] <mux_> anyway, I fixed my interrupt woes of yesterday, but the mass storage device doesn't attach
[05:43:06] <abcminiuser> Nah, better I sit here and relax instead
[05:43:21] <abcminiuser> mux_, err, XMEGA right?
[05:43:33] <mux_> situation sketch:
[05:43:48] <mux_> usb2512 hub with [random device] and xmega128a4u behind it
[05:44:00] <mux_> mass storage bootloader is what I'm trying to run on it since before my holiday
[05:44:31] <mux_> boot.h has been rewritten, massstoragebootloader.c has been rewritten to accomodate my hardware and the xmega instead of an avr8
[05:45:10] <mux_> but now, a bit to my surprise, there's no action at all from lufa's usb stuff
[05:45:14] <mux_> no descriptors get sent over at all
[05:45:36] <abcminiuser> Ah okiedokie
[05:45:36] <mux_> it's a very generic problem but I'm not sure where to start debugging on this
[05:45:44] <abcminiuser> F_USB is set to 48000000?
[05:46:07] <mux_> lemme see if that is defined, the oscillator is running at 48MHz
[05:46:50] <mux_> yeah, F_USB=48000000 in the compiler symbols
[05:47:08] <abcminiuser> What's your LUFAConfig.h look like?
[05:47:10] <mux_> also, timer interrupts run at correct speed, so the DFLL is definitely working
[05:47:20] <mux_> yeah I had to mod that
[05:47:39] <mux_> #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
[05:47:45] <mux_> #define FIXED_CONTROL_ENDPOINT_SIZE 8
[05:47:52] <mux_> #define FIXED_NUM_CONFIGURATIONS 1
[05:47:57] <mux_> #define MAX_ENDPOINT_INDEX 4
[05:47:58] <mux_> done
[05:50:25] <abcminiuser> PMIC.CTRL has the IVSEL bit correctly set?
[05:50:41] <mux_> XMEGACLK_CCP_Write(&PMIC.CTRL, PMIC_IVSEL_bm | PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm);
[05:51:10] <mux_> and I have already tried reading it back and flashing a LED on PMIC.CTRL & PMIC_IVSEL_bm, it's actually set
[05:51:21] <mux_> also, other interrupts work
[05:51:44] <abcminiuser> Ah, but no USB activity at all?
[05:51:44] <mux_> and the USB ISR is in the bootloader section with the vector pointing towards the correct location
[05:53:09] <mux_> (double-checked some stuff) no, no USB activity
[05:53:09] <mux_> but
[05:53:44] <mux_> the USB interrupt does get called on each packet that the computer sends
[05:53:54] <mux_> (using LED flashing magic)
[05:54:32] <mux_> I assume my debug path starts around there?
[05:55:15] <abcminiuser> Jupp, sounds like it is at least seeing a basic sign of life
[05:55:43] <mux_> in other news, YAY farnell finally sent a backorder I desperately needed
[05:57:03] <mux_> (I do also get an unknown device in device manager with the very unhelpful device descriptor error message)
[05:57:23] <mux_> I don't believe there are any low-level USB bus sniffers for windows, right?
[05:58:19] <mux_> if I could just see the bare control requests, that would make life easier
[06:02:34] <abcminiuser> USBSnoop IIRC used to work
[06:02:54] <abcminiuser> Has snoopy as the project logo, was on ye olde WHAT YEAR IS IT sourceforge
[06:05:22] <mux_> thanks
[06:05:32] <mux_> I'm going to get some groceries, after that continue
[06:11:51] * twnqx waits for his hardware usb sniffer to arrive :3
[06:49:10] <mux_> IM BACK BITCHES
[06:58:50] * Tefad counts the number of fornications
[06:59:03] <Tefad> nope, none was given
[07:00:06] <mux_> I get that every time
[07:00:26] <mux_> people just don't seem to care about my existence in certain IRC rooms
[07:04:24] <antto> doh
[07:44:16] <evil_dan2wik> Anyone know what a pdi interface is for an xmega and how I use it for programming?
[07:48:10] <MajorGrub> Hi aller
[07:48:21] <MajorGrub> All*
[07:49:04] <MajorGrub> I'm trying to store an extern variable in flash but I don't know how to initialize it...
[07:49:27] <MajorGrub> I declare it as extern in a header and then when I try to initialize it in main
[07:49:38] <MajorGrub> Compiler says it has to be a modifiable lvalue
[07:49:47] <MajorGrub> I'm using codevisionavr
[07:52:37] <twnqx> if you want it to be const... why declare it extern in the first place?
[07:53:12] <MajorGrub> Extern because I use it in different modules
[07:54:17] <MajorGrub> Its a legacy piece of code that I have to maintain so
[07:56:07] <MajorGrub> It's stored in flash at compile time and then the value has to stay to the same
[07:56:21] <MajorGrub> Its to store compile time and software version number
[07:56:42] <MajorGrub> If you have a trick to do that without the need to use extern
[09:01:32] <rewolff1> specing: Oh I see, hfuse is E: and efuse is H:
[09:01:42] <rewolff1> Bug in AVRdude, has been fixed.
[09:02:21] <specing> k
[09:02:44] <rewolff1> (it prints them correctly one line earlier IIRC).
[09:03:45] <specing> I looked at them in -t anyway
[09:03:54] <specing> as Efuse ee didn't make any sense
[10:37:09] <specing> wtf, I get 0.3 V data signal on DO of mega8u2
[10:37:15] <specing> why so low?
[10:37:24] <specing> I can see the data with a scope, but dasa can't
[10:44:47] <aandrew> well 0.3V is well below the Vih of any microcontroller
[10:45:11] <aandrew> can you use a transistor to give you a nice CMOS or TTL logic level to look at?
[11:45:02] <specing> I can, but seriously wtf
[11:45:11] <specing> How can it only give 0.3?
[11:45:20] <specing> Maybe it is shorted to 0 somewhere?
[14:26:19] <rewolff1> For a real "short-to-ground" 0.3V is a lot.
[14:26:37] <rewolff1> Usually when you're getting way low "high" signals, but a "it works in theory",
[14:26:47] <rewolff1> you forgot to make the port output.
[14:26:56] <rewolff1> You're only enabeling the weak pullup.
[14:27:58] <rewolff1> from the 0.3V the pulldown/load seems to be around 3k.....
[14:28:13] <rewolff1> (or 0.1 mA).
[16:57:33] <hetii> HI :)
[16:58:50] <hetii> Q: Is it possible on avr use ADC to control current provided to led chains and in the same time have PWM functionality to control brightness ?
[16:59:20] <specing> Erm
[16:59:44] <specing> use ADC to get a digital representation of voltage and PWM to give a square wave signal
[17:05:13] <hetii> thats the idea
[17:06:08] <hetii> but all releated stuff with ADC will be enough fast do control the current ?
[17:09:30] <specing> probably not
[17:09:35] <specing> use the builtin comparator
[17:09:39] <specing> or an external one
[17:10:25] <hetii> Well I need control 4 strip and use minimal components cause of space on my board
[17:13:38] <Jartza> https://www.dropbox.com/s/93tq3xywdifpeft/20140813_009.jpg
[17:13:48] <Jartza> it works... gggreat
[17:15:55] <Jartza> https://www.dropbox.com/s/h8288n88w9oc2jf/20140813_005.jpg
[17:15:58] <Jartza> the other side
[17:17:12] <hetii> Nice display
[17:19:17] <Jartza> it's ok
[17:19:20] <Jartza> not the best, but cheap :)
[17:21:46] <Jartza> and the texts can be updated using my "modem" :)
[17:22:09] <hetii> well I successful run display with SSD1306 controller, its a graphic display, http://wiki.u8glib.googlecode.com/hg/otherpic/ssd1306_no_ack.jpg
[17:22:21] <Jartza> nice
[17:22:44] <hetii> just need i2c bus or can be bit bang.
[17:23:11] <Jartza> yeah, I also bitbang an oled display
[17:23:14] <Jartza> i2c
[17:23:37] <Jartza> is that expensive?
[17:23:49] <Jartza> the display
[17:24:23] <hetii> no
[17:24:50] <hetii> http://www.ebay.com/itm/281232746437?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649
[17:25:00] <hetii> around 7$
[17:25:25] <Jartza> not bad
[17:25:28] <Jartza> though it's quite small :)
[17:25:43] <Jartza> my display is $4.85
[17:25:48] <Jartza> although alphanumeric
[17:26:50] <hetii> yep, thats true its small but you can use different font style and must said that is really visible
[17:27:18] <Jartza> oleds are
[17:27:39] <Jartza> https://www.dropbox.com/s/0whgsf6ne1qg32f/20140804_001.jpg
[17:28:00] <hetii> they cost even 5.20$
[17:28:29] <hetii> yep, nice display also :)
[17:28:45] <Jartza> I might try next this 128x128 color oled :)
[17:28:47] <Jartza> it's SPI
[17:28:57] <Jartza> <$10
[17:29:13] <Jartza> darn
[17:29:15] <Jartza> where was it
[17:29:17] <Jartza> can't find the link
[17:30:04] <Jartza> but it had SSD1351 controller
[17:30:42] <hetii> you can get my driver from https://bitbucket.org/hetii/ssd1306-driver/src if you ever plan use SSD1306 display. I don`t like arduino world thats why port it to C.
[17:31:00] <Jartza> yeah, I don't "do arduino" either :)
[17:31:09] <Jartza> I'll bookmark that, thanks
[17:31:29] <hetii> no problem :>
[17:33:14] <hetii> As i notice there is some bug with this driver or my display cause it won`t start on every reset of my MCU, when I do it time after time.
[17:34:34] <Jartza> those are sometimes bitch to reset
[17:37:16] <Jartza> https://www.dropbox.com/s/gmgpxydy86b7gmg/VID_20140401_020840.mp4
[17:37:17] <Jartza> :)
[17:37:23] <Jartza> that's an early proto
[17:37:37] <Jartza> actually a smaller display, but same controller
[17:37:38] <N1njaneer> Nice!
[17:37:50] <Jartza> alphanumeric ftw ;)
[17:38:44] <Jartza> N1njaneer: hey, my first Real pcb is in order :)
[17:39:05] <Jartza> N1njaneer: http://gerblook.org/pcb/6PwTu7yhsnVz8RUNVCZmgH
[17:39:36] <Jartza> actually that's the same as that home etched proto
[17:43:41] <N1njaneer> Nice job!!
[17:45:43] <Jartza> thanks
[17:45:46] <Jartza> it's been quite a ride
[17:45:52] <Jartza> as learning experience
[17:47:21] <Jartza> if we didn't have that much through-hole components on shelf, I would've gone all the way smd :)
[17:47:35] <Jartza> I hate drilling when prototyping :D
[17:48:09] <Tom_itx> smt
[17:48:11] <Tom_itx> ftw!
[17:49:24] <Jartza> yeh
[17:49:44] <Jartza> altghough, as can be seen in the pcb photo, I'm not that good with smts eithe
[17:50:01] <Jartza> https://www.dropbox.com/s/93tq3xywdifpeft/20140813_009.jpg
[17:50:04] <Jartza> a bit rough
[17:50:42] <Jartza> didn't bother to clean the board, just wanted to know if it works :)
[17:51:54] <Jartza> also the solder paste I have is crap
[17:56:32] <Jartza> or maybe I didn't use enough heat. I don't know :)
[17:56:39] <Jartza> but it works. that's what counts ;)
[17:57:00] <N1njaneer> Yeah, solder-paste goes bad quickly if not kept under controlled environmental conditions.
[17:58:11] <Jartza> my controller environmental condition is in the fridge :D
[17:59:36] <Jartza> I have this cheap hot-air-station that I used
[18:02:59] <N1njaneer> Hey, if it works it's good!
[18:07:19] <Jartza> yeah. and I guess boards with solder masks and stuff are easier to solder too
[18:07:29] <Jartza> and presoldered pins
[18:08:05] <Jartza> took me 4 different designs of this really really simple card :)
[18:08:36] <Jartza> but now I'm quite happy, small amout of traces and all the "functional blocks" are separated from each other
[18:09:46] <Jartza> so power booster is near battery, modem circuit is in the other end of card, lcd capacitors in the middle and then attiny with capacitor and pull-up resistor near the lcd signal pins.
[18:10:16] <Jartza> guess I'm a bit picky, as I guess with that simple card, almost anything would've worked
[18:10:43] <Jartza> I also redraw schematics multiple times, because the first ones were done by spiders on caffeine
[18:14:07] <Jartza> but I firmly believe that one should learn how to do things right, even if it's "jus simple stuff"
[18:17:32] <Jartza> but I found out that I still have quite lot to learn :)
[18:17:41] <N1njaneer> But well on the way!
[18:22:09] <Jartza> yeah, learning is fun
[18:29:02] <Jartza> https://www.dropbox.com/s/zg49axtz72ktkbe/tagsu_v4_r4.pdf
[18:29:07] <Jartza> that's the latest sch
[18:30:50] <Jartza> could still be improved, but at least it's now readable
[18:33:04] <hetii> Can I use this http://i.imgur.com/RBxcl.png as a a current driver but instead R1/D1 connect pin1 directly to MCU ? OP amp will be LM324 and the power supply of led chain 12v and mcu 3.3v
[18:38:45] <N1njaneer> hetii: The point of R1/D1 is to set the precise current you want on the LED - the micro won't have a finely-trimmed output value. You could always use the micro to drive the VCC connection of R1 if you wanted to be able to turn it on and off.
[18:39:55] <hetii> hmm
[18:40:39] <hetii> I thought that R2 will set the current
[18:42:33] <hetii> I simulate it here: http://tinyurl.com/k5qyqm6
[18:42:57] <hetii> but see that current is change depend on voltage in input
[18:47:43] <Jartza> oh well, time to go to bed
[18:47:45] <Jartza> laters!
[18:49:43] <hetii> Cu :)
[19:55:55] <umquant> If I want to make a device that is an SPI slave, how do I got about setting up my own register address,data scheme like SPI slave devices typically have
[20:01:26] <Lambda_Aurigae> umquant, depends on the device.
[20:02:42] <umquant> Lambda_Aurigae: I am making the device so I can do it however. My slave device is a digital output card. So I want to be able to make the master device control each output via SPI
[20:03:10] <umquant> I have no clue however on how to go about making my own register address scheme for my slave device
[20:03:39] <Lambda_Aurigae> it depends on the device...what AVR are you using?
[20:04:03] <Lambda_Aurigae> or do you have the AVR playing slave already?
[20:04:16] <umquant> Oh whoops, I didn't realize you meant which MCU I am using. I am using an atmega328p
[20:04:32] <Lambda_Aurigae> ok..do you have it talking on the SPI bus as a slave?
[20:04:52] <umquant> Yes it just returns the data it was sent
[20:05:17] <Lambda_Aurigae> so now, instead of just returning the data, you have to process it somehow.
[20:06:18] <umquant> So first step is to maybe make an OP code? So it becomes if(SET opcode) { process next N bytes which would equal output XY}
[20:06:34] <Lambda_Aurigae> your program must accept the data, look at it, and decide what to do with it.
[20:07:25] <umquant> that doesn't sound bad. I can make a structure that stores the command, and another one that stores command parameters. Then use something like a switch/if else
[20:07:34] <Lambda_Aurigae> if it is a "register write" command then you take the additional data and store it in memory somewhere. if it is a register read then you get the data from memory and send it back.
[20:07:53] <umquant> Gotcha!
[20:08:23] <umquant> I will work on some code and come back if I have implementation specific problems.
[20:08:24] <Lambda_Aurigae> if it is data you want to save through power cycle then store it in eeprom.
[20:08:29] <umquant> Thank you for your help!
[20:26:40] <anton02> how do you make servo horns not fall off?
[20:26:51] <Valen> put the screw in them?
[20:28:34] <Lambda_Aurigae> j-b weld.
[23:47:50] <carp3> Hi, i set my AVR's fusebits to use external XTAL. but it failed to communicate to programmer after that and also didn't execute the code... but when i removed the XTAK caps it works ok now@16MHz What's going on ?
[23:48:39] <carp3> XTAL*
[23:51:56] <Casper> breadboard<
[23:52:00] <Casper> that's the problem
[23:54:37] <carp3> yes beadboard
[23:54:43] <carp3> breadboard*
[23:54:58] <Casper> breadboards are very capacitif
[23:55:02] <Casper> and cause havok
[23:57:19] <evil_dan2wik> carp3, if it works without the caps, use it that way. Just make sure you have caps off the board.