#avr | Logs for 2014-03-23

Back
[00:59:53] <rue_more> yea
[01:00:10] <rue_more> but you would have to write the drivers, see, with mine, no drivers required
[01:31:14] <rue_shop2> hahah I took a uint16, and loaded it with 1<<16
[01:35:24] <rue_shop2> then I took a number from the range 256 -> 65535 and passed it to a function that took an unsigned char...
[02:01:01] <rue_shop2> those ADC hold static value just fine
[02:01:33] <rue_shop2> the output is centered around 2.5V, goes from about 1.2V to about 3.7V
[02:02:31] <rue_shop2> I have some rail to rail amps I could use to stretch it out
[02:09:32] <rue_shop2> too bad, even o/c to 20mhz I dont really have enough speed to use the 2 channels to do vector graphics on my scope...
[02:09:48] <rue_shop2> nothing much worth it anyhow
[02:12:40] <rue_shop2> hmm, might be able to take some of the roms I have and make one neato function genorator tho
[02:13:13] * rue_shop2 tires to work out what to do with 10 PT8211 (TDA1311)
[03:15:57] <rue_more> hmm required gain would be about...
[03:16:46] <rue_more> 2, it would be 2
[03:23:13] <rue_more> centered around 2.5V, gain of 2, gee, I can do that circuit in my head
[03:25:46] <Fleck> morning rue_more! :)
[03:27:20] <rue_more> its not morning
[03:27:27] <rue_more> ...here
[03:27:54] <Fleck> http://thinkmoult.com/ugt.html
[03:29:59] <megal0maniac_afk> Fleck: I like that!
[03:30:35] <Fleck> yep, me too! :)
[03:31:25] <rue_more> dunno if I accept this UGT thing...
[03:32:01] <Fleck> Resistance is futile. Your ass will be laminated :D
[03:42:20] <megal0maniac_afk> I don't see.. it doesn't even.. nevermind.
[03:47:59] <Fleck> ;p
[05:07:44] <rue_more> join #debian
[05:07:47] <rue_more> sigh
[05:08:14] <rue_more> WHERE DID _ANY_ OF THE MARKUP GO!?
[05:15:51] <megal0maniac_afk> rue_more: :P
[07:50:05] <antto> was there something about pins being associated with the timers on atmegas?
[07:50:13] <megal0maniac_afk> Yes
[07:50:30] <antto> what kind of names do they have?
[07:51:34] <antto> OC3A OC3B OC3C?
[08:05:18] <megal0maniac_afk> antto: That's some of them. Read the timer section of the datasheet
[08:32:11] <antto> okay, so it seems i cannot use timer1 because there's other stuff connected on those pins
[08:32:47] <antto> (OC1A/B/C)
[08:34:10] <antto> on the other hand, i know from the datasheet that there are timers 0 to 5 available, but i don't see OCnA/B/C pins for timer 4 and 5 (or i'm blind)
[09:25:09] <phinxy> I want a function to run each second but i cant use interrupts. Should i keep a variable increasing on each clock tick..? 16mhz
[09:29:46] <Tom_itx> why can't you use interrupts?
[09:29:53] <Lambda_Aurigae> will there be anything else going on at the same time?
[09:32:41] <phinxy> Tom_itx, If i have an interrupt my display seems to crash. it uses interrupts since it doesnt work without sei(). '
[09:33:40] <phinxy> Lambda_Aurigae, Sure, checks for button presses and some display updates
[09:34:26] <Lambda_Aurigae> I would figure out what's going on with the display and work around it with a timer interrupt myself...but,,,
[09:34:47] <Lambda_Aurigae> you can continuously increase a variable in the main loop and when it reaches a certain number
[09:34:52] <Lambda_Aurigae> call the routine.
[09:35:06] <Lambda_Aurigae> you will have to play with that number to be reached to get a 1 second delay...
[09:35:27] <Lambda_Aurigae> and it won't be very accurate overall because other things happening will slow it down.
[09:35:56] <Tom_itx> and it will change as your main loop changes
[09:36:10] <Lambda_Aurigae> yup.
[09:36:15] <Lambda_Aurigae> not accurate at all really.
[09:36:44] <Tom_itx> not unless you cound the asm cycles
[09:37:56] <Lambda_Aurigae> and you have to take into account the time of interrupt routines too.
[09:38:07] <Lambda_Aurigae> because they will slow down the main loop.
[09:38:13] <Tom_itx> he said he wasn't using interrupts
[09:38:33] <Lambda_Aurigae> he said his display uses interrupts.
[09:44:09] <antto> dafuq
[09:44:28] <antto> i had CSnX all zero.. which means "no clock"
[09:45:04] * antto <- epic facepalm
[09:45:56] <phinxy> Have anyone else had this problem with interrupts coming in between i2c data transfer?
[09:47:49] <Lambda_Aurigae> I'm sure they have.
[09:57:06] <phinxy> can i supply the lcd with its own power supply or will this burn my programmer?
[09:58:01] <Lambda_Aurigae> it is possible to do, yes
[09:59:49] <phinxy> Do i need special hardware to prevent too much current into the other stuffs?
[10:01:06] <Lambda_Aurigae> well, without knowing ANYTHING about your circuit, I have no way of knowing what you would need....that being said, you can probably just separate the VCC connections and supply power to the LCD separately from the rest of the circuit.
[10:01:29] <phinxy> i figured it isnt a problem with my interrupts interfering with i2c but prob too little power from my USB
[10:02:13] <phinxy> Lambda_Aurigae, ok. ill try it out. yolo
[10:04:57] <phinxy> Lambda_Aurigae, ok. so my micro is powered by my programmers supply. my display got power from another supply. ground is shared between theese
[10:05:24] <phinxy> it lights up and it printed half the screen. then just stopped
[10:08:01] <Tom_itx> use a common GND though
[10:09:41] <Lambda_Aurigae> much more stable than an uncommon ground.
[10:17:08] <megal0maniac_afk> phinxy: Ideally, your programmer shouldn't provide power at all. I only use programmer power if my chip isn't connected to anything else
[10:17:38] <phinxy> megal0maniac_afk, yeah im doing that right now: making everything powered by the other supply
[11:39:23] <phinxy> Why isnt any attiny under supported parts? can only see atmegas
[11:39:31] <phinxy> atmel studio - device selection
[11:40:00] <Lambda_Aurigae> does it have a dropdown for groups?
[11:40:19] <Lambda_Aurigae> like, attiny, atmega, atxmega, arm, etc
[11:40:58] <Lambda_Aurigae> I would check, but, alas, atmel studio won't run on my computer.
[11:41:41] <Tom_itx> supported parts for what?
[11:42:36] <phinxy> i can pick unsupported parts and select it there. its under project properties
[11:43:16] <phinxy> Lambda_Aurigae, yeah i have the option to pick attiny group, that what ive done
[11:43:28] <Lambda_Aurigae> perhaps some setup on your project requires atmega?
[11:44:11] <phinxy> Lambda_Aurigae, so the code affects what in this list? cause im trying to compile for this attiny from an mega
[11:44:39] <Lambda_Aurigae> dunno...as I said, atmel studio won't run on my computer so I don't use it.
[11:44:45] <phinxy> having some issues compiling tough, on the website it says its supporting the tinys
[11:46:09] <Lambda_Aurigae> I doubt the code makes a difference but something in the project properties could.
[11:46:16] <Lambda_Aurigae> I know it does on mplabx sometimes.
[11:47:29] <phinxy> maybe the BOARD=STK600_MEGA
[11:47:35] <phinxy> symbol?
[11:47:39] <Lambda_Aurigae> ummm...possibly.
[13:50:35] <phinxy> Trying to get timer1 (16bit) to toggle led every second, 16mhz/1024/15624 but it happens every 5th or so second
[13:52:41] <Lambda_Aurigae> so cut the timing down some.
[13:53:33] <Tom_itx> or check the ckdkv8 fuse
[13:55:59] <Lambda_Aurigae> and wouldn't you want to divide by 15625, not 15624?
[13:57:28] <phinxy> Lambda, i think it takes one cycle to set the flag in ctc mode
[13:58:22] <Lambda_Aurigae> ahh, true.
[14:19:18] <phinxy> Trying to check if my clock actually is 16mhz is this code correct? http://pastebin.com/P42sJjJ1
[14:20:01] <Lambda_Aurigae> I don't see how it would compile as is, but,,,it all looks like code to me.
[14:20:20] <Lambda_Aurigae> no includes for avr/io.h or anything...and no main.
[14:20:38] <Lambda_Aurigae> or is that ardweeny?
[14:21:23] <phinxy> nah its just a party of my main.c
[14:21:36] <phinxy> can you read clock speed with the programmer?
[14:21:48] <Lambda_Aurigae> not that I know of.
[14:21:57] <Lambda_Aurigae> you don't know what your clock is set at?
[14:22:12] <Lambda_Aurigae> do you have a crystal attached and the fuses set to use external high speed crystal?
[14:22:31] <phinxy> I am. last time i set it up i got correct blinking led
[14:22:51] <phinxy> altough i used timers then
[14:22:59] <phinxy> cant seem to get it right this time
[14:26:48] <phinxy> ill try the internal clock and see it that helps
[14:31:24] <phinxy> internal oscillator running and i get the same slow led blinking so nothing wrong with the crystal =)
[14:31:58] <Tom_itx> did you define F_CPU
[14:32:01] <phinxy> yea
[14:32:09] <phinxy> and /8 fuse isnt set
[14:32:31] <Tom_itx> you'll find something very silly
[14:32:38] <phinxy> Probably
[14:34:05] <Lambda_Aurigae> if it's the same speed then you likely never switched oscillators.
[14:34:15] <Lambda_Aurigae> unless your internal runs at 16MHz as well.
[14:41:34] <phinxy> The problem was that you need every setting set at one time in TCCR1B register
[14:41:51] <phinxy> you cant set one bit first and two bits later
[14:42:20] <Lambda_Aurigae> now, ya see, there was nothing about that in the code you posted earlier.
[14:42:42] <Lambda_Aurigae> but, lesson learned, and you won't do it again.
[14:43:07] <phinxy> :D
[23:19:07] <hetii> Hi :)
[23:20:02] <hetii> Q: for avr programming, when i want transfer some byte, the logic 1 means low ?
[23:20:49] <Casper> 1 is high
[23:21:59] <hetii> hm
[23:24:06] <Casper> rs232 use inverted signaling, flash ereased state is 0xFF but it still program normally
[23:28:26] <hetii> I talk about SPI communication and lock polarity and phase aspect. So how it works, when i need flash some avr. is it like the default state of SCK and MISO line are a high impedance and then i pulse it with high logic or with low (to ground) ?
[23:28:39] <hetii> s/lock/clock
[23:30:37] <Casper> you need a programmer and a software
[23:30:42] <Casper> it have a protocol
[23:30:47] <Casper> and it also need the reset
[23:30:52] <hetii> :/
[23:30:53] <Casper> mosi, miso, sck and reset
[23:31:00] <Valen> read the programming documentation
[23:31:12] <Casper> the programmer can be very simple if you have a parallel port
[23:31:12] <Valen> or as i would strongly suggest, get a programmer ;->
[23:31:28] <Valen> this is a problem other people have solved ;->
[23:31:32] <Casper> if not, then you can make one with a serial port and a few parts
[23:31:44] <Casper> else get an usb one, I suggest tom's programmer
[23:32:10] <hetii> Its not a point to get some programmer i try build my own.
[23:34:08] <Casper> ok
[23:34:40] <Casper> hardware AND software? or just hardware?
[23:37:10] <hetii> both :)
[23:39:32] <Casper> you're looking at an huge job
[23:45:38] <hetii> both :)
[23:45:44] <hetii> sorry :)
[23:51:11] <Casper> will be hard
[23:51:19] <Casper> most gave up on the software part
[23:51:23] <Casper> they just use avrdude