#avr | Logs for 2012-04-30

Back
[00:00:35] <Casper> maybe it's the end of the world as the maya predicted?
[00:02:59] <inflex> the one that passed months ago?
[00:04:59] <Casper> there was a translation error, it's in december iirc
[00:05:34] <Casper> december 21
[00:14:35] <inflex> they didn't account for leaps.
[00:15:52] <Casper> chance is that it's the spirit world that will merge with the physical one, a big resession, or more probably: another y2k bug
[00:16:30] <ziph> inflex: Don't you mean you're not sure if it's going to be Japan style or Zimbabwe style? :)
[00:17:07] <Casper> now, I think I only need to read on current transformer and I think I'll be able to start to design the psu I want to do :D
[00:20:32] <Casper> !seen rikusw
[00:20:33] <tobbor> RikusW was last seen in #avr on Apr 29 14:23 2012
[00:20:44] <Casper> !time
[00:20:45] <tobbor> My watch says its 22:13 Sun Apr 29 2012
[00:41:04] <buhman> in order to SPI-program an atmega, all I need to do is provide ~5V power to VCC/ACVV+GND, and then connect RST,SCK,MISO,MOSI,VDD, and GND to and ISP, yes?
[00:42:29] <buhman> I've probably permutated through every possible way to connect that incorrectly, and I'm relatively confident I have it right (probed each pin on the controller to the solder joint on the ISP)
[00:42:36] <buhman> yet it refuse to talk to me :S
[00:48:47] <buhman> http://absdev.org/mega.jpg is how I did it
[00:50:28] <buhman> it's an atmega 1284PU, and I'll touch one probe to, say for example, "MISO" on the ISP, and to pin 7 on the controller, and it's connected
[00:51:06] <buhman> I repeat this for each pin, referring to the pinout every time, and probe directly from the pins on the microcontroller, to the joints on the ISP
[00:51:24] <buhman> I measure my power supply at a steady 5.11V
[00:51:27] <CapnKernel> buhman: Do you have another chip you can try?
[00:52:25] <Casper> missing decoupling cap on the avr
[00:52:49] <Casper> try to add it
[00:52:55] <desaster> VDD from programmer is probably unnecessary?
[00:53:15] <Casper> depend if the programmer need it
[00:53:40] <buhman> CapnKernel: well, I also have a board, with a socket that I normally use it in, http://absdev.org/board_schematics-223.pdf , and it works just fine there; I suspect the controller isn't the problem
[00:53:44] <desaster> is reset connected? (i'll open the datasheet)
[00:53:50] <buhman> desaster: yep
[00:54:13] <buhman> CapnKernel: hrm, didn't know that
[00:57:47] <buhman> Casper: ^
[00:58:24] <desaster> buhman: maybe it's fused to use a crystal
[00:58:35] <desaster> like in that schematic
[00:59:16] <buhman> that would be unfortunate
[01:08:12] <Casper> buhman: what does it do exactly?
[01:08:25] <Casper> 1284... I wonder if it's the same familly as 128
[01:08:48] <Casper> hey try to connect mosi to RX0 and miso to TX0 (the serial port)
[01:12:21] <buhman> hah, it was the crystal
[01:12:46] <Casper> the mega128 use rx0 and tx0 instead of mosi and miso
[01:12:52] <buhman> erm, I just barely have leads going from the breadboard to the PCB (just touching with a tiny amount of force)
[01:17:01] <buhman> how do I read fuses? I've forgotten, I thought it was something like -U hfuse:r:high.hex but avrdude doesn't seem to like this: http://sprunge.us/jOPe
[01:17:18] <buhman> I'd really just like them all on stdout
[01:20:29] <desaster> my parameter looks like lfuse:r:lfuse.txt:r
[01:20:46] <desaster> and hfuse:r:hfuse.txt:r
[01:20:59] <Casper> what about hfuse:r:-:r
[01:21:28] <desaster> (i have them in separate commands for some reason)
[01:21:39] <buhman> that seems to write the bits themselves to stdout
[01:21:46] <buhman> I'd like the human-readable version :D
[01:23:57] <Casper> sp12, which only work with their programmer, was doing that
[01:24:56] <buhman> I would want, 65ms startup time on the internal oscillator, right?
[01:25:19] <buhman> I suspect that's safer than 0ms, yes?
[01:25:22] <Casper> depend how stable your clock need to be at code startup
[01:25:31] <Casper> 0 and max is as safe
[01:25:46] <Casper> the crystal take some time to be frequency stable
[01:26:00] <Casper> the startup delay is only for that
[01:26:29] <Casper> to wait until the clock is stable, so your code can run at normal speed right at the start
[01:29:27] <buhman> there we go, I wrote lfuse:w:0x62:m and it continues to talk to me (with and without the oscillator wires attached) :D
[01:29:37] <buhman> desaster: much appreciated
[01:30:24] <buhman> Casper: thank you
[01:39:04] <Casper> now where is that rikusw?
[03:29:07] <specing> Casper: RikusW is always evading us
[05:08:39] <norbi> hi to everybody
[05:08:42] * norbi waves
[05:09:42] <Steffanx> That's the spirit tobbor
[05:10:49] * Richard_Cavell waves to norbi
[05:12:29] <specing> tobbor is a CANUCK :D
[05:12:44] <Steffanx> CANUCK
[05:12:45] <tobbor> Yankie!
[05:12:48] <specing> Haha
[05:17:21] <norbi> what is the logic behind doing output compare with on a general i/o pin/
[05:17:22] <norbi> ?
[05:18:12] <norbi> i want to achieve pwm on general i/o pin, for first i will generate a timer interrupt with 50hz
[05:18:48] <norbi> with this the frequency of the pwm is set to 50hz, but how i manipulate the duty cycle?
[05:21:21] <specing> OCR
[05:21:59] <jacekowski> norbi: you need interrupt that is faster than your pwm frequency
[05:22:55] <norbi> jacekowski: why faster?
[05:23:21] <jacekowski> otherwise you won't be able to change your duty cycle
[05:24:18] <norbi> jacekowski: yea, you are right, how do i calculate how faster should be the interrupt? do i need exact cycle count?
[05:24:45] <jacekowski> well, depends on precision you want for your pwm
[05:26:21] <desaster> timers have 2 compare interrupts, right? i would probably just use those. one at 0 and one at duty length
[05:27:35] <jacekowski> there is one timer compare and one overflow
[05:27:40] <jacekowski> you can do it that way
[05:27:46] <OndraSter> yep
[05:27:59] <OndraSter> but why not just do the PWM directly with the timer? :)
[05:28:01] <jacekowski> but then you are using one timer per i/o pin
[05:28:10] <jacekowski> which is pointless
[05:28:16] <OndraSter> on the PWM pin
[05:28:27] <desaster> not necessarily
[05:28:28] <jacekowski> if you do it with faster timer, you can do pwm at few pins at the same time
[05:28:44] <desaster> on a non-avr chip, i did multiple pwms with one timer, because the pwm didn't need to be very precise (for servos)
[05:28:59] <inflex> O_o
[05:29:03] <inflex> what sort of servos?
[05:29:15] <desaster> just some rc cheapies
[05:29:19] <jacekowski> servos use PPM
[05:29:27] <inflex> Because I find servos intolerable with more than 0.5% jitter/noise
[05:29:35] <jacekowski> that's completly different kind of shit
[07:49:19] <amee2k> hmm
[07:49:35] <amee2k> the base-emitter junction of a BJT behaves like a diode, right?
[07:51:03] <karlp> yep
[07:51:19] <amee2k> the diode equation (dropping the -1 term ) says "If = IS * e^(q Vf / (k T))". Solving that for Vf however yields a term with positive temperature coefficient
[07:51:59] <amee2k> so if the BE voltage has positive tempco, why do i get thermal runaways if i parallel BJTs without emitter resistors??
[07:53:08] <karlp> no idea.
[08:09:21] <amee2k> something isn't adding up about this :/
[08:12:18] <amee2k> that shockley model must be missing another term that depends on temperature somewhere
[08:13:15] <karlp> or, you're no longer in the realm of viewing the BE junction as a pure diode.
[08:13:27] <karlp> there's that whol BC junction too, sitting there getting in the way
[08:13:44] <karlp> if the model doesn't match reality, get a new model :)
[08:13:50] <norbi> guys, i need some helps from you with a servo
[08:14:10] <norbi> hobby servo motor, around 50hz
[08:15:16] <norbi> when im telling him to go left: 1ms, then middle 1,5ms then 2ms to right it moves there but first id does 2 repeated movements, bad behave
[08:15:20] <amee2k> karlp: i tend to suspect the diode model, since a web search seems to suggest that there is some dispute over the tempco of PN junction diodes as well
[08:16:06] <norbi> go left: 1ms duty cycle, delay_ms(5500); it does 3 movements before fixing the position to the extreme left
[08:16:16] <norbi> then same thing with middle, and right
[08:16:17] <norbi> why?
[08:18:06] <amee2k> karlp: eeek... i found it. the shockley model is an approximation. http://en.wikipedia.org/wiki/Diode#Temperature_measurements
[08:18:19] <amee2k> seems like they exist with both positive and negative tempcos, depending on the manufacturing process :/
[08:18:57] <karlp> disco inferno!
[08:19:19] <karlp> isn't this something on the transistors datasheet anyway?
[08:19:28] <karlp> or are you (ab)using transistors in abnormal ways?
[08:19:47] <amee2k> no, i'm trying to understand how they work
[08:20:13] <amee2k> if i only wanted to use them, i'd just use emitter resistors because everyone does and be done with it
[08:20:26] <amee2k> "when in rome, do like the romans do" 'n shit >_>
[08:20:36] <karlp> I've forgotten all the analog modelling parts of transistor theory from uni.
[08:20:50] <karlp> now they're just a switch, or something on a module I buy prebuilt.
[08:21:39] <amee2k> hehe :)
[08:21:58] <amee2k> i'm writing another article for mitx
[08:22:10] <amee2k> seems to have become a habit :)
[08:23:12] <karlp> I can't remember the last time I used a transistor in the linear region deliberately
[08:23:26] <karlp> and I can't honestly forsee me doing it again
[08:24:04] <amee2k> mmh emitter follower comes to mind?
[08:25:36] <karlp> meh, I don't play with audio stuff
[08:26:57] <OndraSter> I just buy finished amp :P
[08:27:03] <amee2k> :)
[08:27:15] <OndraSter> I tend to buy old stuff from 80s - 90s, they are cheap and actually are able to deliver specified power
[08:27:19] <OndraSter> with low distortion
[08:27:21] <amee2k> analog stuff is kinda fun once you get to know your way around a bit
[08:27:29] <OndraSter> I still prefer digital stuff :D
[08:28:00] <karlp> amee2k: it's not that it's not fun, I just don't have any use for it
[08:28:07] <amee2k> especially since noone else does anymore... in 5 years playing with discrete transistors will probably be an obscure art like building vacuum tube circuits :)
[08:28:26] <amee2k> you have no use for fun? o.O
[08:28:37] <karlp> no, I have _more_ fun on other areas :)
[08:28:52] <OndraSter> (women)
[08:28:59] <amee2k> ...
[08:29:06] <OndraSter> class D amp converts analog signal to PWM signal
[08:29:09] <OndraSter> 'nuff for me :P
[08:29:17] <OndraSter> or is it another class?
[08:29:28] <amee2k> i want to build a class D amp from a bunch of 555s :P
[08:29:41] <OndraSter> wow
[08:29:45] <OndraSter> good luck mate :)
[08:29:48] <amee2k> >_>
[08:30:08] <OndraSter> I was checking out datasheet for my amp (Technics SU-500) the other night
[08:30:10] <OndraSter> it is fairly simple lol
[08:30:20] <OndraSter> few caps, few resistors and one seriously huge IC :D
[08:30:26] <amee2k> i'd say with some of the nice new CMOS 555s it should just work
[08:30:28] <OndraSter> (and few simple opamps around it)
[08:30:42] <OndraSter> afk
[08:30:44] <karlp> OndraSter: you're forgetting the massive heatsinks
[08:49:00] <OndraSter> actually
[08:49:04] <OndraSter> there is just one massive heatsink :)
[08:49:07] <OndraSter> and it is REALLY massive
[08:49:15] <OndraSter> I had somewhere pic
[08:50:05] <nevyn> meh TNN500AF
[08:50:32] <nevyn> (it's a case zalman made) where the outside of the case is the heatsink
[08:50:44] <nevyn> passive cooled airtight pc
[08:52:42] <OndraSter> hm can't find the photo
[08:52:43] <OndraSter> http://clip2net.com/s/1RPed
[08:52:50] <OndraSter> only screenshot from service manual
[09:07:16] <OndraSter> 41 electronics parts in the amp
[09:07:16] <OndraSter> lol
[09:07:21] <OndraSter> at least by the service manual
[09:07:26] <OndraSter> Replacement parts list
[09:07:40] <OndraSter> (then another 50 cabinet and chassis stuff and screws etc)
[09:10:53] <OndraSter> the schematics is simple as it can be
[09:11:06] <OndraSter> just the tone control is a bit weird (for me), but that's it
[09:11:17] <OndraSter> just few switches and.. that's it
[12:37:14] <Essobi> tbh I havnt looked at how to interface with servo's at all.
[12:37:32] <Tom_L> !thislog
[12:37:32] <tobbor> This one: http://rueshouse.dyndns.org:82/~ircjunk/irclogs/html/%23avr-2012-04-30.html
[12:52:46] <Essobi> norbi: asked in somewhere like #electronics? They're active sometimes during this time of day... or maybe the #sparkfun channel.
[12:53:35] <norbi> Essobi: asked in #electronics but not much avtivity or interests about servos
[12:53:57] <Essobi> yea, there's a lot of hardcore ee's in there.
[13:32:50] <koo3>
[13:48:07] <Kev> norbi most servos are supposed to be driven at 50hz
[14:51:42] <Xata> hi all
[14:52:17] <OndraSter_> hi
[14:58:43] <asteve> ehlo ehlo
[15:13:53] <OndraSter_> huah, QDEC in xmega
[15:14:07] <OndraSter_> seriously, the only thing that xmega is lacking is... hmm
[15:16:04] <karlp> another manufacturer?
[15:17:45] <OndraSter__> the QDEC deserves some demo
[15:17:47] <OndraSter__> sample code
[15:18:28] <OndraSter__> oh, qdec decodes and runs only timer stuff
[15:19:49] <OndraSter__> counter stuff* to be precise
[17:08:02] <OndraSter__> abc
[17:08:03] <OndraSter__> he is gone
[17:08:07] <OndraSter__> I FOUND BUG!! I FOUND BUG
[17:08:18] <OndraSter__> there is no PORT.OUT in the xmega libs :)
[17:08:23] <OndraSter__> only OUTTGL, OUTSET and OUTCLR
[17:09:19] <OndraSter__> actually
[17:09:31] <OndraSter__> still using outclr and outset is 1 cycle shorter than using read-modify-write :)
[17:09:42] <OndraSter__> you can do clear-write
[17:12:51] <karlp> OndraSter__: that's why they exist :)
[17:12:59] <karlp> similar to the bitbanding on cortex
[17:27:22] <mikemonk> hey guys! so i was given a programmer made using an ATMEGA8 16PU its target is an AT89S52, in OS X is recognized as an AVR-DOPER. I've already installed AVRDUDE, my question is how do i clean the AT89S52, and then burn the .hex file i have into it?
[17:43:46] <ThersiT> mikemonk: The chip will get "cleaned" as part of avrdude programming it. Have a look at this to get started with avrdude http://www.ladyada.net/learn/avr/avrdude.html
[17:44:41] <mikemonk> ThersiT: thanks
[17:44:47] <ThersiT> np
[17:45:37] <mikemonk> ThersiT: how do i know which programmer to select?
[17:51:01] <ThersiT> Which output of the programmer are you using?
[17:58:27] <mikemonk> ThersiT: what do you mean?
[18:00:53] <ThersiT> try stk500
[18:03:19] <mikemonk> ok
[18:09:02] <mikemonk> ThersiT: ok there's a problem, the AT89S52 isn't listed as a valid part…
[18:11:24] <ThersiT> Yea I was just noticing that.
[18:12:24] <mikemonk> ThersiT: i found this http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=99161&postdays=0&postorder=asc&start=20
[18:12:46] <mikemonk> last post
[18:13:20] <mikemonk> what does david.prentice means by: "using avrdude with an inverter on the RESET line"
[18:17:09] <ThersiT> On most AVRs to put them in reset mode you pull the reset pin to ground but on that one you would pull it to VCC.
[18:18:33] <ThersiT> I wouldn't know how to build that circuit tho.
[18:18:52] <Tom_itx> an inverter?
[18:18:58] <ThersiT> Keep looking I'm sure it's online somewhere.
[18:19:46] <Tom_itx> i like nice trouble free programmers
[18:19:50] <Tom_itx> like mine :)
[18:19:52] <ThersiT> yea i guess.
[18:20:33] <Tom_itx> they want you to invert the signal going to the reset?
[18:20:36] <ThersiT> Hell yea, my world has been alot nicer sence I got one of your programmers. :)
[18:20:37] <mikemonk> so you guys thersiT and Tom_itx don't think that configuration would work with my programmer?
[18:20:53] <Tom_itx> i didn't look, just got here
[18:21:08] <mikemonk> Tom_itx
[18:21:10] <mikemonk> http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=99161&postdays=0&postorder=asc&start=20
[18:21:32] <mikemonk> last post
[18:22:04] <Tom_itx> oh is that a flash or eeprom chip?
[18:23:26] <OndraSter__> I have just realized
[18:23:27] <OndraSter__> OSC.CTRL = (1 << OSC_RC32MEN_bp) | (1 << OSC_RC32KEN_bp);
[18:23:42] <Tom_itx> so just find any gate and make an inverter out of it
[18:23:45] <OndraSter__> what is the difference between 1 << OSC_RC32MEN_bp (bit position) and OSC_RC32MEN_bm?
[18:23:46] <OndraSter__> (bit mask)
[18:23:51] <OndraSter__> they both end up in the same name
[18:23:52] <OndraSter__> err
[18:23:54] <OndraSter__> in the same value
[18:24:49] <mikemonk> Tom_itx: i have a programmer based on the ATMEGA8 16PU the target micro controller is the AT89S52, so i'm confused as to how should i use avrdude
[18:25:08] <Tom_itx> me too
[18:25:26] <mikemonk> :P
[18:26:09] <Kevin`> using lead solder is worth it. you won't have any problems if you don't eat it (wash your hands etc), and it's functionally superior
[18:27:00] * Tom_itx stops chewing on his solder string
[18:27:15] <OndraSter__> waaaaat, what's wrong about lead!
[18:27:23] <OndraSter__> I now have to take it out from my breakfast cereal :(
[18:27:35] <mikemonk> ot's an essential mineral
[18:27:43] <OndraSter__> exactly!
[18:28:06] <Tom_itx> you realize you put that code in the avrdude file right?
[18:28:17] <Tom_itx> what's avrdude see your programmer as?
[18:37:25] <mikemonk> Tom_itx: yes i realize that
[18:38:00] <mikemonk> Tom_itx: let me check how it detects the programmer
[18:41:58] <mikemonk> Tom_itx: osx detects it as avr-doper
[18:42:24] <mikemonk> but i'm not sure how to make avrdude tell me how it sees it
[18:44:13] <Tom_itx> read the avrdude doc
[18:45:02] <Tom_itx> if it's not one of the defined avrdude programmers, that too may need to be added to the avrdude.conf
[18:47:20] <mikemonk> does this mean it isn't defined? -> avrdude: ser_open(): can't open device "unknown": No such file or directory
[18:48:12] <Tom_itx> or you have the wrong device selected
[18:52:08] <mikemonk> Tom_itx: how do i know if it's one of the listed devices?
[18:52:18] <mikemonk> it is a student made programmer
[18:52:23] <Tom_itx> read the pdf
[18:52:27] <Tom_itx> and it will tell you
[18:55:10] <mikemonk> Tom_itx: let me ask you something… this programmer was given to me with a windows 7 driver, and avr studio… but it only works in a 32 bit OS… are all lowcdc.sys files the same? i mean, i just found a 64 bit one… but i don't know if i can use it instead of the given one
[19:00:36] <Tom_itx> no idea
[19:29:51] <mikemonk> ok i think i got it to work :)
[19:30:02] <Tom_itx> oh good
[19:31:52] <mikemonk> Tom_itx: the avrdude wrote something to the ATS8952, if it wrote something, means it did it correctly?
[19:32:26] <mikemonk> or should i test the program, in a hardware circuit?
[19:32:57] <Tom_itx> you better make sure it's what you expected
[19:35:45] <mikemonk> Tom_itx: by hardware?
[19:37:33] <Tom_itx> or read the file back and compare it
[19:37:57] <Kevin`> avrdude normally does that by default (read and compare), did you tell it not to?
[19:38:17] <Kevin`> you'd notice it, since it's a seperate operation
[19:38:39] <Tom_itx> unless it's reversed or some silly thing like that
[19:38:50] <Tom_itx> that file should have taken care of that though
[19:42:19] <mikemonk> the avrdude said that the read instruction was not defined for the AT89S52 part
[19:42:28] <mikemonk> the output:
[19:42:36] <mikemonk> http://pastebin.com/GmHG5dWj
[20:13:42] <Kevin`> mikemonk: interesting
[20:14:26] <Kevin`> does it HAVE a read operation?
[20:19:27] <Tom_itx> you should be able to read it
[20:19:34] <Tom_itx> what good is it if you can't?
[20:20:53] <Kevin`> well it's a microcontroller, technically you only need to be able to burn code to it and run it
[20:21:02] <Kevin`> it would be a bit odd not to read it though
[20:21:19] <Tom_itx> unless it's got lock bits burned
[20:25:14] <mikemonk> ok guys… browsing avrdudes patches i found this: http://savannah.nongnu.org/patch/?7703#
[20:25:36] <mikemonk> which seems to add support for my target microcontroller
[20:27:44] <mikemonk> for the patch file i use the patch command
[20:28:53] <mikemonk> but how do i add the extras contained in the avrdude.conf file to the original avrdude.conf file
[20:28:55] <mikemonk> ?
[20:29:32] <Tom_itx> if it's just a file edit, edit it
[20:30:02] <mikemonk> the original one?
[20:30:31] <Tom_itx> you _can_ make a backup ya know
[20:30:51] <mikemonk> :P
[20:31:35] <mikemonk> I'm excited :) i think i'll finally be able to program my 8S52 microcontroller
[20:32:09] <mikemonk> thanks for your help btw guys
[20:32:33] <Tom_itx> np
[20:32:48] <mikemonk> gonna grab a bite… i'm starving
[20:33:33] <mikemonk> cya
[22:33:34] <iR0b0t1> Has anyone used the six pin devices?
[22:34:00] <Tom_itx> u bet we have
[22:34:32] <iR0b0t1> For what, may I ask? I was thinking of having them (or equivalent 8-pin devices) control sensor blobs.
[22:34:41] <iR0b0t1> I mean I guess that was kind of their intention.
[22:35:06] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/temp/tiny/tinyTPI1.jpg
[22:35:16] <Tom_itx> proved out my programmer with it
[22:35:38] <Tom_itx> 16 bit timer
[22:35:47] <Tom_itx> pwm, adc
[22:36:12] <iR0b0t1> huh
[22:36:16] <iR0b0t1> that's actually not that bad
[22:36:43] <iR0b0t1> they're cute :3
[22:40:40] <Casper> it's not normal to have to use almost all the pins to program a device! :D
[22:46:05] <xorm> what's a good alternative to the .1" ISP header?
[22:46:26] <xorm> something that's suited for use on very compact baords
[22:47:02] <iR0b0t1> xorm: But still header pins?
[22:47:07] <xorm> if your'e doing something with a chip that small, it doesn't make sense to have a relatively huge header on there
[22:47:10] <xorm> not necessarily
[22:47:21] <xorm> i was wondering if there was a semi-typical way of doing it
[22:47:22] <iR0b0t1> They have those clasp connectors for those microribbon cables.
[22:47:29] <iR0b0t1> I have no idea what they're called.
[22:47:36] <xorm> clasp connectors?
[22:47:46] <xorm> OH
[22:47:48] <iR0b0t1> it's a SMT part, 40 pins is a common size
[22:47:50] <xorm> FPC
[22:47:54] <iR0b0t1> probably that
[22:48:07] <xorm> yeah the little plastic flat guys
[22:48:21] <xorm> that's a little bit better
[22:49:22] <xorm> actually it'd be neat to make one that just had test points
[22:49:29] <xorm> that made contact to pogo pins in a jig
[22:50:17] <xorm> you'd probably want to be making a dozen at least for that to be worthwhile though