#avr | Logs for 2013-03-25

Back
[06:40:29] <tzanger> Tom_itx: looking at your programmer + 12V board; how do you connect to SCI (PB3) -- it doesn't look like you actuall have a connection for it
[07:00:17] <DanFrederiksen> what can a 5V atmega handle as max voltage for the ADC? can it handle 7V without dying? and what value does it result in when above Vcc? just 255 or can it give 212?
[07:03:16] <tzanger> DanFrederiksen: check the datasheet but generally speaking you can't go above VCC because the internal protection diodes will begin to conduct
[07:03:47] <tzanger> DanFrederiksen: and as far as the value: it's all referenced to vref so whatever ratio vin:vref is, that's what you'll see, up to vref
[07:09:57] <OndraSter> yep
[07:10:04] <OndraSter> and it would be giving you 255
[07:10:06] <OndraSter> well, 1024
[07:10:08] <OndraSter> since it is 10bit
[07:10:10] <OndraSter> 1023*
[07:23:42] * dunz0r got a free Atmega32 yesterday
[07:24:07] <dunz0r> Gonna use it for my Model M USB-keyboard project I think. But I'm out of 16MHz crystals :(
[07:33:57] <dunz0r> There. 2 HC-49S crystals ordered from Thailand
[07:34:17] <OndraSter> thailand...
[07:34:23] <OndraSter> make sure they are not secretly males!
[07:36:00] <dunz0r> OndraSter: Haha, they're through hole so I guess they are male?(Since the PCB is "female") :)
[07:36:00] <OndraSter> damn, I always hope to get some borked laptop with okay screen so I can try making vhdl code to drive the display...
[07:36:09] <OndraSter> dunz0r, I know, broken joke :( :D
[07:36:32] <dunz0r> It feels silly using such a huge µCU... but I need all those pins for reading keys and what not.
[07:36:55] <OndraSter> I mean, VHDL code for FPGA I have got here since ever
[07:36:59] <OndraSter> but I always fix the laptop :(
[07:37:12] <OndraSter> this time it was broken flex cable going to the power board :/
[07:37:37] <dunz0r> OndraSter: Hmm... get a really old laptop maybe? So it's not a big loss if you don't fix it I mean
[07:37:44] <OndraSter> :D
[07:37:56] <OndraSter> I get like one broken laptop in 2 months, but I always fix it :(
[07:38:17] <OndraSter> old laptop won't be using LVDS
[07:38:19] <OndraSter> interface
[07:41:48] <OndraSter_> old laptop won't be using LVDS
[07:41:50] <OndraSter_> interface
[07:41:58] <OndraSter_> (bloody internet, makes me look like a fool)
[07:49:25] <tzanger> OndraSter_: I have a dozen screens with that exact purpose in mind
[07:49:38] <OndraSter_> hehe
[07:49:46] <OndraSter_> I have got here altera cycloneII on some board from ebay
[07:50:01] <OndraSter_> LVDS is not that bad tbjh
[07:50:02] <OndraSter_> tbh
[07:50:21] <OndraSter_> just a lot of data to be tx-ed
[07:50:34] <tzanger> nice. I have a *really* nice Cyclone IV GX eval board (useless for that though), Xilinx Spartan 3-1500 which would be perfect and a Cyclone IV on a DE0-nan0
[07:50:37] <tzanger> er de0-nano
[07:50:48] <tzanger> and yeah it's just connections and clocking
[07:52:09] <tzanger> I'm trying to see how Tom_itx's programmer can do HVSP; the 12V supply stands in line from the programmer to the board to program, and the 6 pin connector does not have a connection to PB3 which seems to be a requirement for HVISP
[07:53:15] <tzanger> I think I'll make an HVSP AVR "unfucker" that just resets all the fuses and blanks the part
[07:58:03] <OndraSter_> wow my internet is so crap right now that I can't stream 128Kbps audio without buffering every few seconds :(
[08:01:41] <DanFrederiksen> OndraSter_, adsl?
[08:01:49] <OndraSter_> nah
[08:02:31] <DanFrederiksen> mine sometimes grinds to a halt, helps to reboot the modem
[08:02:55] <DanFrederiksen> somehow the upstream bandwidth disappears
[08:02:56] <OndraSter_> this is issue with connection between two routers, nothing I can do about
[08:03:02] <OndraSter_> only wait before somebody fixes it
[08:03:31] <DanFrederiksen> you have wireless internet?
[08:03:41] <OndraSter_> well
[08:03:53] <OndraSter_> the ethernet cable runs to the neighbours where it runs over wifi to another router
[08:03:56] * RikusW got GPRS
[08:04:06] <OndraSter_> and the main connection to the ISP's gateway broke so it runs through two more routers
[08:04:28] <OndraSter_> (zebra/ospf dynamic routing took care of that)
[08:05:02] <RikusW> my RPC over UART code seems to be working :)
[08:05:41] <RikusW> for debugging the SIM900 fw inside VS
[08:05:50] <OndraSter_> :)
[08:05:51] <OndraSter_> yay for VS
[08:06:41] <OndraSter_> anyway, the last laptop was fixed by using different flat flex cable for the power button board, which makes for me zero sense since the flex cable was below keyboard and could not break
[08:06:45] <OndraSter_> and shows no signs of damage
[08:06:58] <RikusW> VS97 aka DS97
[08:07:02] <OndraSter_> :P
[08:07:12] <RikusW> it starts up in 1 second :)
[08:07:35] <RikusW> and wants a pc with a minimum of 16 prefarably 32MB of RAM ;)
[08:07:47] <OndraSter_> hmm
[08:07:55] <OndraSter_> I could run more than 1024 instances!
[08:08:09] <RikusW> I actually bought it as a student version
[08:08:11] <RikusW> VC++5
[08:08:40] <RikusW> also included was VJ++1.1 and VB 5...
[08:08:50] <RikusW> toyed with VJ, never used VB...
[08:09:11] <OndraSter_> I know about a university that teaches VB6 lol
[08:09:15] <OndraSter_> some people dare to use VB.NET
[08:09:19] <RikusW> OndraSter_: maybe even more, most stuff is shared..
[08:09:19] <OndraSter_> and some (the smartest) use C#
[08:09:46] <RikusW> what do you call the raw C++ guys then ?
[08:10:07] <OndraSter_> depends on.. embedded stuff or PC stuff?
[08:10:14] <OndraSter_> if you can use C# or any other managed language, use it.
[08:10:24] <RikusW> guess embedded is a step above pc
[08:11:49] * RikusW had to solder the 1mm coax cable for the sim900
[08:12:01] <RikusW> it broke where it entered the connector..
[08:13:09] <RikusW> OndraSter_: my brother says VB teaches you bad habits ;)
[08:17:03] * RikusW considers learning python sometime for fun
[08:17:31] <RikusW> I messed around with perl, but some call it a write only language
[08:17:37] <Steffanx> Go for it RikusW :)
[08:17:50] <RikusW> Steffanx: do you know python ?
[08:17:58] <Steffanx> A little
[08:18:01] <Steffanx> The very basics
[08:18:07] <RikusW> seems like a nice language
[08:18:41] <dunz0r> It is quite nice. I've done some web-stuff in it. It's a bit difficult if you're used to C though.
[08:18:46] <dunz0r> Lots of gotchas.
[08:19:01] <dunz0r> Like how list indexes work and that whole try: except: thing
[08:19:21] <RikusW> I've used C++ exceptions before
[08:21:17] <dunz0r> I'm so used to handling errors with if-cases that I do it on pure instinct in python :)
[08:21:23] * RikusW knows Pick BASIC too, its embedded in the Pick database
[08:22:02] <RikusW> last time I used it was in 2003
[08:23:16] <RikusW> its a bytecode type language
[08:23:24] <tzanger> RikusW: nice, RPC over UART? what kind of RPC are you doing
[08:23:33] <RikusW> custom built
[08:23:49] <RikusW> for the SIM900 EmbeddedAT api
[08:23:56] <tzanger> ah ok
[08:24:25] <RikusW> that would be the easiest way to debug that code
[08:24:40] <RikusW> there is no jtag on the SIM900 (at least not documented...)
[08:25:33] <RikusW> basically I send a function number (parameter type + value) x N
[08:26:02] <RikusW> I made an enum like voidT intT etc
[08:26:24] <RikusW> and used vim and regular expressions to do most of the heavy work
[08:26:39] <RikusW> to convert the header file into stubs
[08:31:05] <RikusW> I did something similar for AVR, directly accessing registers over UART and with some operator overloading you could write and test AVR fw in VS
[08:31:14] <RikusW> with speed limitations ofcourse
[10:44:40] <jc5134> hello, anyone has experience with avarice and eclipse (gdb) ?
[10:45:16] <jc5134> when I click 'view assembly', avarice debugging output shows eclipse is trying to read from all memory locations. Eclipse totally hangs and seems to be waiting until a full 32bit memory range is read
[10:45:49] <jc5134> is it possible to constrain this somehow to usable avr memory limits ?
[10:57:20] <sdf8h> hello. how can i control a motor of 12v? i checked this link http://www.ikalogic.com/8-bit-digital-to-analog-converter-dac/ . here they are talking about r/2r method but i don't know how can i get 12v at the output
[10:58:12] <asteve> sdf8h: you want to use an h-bridge
[10:58:16] <RikusW> use a transistor or mosfet
[10:58:30] <RikusW> but that will be in the linear region and create heat...
[10:58:40] <jc5134> sdf8h, through a transistor, for example as such: http://www.ermicro.com/blog/?p=423
[10:58:42] <RikusW> or use PWM instead of DAC
[10:58:54] <sdf8h> i need to use DAC
[10:59:04] <asteve> that is a strange requirement
[10:59:14] <jc5134> why ?
[10:59:16] <RikusW> homework ?
[10:59:18] <sdf8h> it's just for a project in school
[10:59:25] <jc5134> oh.. I see
[10:59:31] <asteve> bummer
[10:59:51] <RikusW> PWM would be more efficient
[10:59:57] <jc5134> RikusW, mosfets are transistors too ;P
[11:00:08] <sdf8h> and the AO from the link i provided is just for a stabilized voltage, right?
[11:00:25] <RikusW> I meant bipolar + fet
[11:00:44] <jc5134> well obviously a non-inverting amplifier with some small precise gain
[11:00:46] <asteve> non inductive load
[11:01:13] <asteve> anyway, use the dac to play a song while you build your circuit using an h-bridge
[11:01:19] <jc5134> or a trimmable zener diode + an amp
[11:01:21] <asteve> maybe you'll get bonus points
[11:02:01] <sdf8h> yes but i will also need to explain myself why i had done that :p
[11:02:13] <jc5134> or just a simple dc-dc converter with digitally controlled output, lol
[11:02:19] <sdf8h> so the transistor way seems clearer and easier
[11:03:22] <sdf8h> another question regarding that link. how to choose the value for the resistors?
[11:03:25] <jc5134> anyone using avarice with eclipse, guys ?
[11:03:54] <jc5134> I just wanna know if your 'view dissasembly' is working. I'm wondering if its just me.
[11:04:05] * RikusW use AS4 to debug...
[11:04:36] <jc5134> oh well.. I'll just use gdb for the disassembled work
[11:04:58] <jc5134> damn I hate it when a program compiled with -O0 doesn't work and -O2 does :(
[11:06:01] <RikusW> thats qvr-gcc at its best...
[11:06:27] <asteve> -O0?
[11:06:28] <jc5134> I'm accessing an asynchronnous timer so I have a hunch that the unrolled version doesn't fit into the 100 instruction limit I have to set it up
[11:06:38] <jc5134> and bad things TM may happen
[11:07:16] <RikusW> jc5134: are you using a simulator or OCD ?
[11:07:19] <jc5134> but oh god does it misbehave. It seems to jump all over the place for some reason
[11:07:22] <jc5134> RikusW, OCD
[11:07:32] <jc5134> jtagmk1 (one of those cheap clones)
[11:08:22] <jc5134> maybe ATOMIC_BLOCK isn't working with -O0 ? anyone heard of that ?
[11:08:23] <RikusW> I built one too, coded from scratch
[11:08:34] <RikusW> not using the official atmel fw...
[11:08:36] <jc5134> RikusW, really? very cool
[11:08:47] <jc5134> RikusW, the protocol is documented ?
[11:08:52] <RikusW> http://sites.google.com/site/megau2s/home/
[11:08:58] <RikusW> now it is
[11:09:03] <jc5134> I mean the jtag one, from debugger to avr
[11:09:21] <RikusW> the jtag asm source is on the site, will work even on m8
[11:09:24] <jc5134> RikusW, wow, thats a real service to society :) kudos
[11:09:37] <jc5134> fav
[11:09:42] <RikusW> I got hold of the atmel fw ans hacked that
[11:09:51] <RikusW> took 2 months...
[11:09:59] <jc5134> figured as much :)
[11:10:04] <jc5134> really cool
[11:10:11] <RikusW> thanks :)
[11:10:18] <RikusW> you'll need AS4 to compile it..
[11:10:26] <RikusW> (avrasm2)
[11:10:34] <jc5134> RikusW, you don't like avr-gcc ?
[11:10:39] <jc5134> and gas ?
[11:10:41] <RikusW> not much
[11:10:52] <RikusW> please no ;)
[11:11:03] <jc5134> whatever, it can be converted anyways ;P
[11:11:05] <RikusW> I'm used to atmel asm
[11:11:11] <RikusW> with effort..
[11:11:18] <RikusW> actually I use Linux
[11:11:24] <RikusW> but for AVR stuff AS4
[11:11:27] <jc5134> I had tons of trouble converting from nasm to gas, lol
[11:11:30] <jc5134> I totally hated it
[11:11:31] <RikusW> or maybe AS5/6
[11:11:54] <jc5134> not the 'going from C to python' kinda hate. Just the 'everything has a different symbol' kinda hate.
[11:12:06] <RikusW> heh
[11:12:14] <RikusW> avr-gcc comes with AS4 too
[11:12:19] <jc5134> I know
[11:12:27] <RikusW> but I had some problems with bugs in gcc...
[11:12:35] <RikusW> so I used asm for my entire project
[11:12:52] <jc5134> oh hells yes. I have to do tons of workarounds because of brain damage
[11:13:11] <jc5134> coming from ARM gcc, avr-gcc is a total hell
[11:13:35] <RikusW> so instead I used asm and knew exactly what I did
[11:14:40] <sdf8h> regarding my questions about this http://www.ikalogic.com/8-bit-digital-to-analog-converter-dac/ , if i have 5v in every output, how do i choose my resistors?
[11:16:14] <jc5134> RikusW, if I didn't have to program this stuff for a living I would probably do it in asm too ;P
[11:16:20] <RikusW> jc5134: good to know arm-gcc is a bit better
[11:16:33] <jc5134> RikusW, i would say completely 10000% different experience
[11:16:44] <jc5134> RikusW, the > 100 is for floating point :P
[11:17:34] <RikusW> I have RVCT2.2 for a SIM900 gsm module
[11:17:46] <RikusW> ARM9E on there
[11:17:51] <jc5134> I've used it on x86/amd64, armv4t, armv8 and mips32, each one worked just as advertized
[11:18:03] <RikusW> and capable of loading custom app firmware
[11:18:35] <jc5134> it even detects strange things you would totally miss (using libraries in thumb that don't have interwork enabled, etc)
[11:18:52] <jc5134> avr-gcc is a total opposite. You have to do stuff preciesly as they say or the behaviour is undefined
[11:19:03] <jc5134> of course if you do, it is undefined anyway :)
[11:21:05] <RikusW> the mki disassembled and commented fw is on my site too, 8kloc...
[11:22:16] <jc5134> RikusW, I'll definitely look at it when I don't have to work :)
[11:23:00] <RikusW> there is some nice links in there to reverse engineering sites too
[11:23:04] <jc5134> I'd love to make a high volt range high speed open source programmer/debugger out of that eventually
[11:23:17] <RikusW> HVPP ?
[11:23:23] <jc5134> probably some cortex-m arm
[11:23:25] <RikusW> I've hacked STK500 already
[11:23:38] <jc5134> yes I'd like to support everything, including debugwire if possible
[11:23:48] <jc5134> but that's just a dream in distant future :)
[11:23:51] <RikusW> I use AVRProg and a virtual device to decrypt the fw for me...
[11:24:06] <RikusW> have you seen my work on dW ?
[11:24:16] <jc5134> nope, you did something ?
[11:24:22] <RikusW> hacked it all
[11:24:29] <RikusW> ruemohr.org
[11:24:31] <jc5134> oh come on :)
[11:24:33] <RikusW> look at docs
[11:24:43] <RikusW> its a simple 1 wire uart
[11:24:54] <RikusW> running at clock/128
[11:25:15] <jc5134> wow !
[11:25:21] <jc5134> that's information gold right there
[11:25:34] <jc5134> of course I'll probably use it and credit you ;P
[11:25:35] <RikusW> I listened in on the Dragon
[11:25:51] <RikusW> just connected a rx line at the right baud
[11:25:52] <jc5134> if anything the thing I do will definitely be GPLed
[11:25:52] <RikusW> :)
[11:26:40] <RikusW> I've partly done the autobauding fw
[11:26:41] <jc5134> RikusW, could you get in legal trouble for that? ;P
[11:26:58] <RikusW> but the debugging sw on the PC has proven to be a lot of work...
[11:27:03] <RikusW> no idea :-P
[11:27:17] <jc5134> me neither, I'll just do it and if someone says so i'll take it down, lol
[11:27:44] <jc5134> but it's GPLed.. if someone decides to spread the sources.. I mean, not really in my powerr to stop them, lol
[11:28:01] <RikusW> I've already done automatic dW disabling in my U2S programmer
[11:28:23] <jc5134> the major problem I see with dW is software breakpoints
[11:28:28] <RikusW> used PORT = 0 and then DDR to send open drain data
[11:28:46] <jc5134> from what I read so far you have to reprogram flash to insert breakpoints
[11:28:47] <RikusW> yep, you have to reprogram the entire page
[11:29:01] <jc5134> figured as much...
[11:29:04] <RikusW> and do it using SPM
[11:29:25] <jc5134> it needs to be done from inside the debugged device ?
[11:29:25] <RikusW> jtag is similar, using instructions to manipulate the AVR
[11:29:42] <RikusW> yes via dW/jtag
[11:29:44] <jc5134> AFAIK jtag has like 3 hardware breakpoints or something
[11:29:53] <RikusW> 4 actually
[11:30:01] <RikusW> dW does have 1 breakpoint
[11:30:18] <RikusW> used for run to cursor etc..
[11:30:34] <jc5134> so you insert a breakpoint (reprogram flash) and when you bump into it you reset PC back to the original instruction and reprogram the original one instead of the break instruction, right ?
[11:30:53] <OndraSter_> sounds very complicated :o
[11:30:55] <RikusW> you can load an instruction into the AVR
[11:31:00] <RikusW> and leave the breakpoint
[11:31:06] <jc5134> I see
[11:31:13] <jc5134> so instead of the instructions, theres BREAK
[11:31:15] <RikusW> but not for 4 byte instructions...
[11:31:21] <jc5134> when you bump into it, you tell avr 'you should do this'
[11:31:33] <RikusW> for those there are a whole lot of reflashing...
[11:31:45] <jc5134> hm.. still not as bad as I thought
[11:31:56] <jc5134> I had some sort of apocalyptic scenario in my head
[11:32:06] <jc5134> where you had to actually reorder instructions
[11:32:10] <RikusW> unless you simulate the instruction on the PC and modify AVR state as appropriate..
[11:32:27] <jc5134> I think that can't be done for some things
[11:32:39] <OndraSter_> real time stuff mostly
[11:33:00] <RikusW> I'm considering a Break(u8 number); function and a bitmapped enable/disable map
[11:33:43] <RikusW> say you have a jmp / sts / lds, that can be simulated and written back to AVR
[11:33:56] <RikusW> OCD + realtime == big problems anyways..
[11:34:05] <OndraSter_> tell me about it :D
[11:34:18] <jc5134> just to ease yout mind, on most arms its the same situation anyway
[11:34:19] <RikusW> like soft uart or usb..
[11:34:21] <jc5134> *your
[11:34:36] <jc5134> they have a fixed small number of hardware breakpoints and support for software breakpoints
[11:34:40] <RikusW> best then is to use plain old printf
[11:34:52] <RikusW> or get AVRONE! and do tracing on AVR32
[11:34:57] <jc5134> only difference is that if your program runs in ram (which it usually does) substituting instructions isn't expensive
[11:35:01] <RikusW> but thats $$$$$
[11:35:34] <RikusW> AVR32 can run in ram too, and is more similar to ARM than AVR8
[11:35:48] <jc5134> yep.. afaik it's their arm killer
[11:35:49] <jc5134> runs linux too
[11:35:59] <RikusW> the AP7000
[11:36:03] <RikusW> which is obsolete
[11:36:10] <jc5134> as far as architecture support in open source programs I hear it's pretty bad though
[11:36:14] <RikusW> the others can run Linux but there is no MMU
[11:36:28] <jc5134> damn, I have to go.. I'll be back in a few hours
[11:37:31] <jc5134> thanks for the talk and information :)
[11:37:40] <RikusW> :)
[12:07:31] <sdf8h> what should i use to amplify voltage? how should i choose it?
[12:12:50] <sdf8h> regarding my questions about this http://www.ikalogic.com/8-bit-digital-to-analog-converter-dac/ , if i have 5v in every output, how do i choose my resistors?
[12:14:58] <Malinuss> google r2r ladder
[12:16:34] <sdf8h> i tried
[12:17:06] <sdf8h> i read about this things for my project for a few days. i got the method but i do not know how to choose the resistors
[12:18:54] <OndraSter_> R and 2*R
[12:18:55] <OndraSter_> :)
[12:19:01] <OndraSter_> depends on what output impedance do you want
[12:20:51] <sdf8h> i want to control the speed of a motor of 12v. i need to get from the output of my microcontroller a voltage and then amplifty it to gain 12v. i can't make this two stepts because i do not know what values should be my resistors and how to amplify the voltage
[12:21:35] <OndraSter_> well
[12:21:39] <OndraSter_> you need opamp for sure
[12:21:55] <OndraSter_> so output impedance does not matter unless you are reaching values close to the input impedance of the opamp
[12:22:03] <OndraSter_> so if you use eg 1k-2k you are fine
[12:22:09] <OndraSter_> and then shove it to opamp that amplifies it
[12:23:41] <sdf8h> this way do you think the opAmp from this link will be enough to supply 12v?http://www.ikalogic.com/8-bit-digital-to-analog-converter-dac/
[12:24:13] <OndraSter_> it will swing 0 - 5V
[12:24:25] <OndraSter_> then you opamp it with amplification of 12/5
[12:24:35] <OndraSter_> (that is, if you have rail-to-rail amplifier)
[12:25:01] <sdf8h> i'm lost
[12:25:29] <sdf8h> i don't get it. cand u show me an opamp to see this "then you opamp it with amplification of 12/5" ?
[12:25:39] <OndraSter_> operational amplifier
[12:27:05] <sdf8h> yes, but i do not know hot to choose it
[12:27:10] <OndraSter_> well
[12:27:14] <OndraSter_> what is your power supply?
[12:27:20] <OndraSter_> voltage
[12:27:37] <sdf8h> 5v
[12:27:47] <OndraSter_> and you want to get the 12V from where?
[12:28:19] <sdf8h> heavens... sorry. i do not know how to choose it. i can incease the voltage from the power supply, that is no problem
[12:28:27] <OndraSter_> ugh?
[12:28:33] <OndraSter_> the atmega can not run above 5V power supply
[12:28:41] <OndraSter_> you need another supply to provide 12 - 15V or whatever
[12:28:58] <OndraSter_> but why I am asking - if your power supply is 12V and you want outputs of the amplifier upto 12V, you need to look for rail-to-rail
[12:29:14] <OndraSter_> although you need it even for the low (0 - 0.6V) part
[12:29:55] <OndraSter_> pick any amplifier with rail-to-rail capability
[12:32:21] <sdf8h> ok. i will try and i'll try to figure out hot to connect it
[12:32:57] <OndraSter_> the thing is - what is your motor you are driving?
[12:33:00] <OndraSter_> something high power?
[12:33:38] <RikusW> sdf8h: just don't connect 12V to the AVR, or we will be getting some fries :-P
[12:35:07] <RikusW> sdf8h: 12/5 means amplify by 2.4
[12:35:20] <sdf8h> no, it's just a 12v motor
[12:35:28] <sdf8h> i need to control it's speed
[12:35:46] <sdf8h> i want to give him a voltage between 5v and 12v
[12:36:13] <RikusW> connect the opamp to 12V and make it a 2.4 multiplier
[12:36:30] <RikusW> then use a common base transistor (linear regulator)
[12:36:46] <RikusW> connect 12V to the collector
[12:37:13] <RikusW> the opamp output to the base and the emitter to the motor
[12:37:43] <RikusW> (I'd include a resistor like 470 Ohm between opamp and transistor base)
[12:38:09] <RikusW> it would be much simpler to use PWM...
[12:38:20] <sdf8h> yes, but i can't
[12:38:26] <sdf8h> i need to do it this way
[12:38:35] <sdf8h> that's homework :(
[12:38:44] <sdf8h> regarding the transistor
[12:38:55] <RikusW> 2n3055 would do fine
[12:39:06] <RikusW> or any other high power transistor
[12:39:16] <RikusW> depending on how much current the motor needs
[12:39:17] <sdf8h> if i have 2v on base and 12v in collector, don't the output voltage will be far greater?
[12:39:36] <RikusW> the output will be 1.4V
[12:39:52] <sdf8h> :O
[12:39:54] <RikusW> 2V - Vbe
[12:40:03] <sdf8h> yes
[12:40:25] <sdf8h> and how 1.4? :O
[12:40:37] <RikusW> Vbe is around 0.6V
[12:41:59] <RikusW> err I'm thinking its called common emmiter actually..
[12:42:05] <RikusW> *emitter
[12:42:56] <sdf8h> around what values should i be to get 12v?
[12:43:20] <RikusW> you won't get 12V exactly, more like 11.4V
[12:43:42] <RikusW> unless your psu is 13V
[12:44:03] <sdf8h> no problem, but what values for 11.4?
[12:44:22] <RikusW> 12V on base -> 11.4 or 11.5 on emitter
[12:44:44] <RikusW> you'll have to measure the exact V as it depends on the transistor being used
[12:44:55] <RikusW> usualy 0.5 to 0.7V
[12:45:13] <sdf8h> and on emiter i will still have 12v?
[12:46:28] <RikusW> Ve = Vb - Vbe
[13:00:06] <sdf8h> using this calculator i can't get a voltage around 12v on the emitter http://www.csgnetwork.com/transistorcalc.html
[13:08:14] <sdf8h> using this calculator i can't get a voltage around 12v on the emitter http://www.csgnetwork.com/transistorcalc.html
[13:27:05] <jc5134> back :)
[13:36:40] <kdehl> Man. I just got three deliveries from China that I ordered last weekend.
[13:36:58] <kdehl> And I paid nothing for shipping.
[13:38:36] <kdehl> Two bluetooth modules, a pack of RGB LEDs and a bunch of connectors. Three different deliveries.
[13:38:51] <kdehl> I expected it to take like three weeks.
[13:42:02] <jc5134> cool :) the thing about that chinese stuff is half of it works up to spec
[13:42:25] <jc5134> I actually got a ps/2 to usb converter that only had 2 connectors and wires in it.
[13:42:27] <kdehl> Heh. Yeah, I can imagine.
[13:42:31] <kdehl> ouch.
[13:42:50] <jc5134> the provided driver installed some malware too :D
[13:43:00] <kdehl> wtf
[13:43:02] <kdehl> Oh well.
[13:43:06] <kdehl> It was still cheap!
[13:43:07] <jc5134> I actually tried it on windows just to see what kinda black magic did they pull of :D
[13:43:16] <jc5134> oh yeah, $1
[13:43:25] <jc5134> actually $0.99 lol
[13:43:32] <kdehl> Heh.
[13:43:59] <jc5134> oh and once they sent me a fake SD card
[13:44:20] <jc5134> it reported itself as a 32GB card.. but when you tried to write beyond 512MB.. I/O errors
[13:44:35] <jc5134> turns out there was only a 512MB flash inside it
[13:44:47] <swart> that's one way to keep prices down
[13:44:55] <kdehl> Hah.
[13:45:02] <jc5134> yeah, I reported that bastard to ebay. Didn't go well.
[13:46:10] <kdehl> Um. I bought a bunch of connectors that I plan on using for those cheap Nokia displays... But, man... .5 mm connectors. No way in hell I'm going to be able to solder that.
[13:46:22] <swart> have you guys used seeed.com?
[13:46:37] <jc5134> solder wick? :)
[13:46:52] <kdehl> Aren't there converters of some kind that gives me larger connectors?
[13:47:12] <kdehl> What's that?
[13:47:20] <kdehl> Oh those.
[13:47:30] <kdehl> How's that going to help?
[13:47:44] <jc5134> you can solder pretty tiny stuff with that
[13:47:59] <kdehl> Oh.
[13:48:00] <jc5134> that + some kapton tape is a lifesaver
[13:48:02] <kdehl> Didn't know that.
[13:48:21] <kdehl> I hate soldering. I'm so freaking bad at it.
[13:49:00] <jc5134> http://www.youtube.com/watch?v=auI0tnYzcBc
[13:49:06] <jc5134> not really well visible
[13:49:42] <jc5134> you just put some solder on the pins and don't care if you short them. The solder needs to get under the pins at least.
[13:50:01] <jc5134> then you slide the soldering iron with the wick on it over the pins and clean them off
[13:50:16] <jc5134> the solder between and above the pins gets out and the solder below the pins remains :)
[13:50:20] <jc5134> hence, victory
[13:51:18] <jc5134> http://www.youtube.com/watch?v=EFy2BXXw3hg
[13:51:23] <kdehl> Hm.
[13:51:25] <jc5134> this is how you can solder with kapton tape
[13:51:44] <kdehl> Ah! I love that one.
[13:51:49] <jc5134> its very useful if you need to solder only on a very tiny spot in the middle of lots of solderable spots
[13:51:58] <jc5134> that stuff is magic
[13:52:12] <jc5134> kapton tape and a scalpel and you can do anything ;P
[13:52:26] <jc5134> but unnecessary for tqfp and such, solder wick is good for those
[13:54:32] <kdehl> Heh.
[13:54:40] <kdehl> Yeah, I guess I need some practice.
[13:54:50] <jc5134> equipment is everything I think
[13:55:06] <jc5134> good illumination, magnifying glassess, good tweezers, etc
[13:55:11] <kdehl> Yeah.
[13:55:15] <jc5134> good flux is also good I hear.. although I don't have that, lol
[13:55:27] <jc5134> I have just the regular
[13:59:51] <kdehl> Yeah. Well, I haven't received the displays yet, so I'll put off the soldering for now, thankfully.
[14:00:10] <jc5134> that terrified? ;P
[14:00:34] <kdehl> Very much so.
[14:00:55] <kdehl> I barely managed to solder two PS/2 pins to a breadboard.
[14:01:01] <kdehl> Those are _huge_ compared to these.
[14:01:17] <jc5134> you soldered to a breadbord ?
[14:02:01] <kdehl> No. Well, to pins that I connected to the breadboard. Heh.
[14:02:04] <kdehl> 2.54 mm.
[14:02:07] <jc5134> oh
[14:02:14] <kdehl> http://www.skpang.co.uk/catalog/images/lcd/graphic/lcd128641.jpg
[14:02:22] <jc5134> what kinda soldering iron are you using ?
[14:02:39] <jc5134> oh come on, those are pure joy :)
[14:02:45] <kdehl> Some cheap leaded stuff.
[14:03:08] <kdehl> Those are sizes that I can handle.
[14:03:13] <jc5134> you have to have a fine tip though
[14:03:24] <jc5134> not totally necessary for the solder wick method but it helps
[14:04:11] <kdehl> Yeah.
[14:04:17] <kdehl> Oh well.
[14:04:24] <jc5134> if you're using a transformer soldering iron you could get one of those 'everlasting' tips. They are much finer than regular wire
[14:05:14] <jc5134> but I guess they're only used in the former communist block, lol
[14:05:24] <jc5134> I actually soldered a tqfp with one of those
[14:06:18] <tzanger> my first job in this industry had me hald-soldering 204 pin TQFP devices with a regular old iron
[14:06:26] <tzanger> once you got the technique down it was under 10 mins per chip
[14:07:31] <jc5134> yeah I bet it can be done even without a solder wick with tons of patience :)
[14:07:47] <jc5134> and a hell of a calculated and steady hand
[14:08:31] <tzanger> nah it's not bad at all. you use a "rake" technique
[14:09:36] <jc5134> what's that ?
[14:09:51] <jc5134> you hit the soldering guy with a rake until he gets it right ?
[14:10:23] <tzanger> haha
[14:10:37] <kdehl> http://www.onlinetps.com/shop/index.php?main_page=product_info&products_id=616
[14:10:39] <kdehl> Yes.
[14:10:41] <tzanger> you solder a corner, shorting 2-4pins together
[14:10:47] <tzanger> then you flux the shit out of it
[14:11:03] <tzanger> and you "rake" the soldering iron across the side, starting with the solder blob
[14:11:15] <jc5134> kdehl, with a wick I think you can do that :)
[14:11:26] <tzanger> when you get the angle right (speed is not important) the blob "follows" the iron along and each joint wicks away a perfect amount of solder
[14:11:51] <jc5134> oh
[14:12:00] <kdehl> Well, if i don't have to...
[14:12:05] <jc5134> sounds pretty hard to get right
[14:12:12] <jc5134> cool though
[14:12:13] <tzanger> jc5134: yeah don't learn on an important board
[14:12:23] <jc5134> as always :)
[14:12:24] <tzanger> but if you've got a ocuple scrap boards it's all you need to get it
[14:12:34] <tzanger> light touch and right angle is what it takes
[14:12:39] <tzanger> too hard and you will bend pins which is bad
[14:12:49] <jc5134> unfortunately now I'm doing a LiFeYPO4 manager and I have to learn on an important battery :(
[14:12:52] <tzanger> but it's relatively easy to clean up mistakes with the solder wick
[14:13:03] <tzanger> and flux, flux, flux
[14:13:10] <tzanger> that's the key, it's magic
[14:13:35] <jc5134> :)
[14:20:25] <kdehl> http://elektronicaonderdelen.eu/productAfbeeldingen/1488.jpg
[14:20:28] <kdehl> This.
[14:20:30] <kdehl> I need this.
[14:21:13] <jc5134> and I need that freaking battery manager with a thursday deadline to finish itself, lol
[14:38:57] <jc5134> so looks like my program hangs while clearing BSS
[14:39:35] <jc5134> but the tui gdb interface is not bad :)
[14:41:27] <jc5134> now why would a program hang while clearing a 6 byte bss, lol
[14:44:00] <jc5134> lol !!!
[14:44:20] <jc5134> turns out with -O0 and a zero sized BSS, avr-gcc produces code that hangs itself :D
[14:44:36] <jc5134> just adding 'uint8_t bss_bug_fix = 0;' to top of my file fixed this
[15:11:46] <TFD> Hey guys, about to build my first serial ISP... is it REALLY as simple as a few resistor and db9 connector?
[16:13:30] <schnuws> hello! anyone who can help me with an usbasp?
[16:13:58] <Tom_itx> depends
[16:14:23] <schnuws> well, Im trying to burn a hex to an atmega8, but it fails
[16:14:56] <schnuws> and I have read that you need to use a jumper to program at a lower speed, or smth.
[16:15:08] <schnuws> and Im having trouble finding out how to do that
[16:15:27] <Tom_itx> where's the page that covers programming with the usbasp?
[16:15:32] <Tom_itx> it should tell you
[16:16:05] <schnuws> I know that I just need to solder two joints together, but I cant find which joints to solder
[16:16:11] <schnuws> look at the img
[16:16:11] <schnuws> http://i00.i.aliimg.com/img/pb/838/542/533/533542838_090.jpg
[16:16:42] <Tom_itx> can't help you with that
[16:16:51] <schnuws> ok, thx anyway
[16:19:22] <Tom_itx> http://cq.cx/ladder.pl
[16:19:26] <Tom_itx> rue
[16:20:06] <tzanger> Tom_itx: how does your high voltage serial programmer function, you aren't controlling SCI as far as I can see
[16:20:35] <tzanger> it looks like you put 12V on RESET# but that's it
[16:22:59] <Tom_itx> on the attiny10 one?
[16:23:05] <Tom_itx> just hold reset high yes
[16:23:30] <Tom_itx> it takes a different protocol for the others though
[16:23:37] <Tom_itx> we tried it
[16:24:30] <Tom_itx> iirc it switches between 12v and gnd
[16:24:53] <dpy> hi guys
[16:25:57] <dpy> does anyone know a small bit bang library that can use any pin on an attiny to transmit (one way) bytes (for debugging purposes)?
[16:26:51] <OndraSter_> software serial
[16:27:59] <dpy> I only need one way and small
[16:28:18] <dpy> software serial sounds large, two way
[16:28:37] <dpy> it's for debugging... preferably one wire
[16:29:30] <OndraSter_> well
[16:29:37] <OndraSter_> delete the rx code :P
[16:37:13] <dpy> "high speed tx-only software uart serial attiny 45 c" this sounds promising
[16:40:33] <tzanger> Tom_itx: that's what I am saying
[16:40:59] <tzanger> Tom_itx: I built my own "switch 12V to reset#" and tried programming with a std programmer... it's an entirely different protocol
[16:41:17] <tzanger> or are you saying that your programmer won't "unfuck" tinyavrs with the resetdsbl fuse bit blown?
[17:07:12] <Tom_itx> tzanger, only the attiny 4,5,9 and 10
[17:07:38] <tzanger> Tom_itx: aha
[17:07:57] <tzanger> Tom_itx: that's the missing nugget. I was trying to "fix" a 13a. I gotta build an entire damn programmer for that
[17:07:58] <Malinuss> anyone every played around with V-usb, and make a HID mouse/keyboard that way?
[17:07:59] <Tom_itx> that's what i made it for
[17:08:09] <Tom_itx> sry
[17:08:21] <tzanger> no worries, I was wondering what you knew that I didn't. :-)
[17:08:41] <Tom_itx> the description says that
[17:08:56] <Tom_itx> no it requires a different protocol than the regular ISP
[17:08:57] <Malinuss> tzanger, just wondering, how did you "break" your 13a? Crystal fuses?
[17:09:17] <Tom_itx> he apparently used the reset pin as an io
[17:09:23] <Malinuss> oh
[17:09:24] <tzanger> Tom_itx: yes, it does. I completely overlooked that
[17:09:26] <Tom_itx> once you do, you gotta hv program it
[17:09:28] <Tom_itx> to recover
[17:09:29] <Malinuss> yep
[17:09:46] <Malinuss> as well as if you set it to external crystal, without having a real external crystal
[17:09:53] <tzanger> Malinuss: yeah I blew the "use RESET# as GPIO" fuse, not remembering that that screwed you out of standard SPI programming if you did so
[17:10:10] <Malinuss> yep ISP needs reset
[17:10:58] <Tom_itx> i did it because those chips have so few io as it is
[17:13:39] <Malinuss> Well there are more then enough cheap alternatives if you actually ned more IO
[21:15:47] <metalliqaz> anyone here know of a good interrupt library to use for megaAVR?
[21:16:07] <metalliqaz> i'm sick of trying to get the awful, broken ASF to work
[21:16:36] <Malinuss> metalliqaz, "interrupt library"? how would that even work? You just set up a interrupt and bam - you have a interrupt..
[21:16:53] <metalliqaz> ISR(signal)
[21:16:57] <metalliqaz> that comes from interrupt.h
[21:17:23] <Malinuss> the interrupt vecotrs? What about them?
[21:17:40] <Malinuss> still can't see what a "interrupt library" would do...
[21:17:48] <metalliqaz> okay
[21:17:51] <metalliqaz> anyone else?
[21:18:07] <Tom_itx> me either really
[21:18:10] <metalliqaz> okay
[21:18:11] <Malinuss> metalliqaz, I mean it, what do you want to do?
[21:18:25] <Tom_itx> interrupts are pretty straightforward
[21:18:26] <metalliqaz> setup an interrupt on TC1
[21:18:35] <Tom_itx> what you do inside can vary somewhat
[21:18:47] <metalliqaz> yes, thanks i know what interrupts are
[21:18:50] <Malinuss> metalliqaz, then set it up... you don't need a library to set it up, just flip that flag
[21:18:55] <Tom_itx> that's not so hard
[21:19:11] <metalliqaz> stop it
[21:19:22] <Tom_itx> stop what?
[21:19:38] <metalliqaz> being typical internet toughguys
[21:19:42] <Tom_itx> CLI()
[21:19:44] <Tom_itx> like that?
[21:19:51] <Tom_itx> no just honest
[21:19:58] <metalliqaz> okay first of all that doesnt set up an ISR
[21:20:03] <Tom_itx> we can help you set it up
[21:20:07] <metalliqaz> second that function is defined in interrupt.h
[21:20:11] <Tom_itx> you said stop it !
[21:20:13] <Tom_itx> so i did
[21:20:34] <metalliqaz> what a dick
[21:20:43] <Tom_itx> foul mood?
[21:20:43] <metalliqaz> do you use ASF or not?
[21:20:45] <Tom_itx> no
[21:20:48] <metalliqaz> okay
[21:20:50] <metalliqaz> fine
[21:21:01] <Tom_itx> what's that got to do with interrupts?
[21:21:02] <metalliqaz> so where do you get your defines for all the interrupts?
[21:21:10] <Tom_itx> from the .h file
[21:21:13] <Tom_itx> for each part
[21:21:20] <Tom_itx> which part do you have?
[21:22:14] <Tom_itx> i presume you're using windows
[21:22:30] <Tom_itx> since you made reference to studio
[21:22:59] <Tom_itx> bye
[21:23:10] <Tom_itx> he'll be back
[21:23:21] <crib> lol
[21:23:43] <Malinuss> oh well... did sound like a dick or was he just touchy?
[21:23:50] <Malinuss> *did I
[21:23:52] <Tom_itx> it's been about a week and he still hasn't figured em out
[21:24:02] <Tom_itx> pms
[21:24:04] <Tom_itx> i think
[21:24:21] <Malinuss> Tom_itx, has he been coming here a week asking about interrupts?
[21:24:33] <Tom_itx> this isn't the first time
[21:24:40] <dioxide> Malinuss: i saw nobody being a dick but him
[21:24:57] <Malinuss> k. just making sure
[21:25:06] <Tom_itx> yeah you dick!
[21:25:08] <Tom_itx> :)
[21:25:10] <Malinuss> :(
[21:25:51] <Tom_itx> he just has no sense of humor
[21:26:01] <Tom_itx> you lose that and you may as well give up
[21:27:06] <Tom_itx> i'm not sure what an interrupt lib would look like anyway
[21:27:31] <dioxide> what is asf
[21:27:46] <Tom_itx> atmel studio something
[21:27:55] <Tom_itx> something new in 6 i think
[21:27:56] <crib> http://www.atmel.com/tools/AVRSOFTWAREFRAMEWORK.aspx
[21:28:11] <Tom_itx> framework
[21:28:25] <dioxide> oh
[21:28:33] <dioxide> yea definitely not required.
[21:28:41] <Tom_itx> too sluggish for me to like
[21:29:14] <Malinuss> I didn't even know something like that exsisted
[21:29:23] <dioxide> obviously i didnt either
[21:29:24] <Malinuss> so it's kinda like arduino by atmel?
[21:29:37] <Tom_itx> unless he was trying to simulate something.. but i don't think you can sim interrupts anyway
[21:30:25] <Tom_itx> i just think his lack of knowledge has him frustrated
[21:30:43] <crib> ack
[21:30:45] <dioxide> Malinuss: looks a bit lower level than arduino.
[21:30:53] <Malinuss> Tom_itx, I'm pretty sure the new simulators actually allow you two write "scripts", that allow external compnets simulations. Like "after 5sec, apply high to pin x"
[21:31:04] <Tom_itx> hmm
[21:31:07] <Malinuss> never played a lot with it, just did some reading though
[21:31:08] <Tom_itx> news to me
[21:31:28] <Tom_itx> adc is another you can't really simulate
[21:31:47] <Tom_itx> i don't use 6 though
[21:31:52] <dioxide> i cant tell if asf is for use specifically with the supported devboards, or also for general use
[21:32:05] <Tom_itx> you can make your own
[21:32:10] <Tom_itx> acording to dean
[21:32:24] <Tom_itx> not sure how that works... never used it
[21:32:24] <Malinuss> " megaAVR, AVR XMEGA, AVR UC3 and SAM"
[21:32:25] <dioxide> well either way im not going to use it, not anytime soon anyway.
[21:33:03] <tinygear> Hi, I am using an atmega168 for serial comm. but am experiencing problems. I am using the internal clock (8 MHz, no ckdiv8), but data is not being transferred properly. I have tried various baud rates and their associated ubbr values, but get garbled data. I can transmit data just fine, but receiving it gets messed up. Any ideas?
[21:33:36] <Malinuss> seriously if you already know what you are doing, why would you add another layer on uC programming? I mean, I understand with things like the USB peripheral, you might not want to write your own stacks, but most things are pretty simple
[21:34:01] <dioxide> abstraction is nice, but i wouldnt want it in the embedded world
[21:34:10] <dioxide> seems counterproductive
[21:34:17] <Malinuss> yeah and confusing
[21:34:36] <Malinuss> also I can't see how it won't be a copy of arduino anyway
[21:34:53] <Tom_itx> tinygear are you using interrupts for it?
[21:35:09] <tinygear> Tom_itx: I don't believe so.
[21:36:06] <Malinuss> tinygear, serial comm? Like you are trying yo do atmega168->serial on a pc? Propably not the issue since you say you get no data at all, but I heard that you need a crystal, otherwise it will be way to unprecise
[21:36:06] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/avr/rs232_rx_test/
[21:36:12] <Tom_itx> have a peek at that
[21:36:35] <dioxide> he said garbled data
[21:37:12] <Tom_itx> he should be using interupts for it probably
[21:37:23] <Malinuss> didn't know what that meant.. looked it up now.. well that *could* sound like a timing issue
[21:37:28] <Tom_itx> tinygear, also: http://www.wormfood.net/avrbaudcalc.php
[21:37:41] <Malinuss> propably not alone by the lack of crystal though
[21:38:08] <tinygear> Tom_itx: Thanks! I've seen both actually, and my code is adapted from yours. So thanks again :)
[21:38:32] <tinygear> I'll post my code here for you guys, one sec.
[21:39:23] <tinygear> Btw, why would using interrupts change anything? And yes, currently I am sending/receiving data from my m168 to max232. Sending works fine, receiving not so much.
[21:40:00] <dioxide> lets you grab the bits as they arrive, so they dont disappear on you
[21:40:51] <tinygear> I don't think that's the problem.
[21:40:56] <dioxide> if youre continually polling, thatd be as good too
[21:41:15] <dioxide> but if youre off thinking, doing other calcs etc, could run into issues
[21:41:56] <tinygear> http://pastebin.com/xCCBwdbx Take a look
[21:42:03] <tinygear> I am continually polling afaik
[21:42:13] <Tom_itx> if the bits are off it could look like garbage
[21:42:28] <Tom_itx> 8 n 1 on both sides?
[21:42:49] <tinygear> Not sure what you mean exactly.
[21:42:52] <tinygear> By both sides
[21:43:06] <Tom_itx> what are you using on the pc side?
[21:43:13] <Tom_itx> is it set up the same?
[21:43:46] <tinygear> Oh right, yes it is.
[21:44:56] <tinygear> Just confirmed that it is the same. I am expecting data to be echoed, but whenever I type, I get stuff like this "ÿÿþÿÿàÿÿÿÞÿÿÿþÿÿÿþÿÿÿàÐÿÿïþÿþþÿþÿÿÿÿÿÿüÿüüþÿÿÿîÿßÿÿÿÿÿÿÿßÿÿþÿÿþþþþþÿÿÿÿÿÿÿÿþÿÿÿþÿþÿÿüÿÿÏÿîÿÿÿÿÿÿÿ¿ÿþþÿÿÿÿüÿÿþÞ"
[21:47:07] <Tom_itx> it's not being inverted on one end is it?
[21:47:35] <Tom_itx> are you using a max232?
[21:47:51] <tinygear> Yes I am.
[21:48:19] <tinygear> When I change the code to keep sending the "receievedbyte", it works fine. So I know I have the wiring correct.
[21:50:55] <tinygear> Ok, something else is the problem. I even switched to an external 16 Mhz crystal
[21:51:01] <tinygear> And I get the same result
[21:51:08] <tinygear> So it has to be something else causing it.
[21:51:33] <Tom_itx> add a slight delay between the 'while'
[21:52:13] <tinygear> Between the two 'while's you mean?
[21:52:20] <Tom_itx> try it
[21:53:28] <timemage> i had it in my head that to use the usart the tx would have to be set in the ddr. i take it that isn't the case.
[21:54:13] <Tom_itx> i haven't messed with uart enough to know for sure but i think it's set. you can set the ddr if you want
[21:54:38] <tinygear> I think there is something else more fundamental going wrong.
[21:54:44] <tinygear> Set the ddr to what?
[21:54:58] <Tom_itx> 1 for output
[21:55:03] <timemage> i just noticed that i put it in some old code of mine for a 2313. but it seem tho be absent from tinygear's code. but then, i can't rationalize why he'd be seeing anything at all, garbled or no if that was the problem.
[21:56:22] <tinygear> Ok, there's something really weird going on with my code
[21:56:33] <tinygear> Or something, I'm going to try to figure it out.
[21:56:42] <tinygear> I'm suspecting the max232
[21:57:01] <timemage> tinygear, just for the hell of it, set the direction register for your tx pin and see what happens.
[21:57:12] <tinygear> to 1?
[21:57:18] <timemage> tinygear, yup.
[21:57:40] <tinygear> ok
[21:59:32] <timemage> tinygear, actually, i what found isn't for the tx pin. i was controlling a max483 for half duplex. oh well, what little reasoning i had behind that idea.
[22:00:18] <tinygear> hm ok
[22:08:48] <tinygear> Tom_itx: Weird, your example (http://tom-itx.dyndns.org:81/~webpage/how_to/atmega168/mega168_rs232_index.php) is working perfectly. So there must be soemthing wrong with my code.
[22:10:52] <Tom_itx> that's tx only though
[22:12:49] <Tom_sbc> friggin netsplits
[22:15:58] <Tom_itx> i'd try setting up the rx interrupt
[22:17:47] <tinygear> Ok it's finally working!
[22:17:56] <tinygear> I think the mistake was very clear
[22:18:06] <Tom_itx> what was it?
[22:18:17] <tinygear> If you look at my code again, I set UCSr0B twice
[22:18:36] <tinygear> once for TX, and once for RX, but when I did that, it overrided the other statement
[22:19:20] <Tom_itx> i closed it already
[22:20:03] <tinygear> http://pastebin.com/xCCBwdbx
[22:20:13] <tinygear> But now it works great with the internal oscillator as well
[22:20:36] <tinygear> Wow, I just wasted so much time on such a simple thing, can't believe it. Even worse, I wasted all of your valuable time.
[22:20:53] <Tom_itx> that's how it goes
[22:23:58] <timemage> tinygear, so, then maybe the tx line was floating an being influenced by the rx line?
[22:24:38] <tinygear> Perhaps, not exactly sure what was going on
[22:24:48] <timemage> tinygear, were you only seeing junk come back when you sent to it?
[22:25:02] <Tom_itx> all i get is: Unknown Paste ID!
[22:25:09] <tinygear> I was starting to see junk without even pressing anything.
[22:25:16] <timemage> tinygear, oh.
[22:25:31] <tinygear> Tom_itx: Oh, probably expired. Anyway, doesn't matter much. If you want to see it, I'll paste it again.
[22:25:45] <tinygear> timemage: So you're probably right, was floating.
[22:25:51] <Tom_itx> naw
[22:25:54] <tinygear> Not sure though, I'm totally a newb
[22:26:22] <Tom_itx> i'd still get the interrupt working. more useful in 'real' code
[22:30:22] <tinygear> Tom_itx: I will try. I need to whip up a protoype for a project real fast.
[22:30:56] <tinygear> I'm trying very hard for the past several months to steer away from arduinos, so learning how to use interrupts effectively is definitely a top priority.
[22:35:55] <Tom_itx> !thislog
[22:36:12] <Tom_itx> stupid bot
[22:36:13] <Tom_itx> !thislog
[22:36:14] <tobbor> This one: http://rueshouse.dyndns.org:82/~ircjunk/irclogs/html/%23avr-2013-03-26.html
[23:21:39] <TFD> 3
[23:29:04] <shorted_neuron> is a pretty good number
[23:30:08] <shorted_neuron> anyone around interested in looking at http://pastebin.com/y0qFtL4m ? this is Timer4 issue on atmega32u4. I'm trying to generate a rough clock output for my ADC