#avr | Logs for 2016-05-30

Back
[02:38:48] <lowin> What's the correct value for cksel3-1 when using 12mhz crystal?
[03:40:49] <Jan-> hihi avr people
[03:40:56] <Jan-> crikey
[03:40:58] <Jan-> topic's a bit harsh
[07:08:41] <eszett> hi
[07:08:47] <eszett> I have a question
[07:09:08] <Lambda_Aurigae> so,
[07:09:09] <eszett> what does "strobing" (a matrix) mean? output high or output low?
[07:09:10] <Lambda_Aurigae> ask it.
[07:09:19] <Lambda_Aurigae> depends on the matrix
[07:09:25] <Lambda_Aurigae> how it's constructed
[07:09:42] <eszett> well.. i have my rows output low
[07:09:55] <eszett> and the cols input, with pull-ups
[07:10:10] <Lambda_Aurigae> you basically cycle through the rows one at a time while setting the columns to light up individual lights.
[07:10:11] <eszett> And I have problems understanding the term "strobing"
[07:10:25] <Lambda_Aurigae> you can't turn them all on at once.
[07:10:34] <eszett> Its a keyboard matrix, and when a switch is pressed it lets current through
[07:10:47] <Lambda_Aurigae> if you turn on two columns and three rows at one time you get 6 turned on.
[07:10:51] <Lambda_Aurigae> oh.
[07:10:54] <Lambda_Aurigae> same thing.
[07:11:03] <Lambda_Aurigae> you turn on one row at a time, read the columns.
[07:11:07] <Lambda_Aurigae> and cycle through the rows.
[07:11:08] <Lambda_Aurigae> or
[07:11:14] <Lambda_Aurigae> turn on one column at a time and read the rows.
[07:11:18] <eszett> Lambda: ok.. and when i have the rows output low, then i have to connect the diodes with the cathode side to the rows, is thatcorrecT?
[07:11:46] <eszett> wait.. i post a PDF of my schematics
[07:11:54] <eszett> http://84.59.114.13/gemini.pdf
[07:12:20] <Lambda_Aurigae> why the diodes anyhow?
[07:12:57] <eszett> they are necessary to prevent an effect called "ghosting"
[07:13:14] <eszett> abit hard to understand, i just know i have to put them in
[07:13:44] <eszett> The term "strobe" is somehow misleading isnt it.
[07:13:48] <Lambda_Aurigae> the cathode points at the (-) and Anode points at (+) point in the circuit.
[07:13:55] <Lambda_Aurigae> no..it is not misleading at all.
[07:14:23] <eszett> when i have the rows output low, then the diodes are in the correct orientation in this schematics right?
[07:15:05] <Lambda_Aurigae> so you would keep d0, d1, d2, d3, d5 high until you want to read a particular row.
[07:15:17] <Lambda_Aurigae> turn d0 to low, read the columns
[07:15:29] <Lambda_Aurigae> turn d0 to high and d1 to low, read the columns
[07:15:31] <Lambda_Aurigae> and so on.
[07:15:39] <eszett> ah... right.
[07:15:42] <Lambda_Aurigae> they appear to be.
[07:15:44] <kre10s_> current flows only from anode to cathode. the text is correct the little green arrow is not.
[07:16:03] <Lambda_Aurigae> the arrow points at the (-)
[07:16:28] <eszett> key110s ah you are refferring to that picture above. yes i imported it from google. seems to be wrong, and that confused me earlier
[07:16:32] <kre10s_> the green arrow points to the + on my screen.
[07:16:47] <eszett> I guess it wants to display the "true" physical direction of current
[07:17:11] <eszett> which is misleading and confusing for engineers ..
[07:18:53] <eszett> my question was more about the schematics and the orientation of the diodes in it. And how i have to write the C code to fit this configuration/orientiation
[07:19:40] <eszett> I think the term "strobing" is pretty bad, since it doesnt tell if a persons wants to say "output high" or "output low" with it
[07:20:19] <kre10s_> the symbol you have for your leds is a shitty symbol. You should use something that indicates polarity for components that have polarity.
[07:20:49] <eszett> the symbol is the official one from the library of KiCAD..
[07:21:03] <eszett> what would be a better one?
[07:22:06] <eszett> the red circles connected to the diodes are switches =)
[07:22:42] <kre10s_> :P The official libraries in KiCAD are shit. I would never trust a library I didn't write myself. There are no guarantees that they are correct. You will save yourself allot of anguish if you delete them and start from scratch.
[07:22:54] <eszett> ugh..
[07:23:18] <eszett> Ye pretty much components=symbols I do edit or draw by myself
[07:23:24] <kre10s_> Oh. they are buttons? see i thought they were supposed to be LEDs.
[07:23:30] <eszett> hrhr
[07:24:17] <kre10s_> So you want to test the button state. In that case all the diodes are reversed. you will not be able to read the state of the keyboard.
[07:25:39] <eszett> yes..
[07:25:59] <eszett> are they correct if i strobe the rows with output low?
[07:27:11] <eszett> https://paste.ee/p/Qy1aB
[07:27:18] <eszett> this is part of the code i have prepared
[07:28:04] <kre10s_> hmm... If you set a single strobe line low and use a pullup on all the read rows you would know which buttons in that row are pressed.
[07:29:13] <eszett> ye. the actualy cycling of the strobing is done automatically
[07:29:46] <eszett> I dont write the code from scratch but use some configuration files and edit them
[07:37:09] <kre10s_> I would have done this without diodes. To use it I would have. 1) set all the strobes low 2) set all the columns low briefly, then High-z input 3) Set the desired strobe high. 4) read in all the columns
[07:37:41] <eszett> kre10 let me think about it
[07:38:24] <eszett> kre10 to strob the rows with output high would be more intuitive logic
[07:39:02] <eszett> but to leave out diodes would effect ghosting https://deskthority.net/wiki/Rollover,_blocking_and_ghosting
[07:45:55] <kre10s_> I see what you mean.
[07:52:45] <lowin> Hello. Is there something wrong with my code? I've written a debugging routine to send some data when problem occurs. But it looks like it keeps getting interrupted during sending.. Code: https://bpaste.net/show/646e646d0058
[07:52:55] <lowin> sample output: https://bpaste.net/show/e06efe294744
[07:55:40] <lowin> furthermore, by using leds and output pins I found out, my program seems to hit places it shouldn't. like there should be zero possibility to reach there. I even checked disassembly to make sure. but It does anyway
[08:19:31] <kre10s_> lowin your problem is extern uint8_t input_buffer;
[08:19:50] <lowin> kre10s_, How should I do it?
[08:20:19] <kre10s_> this is not a buffer. it is a single byte. *(&input_buffer + i) will cause all manner of evil.
[08:21:01] <kre10s_> you need an array. like uint8_t input_buffer[some_size];
[08:21:35] <lowin> kre10s_, it is defined as .comm input_buffer 64 in .bss section
[08:22:06] <kre10s_> then debug_c(input_buffer[i])); will not go out of bounds.
[08:23:11] <lowin> I'm not sure
[08:23:13] <lowin> lemme try
[08:28:23] <lowin> kre10s_, Well I just removed that whole for loop completely. this was the result: https://bpaste.net/show/343951ba7789
[08:28:33] <lowin> I think I'm having a uart problem but I don't know what.
[08:29:22] <lowin> debug_send is on a loop elsewhere in the code btw
[08:29:33] <kre10s_> where is main? where is the rest of the code?
[08:33:14] <lowin> Well the code is too big to show. but for now, all I have in my main is the initialization and the debug function on the loop. I expect the dc and current_token values to be changed in an ISR (they should both be the same)
[10:46:34] <lowin> Does gcc usually warn of out of range branchs in assembly or do I have to look out for it myself?
[11:32:54] <_ami_> power_adc_disable/enable() seems to be not available on Atmega16A
[11:33:19] <_ami_> but power_all_disable/enable() is present (atleast i can compile the code with it),
[11:33:44] <_ami_> so is it dummy function? or actually do something at atmega16?
[11:34:13] <_ami_> any tips on finding this on datasheet?
[11:35:07] * _ami_ should not have put a white led on my avr board. its too shiny. :/
[11:39:22] <_ami_> PRR registers are unavailable on Atmega16a, then what does power_all_enable/disable do in this case?
[11:40:31] <_ami_> cehteh: A124^
[11:40:47] <twnqx> _ami_: just add a stronge resistor to reduce current
[11:41:50] <_ami_> twnqx: yah,
[11:42:20] <A124> _ami_ look at source luke
[11:44:29] <Tom_itx> 16 is an old chip
[11:44:38] <Tom_itx> you want that stuff get a newer series chip
[11:45:04] <_ami_> Tom_itx: which ones?
[11:45:13] <Tom_itx> just about any of em
[11:45:27] <Tom_itx> 48 88 168 328 are all good and newer
[11:45:44] <Tom_itx> how many pins / features do you need?
[11:45:57] <Tom_itx> check their parametric table for features
[11:47:46] <cehteh> mhm
[11:48:12] <cehteh> just read datasheet
[11:48:44] <Tom_itx> parametric table will allow for comparison
[11:48:47] <cehteh> if you want very low power you want one of the modern picopower chips and careful programming
[11:49:02] <Tom_itx> unless you just like to read alot of data sheets
[11:49:12] <cehteh> i'm busy with copters :D
[11:49:15] <cehteh> https://pbs.twimg.com/media/Cjt5klGXAAAxddh.jpg:large
[11:49:37] <Tom_itx> you and everybody else
[11:49:42] <Tom_itx> i'm busy sitting on my arse
[11:49:48] <cehteh> hehe
[11:52:17] <Tom_itx> actually i just finished 2 catia classes and am converting some old code i have to a windows platform now
[11:53:02] <Tom_itx> no time for toys
[12:03:17] <_ami_> Tom_itx: cehteh thanks guys
[12:04:05] <_ami_> Tom_itx: well, currently i am just learning AVR programming. I have few Atmega16a, 8, and Attiny85. All are stone age MCUs.
[12:12:59] <_ami_> cehteh: that copter looks nice
[12:14:41] <_ami_> cehteh: i wish to make similar one for my toddler :).
[12:14:56] <_ami_> a lot to learn!
[12:15:00] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/how_to/atmega168/mega168_howto_main_index.php
[12:15:04] <Tom_itx> learning pages
[12:15:22] <Tom_itx> you may have to convert the code a bit for the mega8 but it should work with minor mods
[12:16:13] <cehteh> omg .. even the smallest ones are not for toddlers
[12:16:45] <cehteh> that one there should go 100mph .. definately not for a toddler ... :D
[12:16:47] <_ami_> cehteh: he won't be a toddler when i make it for him. haha! long way to go :)
[12:24:17] <_ami_> Tom_itx: thanks for the link. its good.
[12:24:46] <_ami_> i can pickup some stuffs from there and try those at my end.
[12:26:36] <Tom_itx> look around, there are other avr links there
[12:26:50] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/avr/c_bits/bits_index.php
[12:26:53] <Tom_itx> like that
[12:29:56] <_ami_> Tom_itx: bit twiddling i know pretty well. :)
[12:30:12] <_ami_> not a AVR programming starter.
[12:30:38] <Tom_itx> http://www.engbedded.com/fusecalc/
[12:30:39] <_ami_> its just that i should do a serious project using AVR.
[12:31:16] <_ami_> i use avrdude only to flash mcu
[14:06:20] <liwakura> shit.
[14:06:43] <liwakura> do you guys know that magic screwdrivers, which light up a bit when you hit the mains power?
[14:09:13] <liwakura> it also lights up on the secondary side of my transformer
[14:09:24] <liwakura> it should only be 12 V AC
[14:13:26] <liwakura> its a neon-lamp type voltage tester.
[14:18:29] <liwakura> so, how can a 12V AC secondary coil of an transformer ignote an > 50V neon lamp in my screwdriver.
[14:18:38] <liwakura> *ignite.
[14:42:19] <Lambda_Aurigae> liwakura, hall sensor.
[14:42:41] <Lambda_Aurigae> it's not just a neon lamp..it's a hall sensor..will likely pick up as little as 3V AC
[14:43:14] <Lambda_Aurigae> or is it the kind with the wire off the back?
[14:43:24] <Lambda_Aurigae> if that's the case then you just have a nice sensitive neon bulb.
[14:44:42] <liwakura> the thing i dont understand, its not even an closed circuit
[14:44:51] <liwakura> Coil <-> me is 20 V AC
[14:44:58] <liwakura> Coil <-> Air is 6 V AC
[14:45:07] <Lambda_Aurigae> need a picture of what tester you have.
[14:45:10] <liwakura> http://p.globalsources.com/IMAGES/PDT/B1001457631/Probe-Voltage-Tester-Screwdriver.jpg
[14:45:33] <Lambda_Aurigae> very sensitive neon bulb then.
[14:46:17] <liwakura> at 12 Volts?
[14:46:22] <Lambda_Aurigae> sure.
[14:46:26] <liwakura> im not even connected to sth
[14:47:04] <liwakura> *something
[14:47:57] <liwakura> its just like, that i have to put the screwdriver between 1 random secondary point and me and it glows.
[14:50:02] <Lambda_Aurigae> yeah.
[14:50:03] <Lambda_Aurigae> so?
[14:50:17] <Lambda_Aurigae> guessing you've never played with neon lights.
[14:51:15] <liwakura> It was even by accident that i screwed around in a powered-on device.
[14:51:37] <liwakura> I thought that 1-pin magic only works at high frequencies
[14:51:49] <Lambda_Aurigae> nope.
[14:52:39] <liwakura> Is it the voltage difference?
[14:53:34] <Lambda_Aurigae> yes
[14:53:42] <Lambda_Aurigae> you are providing a ground reference, kindasorta
[14:54:07] <liwakura> but its sorta, floating. the coil isn't connected to anything else
[14:54:12] <liwakura> and its only 12V AC
[14:54:17] <Lambda_Aurigae> yes.
[14:55:49] <liwakura> If this wouldn't have happened i would have gotten my Bachelor Degree without ever knowing of this effect
[14:55:52] <liwakura> How is it called?
[14:59:51] <Lambda_Aurigae> no clue what the effect is called.
[15:05:49] <liwakura> Lambda_Aurigae: 64 Volts to ground normal on a tranformer with 12 V?
[15:06:25] <liwakura> measured against the "official" ground at the heater
[15:06:34] <liwakura> *heat sink
[15:07:53] <liwakura> erm. just the think below the window that emits heat, and has its pipes connected to the ground of the building
[17:16:12] <kre10s_> liwakura, capacitive coupling?
[18:17:08] <eszett> hi i have a question..
[18:17:44] <eszett> The AVR has internal pullups, right, that means, without external resistors i cant pull them down?
[18:22:54] <Lambda_Aurigae> umm.
[18:23:15] <Lambda_Aurigae> the avr output normally, without pullups is GND or floating..the pullups will change that to GND or VCC.
[18:23:35] <Lambda_Aurigae> when set to 0 the pin is connected to GND..pulled down basically.
[18:23:52] <Lambda_Aurigae> wait..
[18:23:58] <Lambda_Aurigae> when set to 1 it pulls up hard.
[18:24:08] <Lambda_Aurigae> the pullups are for when the pins are set to input.
[18:24:11] <eszett> i mean when strobing the rows as output high, i have to set the cols to input low..
[18:24:14] <Lambda_Aurigae> sorry...was thinking of another chip.
[18:24:25] <eszett> I cant pull them down to "low" without external R's
[18:24:34] <Lambda_Aurigae> yes you can.
[18:24:37] <Lambda_Aurigae> set to 0
[18:24:42] <eszett> ahh this is enough? good
[18:24:44] <Lambda_Aurigae> pulls the pin low to GND.
[18:24:53] <Lambda_Aurigae> set to 1 as an output and it pulls it high to VCC.
[18:25:01] <Lambda_Aurigae> the internal pullups are only for input lines.
[18:25:21] <Lambda_Aurigae> so if a pin is set to input then it normally floats and you should pull it one way or the other...
[18:25:38] <eszett> so more exact speaking, the AVR has not only pull up function, but also the pull down function, sorry for stupid question
[18:25:40] <Lambda_Aurigae> the internal pullups can pull them high and hold them there until something externally pulls them low.
[18:26:08] <eszett> I see..
[18:26:11] <Lambda_Aurigae> when output it is a full swing output.
[18:26:28] <Lambda_Aurigae> the output is either connected to GND when set low or 0 and connected to VCC when set high or 1
[18:26:49] <Lambda_Aurigae> when set to input the pin floats normally unless you turn on the internal pullup resistor.
[18:27:08] <Lambda_Aurigae> floating input pins give unexpected and somewhat random readings.
[18:27:12] <eszett> or until you set them down or 0
[18:27:51] <eszett> makes sense... thx
[18:27:58] <Lambda_Aurigae> 1138
[18:28:13] <eszett> 1138?
[18:28:21] <Lambda_Aurigae> oh good god..
[18:28:34] <Lambda_Aurigae> thx-1138
[18:28:37] <eszett> ye got it
[18:28:47] <eszett> I will watch this movie tomorrow
[18:29:12] <Lambda_Aurigae> read the book...it is far more depressing.
[18:29:32] <Lambda_Aurigae> thx surround sound was named after that movie...being as it was created for that movie3.
[18:39:16] <liwakura> kre10s_: just saw your comment
[18:39:32] <liwakura> i guess so, but i was unaware that such stuff happens at just 12 Volts AC
[18:49:24] <eszett> was disconnected accidantely..
[18:52:02] <eszett> thx-1138 seems to be the inspiration for the whole story of "gemini rue"
[18:52:53] <Lambda_Aurigae> never played that one.
[20:33:56] <Emil> And he said: "I'll be back"