#avr | Logs for 2016-08-27

Back
[00:08:18] <rue_shop3> gcc has surprised me, in good ways more than bad
[00:08:28] <rue_shop3> sometimes setting a var to zero can go stupid
[00:08:41] <rue_shop3> or was it comparing two numbers
[00:10:27] <rue_shop3> -- paste warning --
[00:10:33] <rue_shop3> -- you were warned --
[00:10:35] <rue_shop3> !!!!!!!!! SEVERLY OPTIMIZED CODE !!!!!!!!!
[00:10:35] <rue_shop3> REFERNENCE ASSEMBLER OUTPUT WHEN MODIFYING
[00:10:35] <rue_shop3> THIS PWM FUNCTION
[00:10:35] <rue_shop3> gcc -O1
[00:10:35] <rue_shop3> **********************************************************/
[00:10:38] <rue_shop3> SIGNAL (SIG_OVERFLOW0) {
[00:10:39] <rue_shop3> if (++pwmcount == 0){
[00:10:41] <rue_shop3> SetBit(PWM1BIT, PWM1PORT);
[00:10:44] <rue_shop3> SetBit(PWM2BIT, PWM2PORT);
[00:10:46] <rue_shop3> SetBit(PWM3BIT, PWM3PORT);
[00:10:48] <rue_shop3> SetBit(PWM4BIT, PWM4PORT);
[00:10:50] <rue_shop3> };
[00:10:51] <Thrashbarg> y'know you could probably pastebin that
[00:10:52] <rue_shop3> if ((pwm1 ^ pwmcount) == 0) { ClearBit(PWM1BIT, PWM1PORT); }
[00:10:54] <rue_shop3> if ((pwm2 ^ pwmcount) == 0) { ClearBit(PWM2BIT, PWM2PORT); }
[00:10:56] <rue_shop3> if ((pwm3 ^ pwmcount) == 0) { ClearBit(PWM3BIT, PWM3PORT); }
[00:10:58] <rue_shop3> if ((pwm4 ^ pwmcount) == 0) { ClearBit(PWM4BIT, PWM4PORT); }
[00:11:00] <rue_shop3>
[00:11:04] <rue_shop3> }
[00:11:06] <rue_shop3> -- end of warning --
[00:11:44] <rue_shop3> every other method of comparing the numbers resulted in stupidity
[00:16:08] <Casper> Thrashbarg: yup, he could have, but he didn't.
[00:16:19] <Thrashbarg> apparently
[00:16:37] <Casper> was he aware? yes. Does he care? absolutelly! Not!
[00:21:22] <rue_shop3> I support traffic, esp if its avr related
[00:21:31] <rue_shop3> maybe that software pwm code will help someone
[00:21:46] <rue_shop3> matter a fact I'll bet tommroow someone asks about software pwm,
[00:22:01] <rue_shop3> and instead of using the code I put a lot of care and work into
[00:22:11] <rue_shop3> they spend a month making somehting horrid
[00:22:15] <rue_shop3> and then say it'll do
[00:22:23] <rue_shop3> cause, people do that
[00:22:58] <Thrashbarg> isn't pastebin searchable via Google or such
[01:34:55] <rue_shop3> 00=03E9 01=03E3 02=03DC 03=03FF 04=03FB 05=03F0 06=03FF 07=03FF 08=03FF 09=03FF 0A=03FF 0B=03FF 0C=03FF 0D=03FF 0E=03FF 0F=0000
[01:35:20] <rue_shop3> I have 16 adc channels on a atmega8, it took a lot of work, and a slave tiny26
[01:35:37] <rue_shop3> no waiting for mux's
[06:22:22] <_ami_> #linux-kernel & #kernelnewbies are not so active irc group on freenode.
[06:22:35] <_ami_> people are not like our group in #avr.
[06:22:45] <LeoNerd> Communities vary
[06:22:54] <LeoNerd> It's a lot more about the people in them, than the technology they use
[06:23:44] <_ami_> LeoNerd: probably they have big ego abt being "The Kernel programmer" :/
[06:26:01] <_ami_> LeoNerd: i have seen cases in lkm where few good programmer actually left the development just because of rudeness in community.
[06:26:31] <LeoNerd> Yah.. would not surprise me
[06:27:17] <_ami_> https://news.ycombinator.com/item?id=10338094
[06:27:23] * twnqx is a kernel programmer too
[06:27:25] <twnqx> so what
[06:27:41] <twnqx> i add features i want, and fix bugs that hit me. bug thing.
[06:27:46] <twnqx> big*
[06:28:19] <LeoNerd> I'm sure it's not -everybody-; I didn't mean to tarnish everyone with the same brush
[06:28:28] <twnqx> ok, i got an email "this is what i have been waiting for for ages, works perfectly, why is it not in mainline yet" emails once after i submitted a patch, made me feel a bit happy
[06:28:38] <LeoNerd> But I'm quite sure that group does have a -larger than average- amount of people with attitude problems
[06:29:34] <twnqx> there are people out there that take any form of critics as offense
[06:29:34] <_ami_> twnqx: nice :)
[06:29:42] <twnqx> criticism*
[06:30:05] <twnqx> _ami_: all i wanted is to make my htpc work with my projector, had some side effects apparently ;)
[06:31:00] <twnqx> LeoNerd: and there's the issue that in vast parts of north america and in asia, criticism is BAAAAAAD, while in europe, if someone makes a mistake, you tell him he fucked up
[06:31:13] <twnqx> maybe not as blunt as linus is every now and then
[06:31:42] <twnqx> but in generally we are pretty straightforward about it
[06:31:56] <LeoNerd> I'm well aware how various international programming communities work. I sit in a lot of thme
[06:32:11] <LeoNerd> I'm not aware of any that function anywhere nearly as badly as "linux kernel"
[06:32:19] <twnqx> and personally, i think any sugarcoating is plain wrong in that regards
[06:32:34] <twnqx> you haven't worked on libav/ffmpeg, i take it :P
[06:32:53] <LeoNerd> Admittedly, no. Perhaps there are others then
[06:33:10] <twnqx> there are. personally i don't care
[06:33:40] <twnqx> i don't look at form much, the content is what i care about, and if i made a mistake, i want to know i made one so i can fix it
[06:34:45] <_ami_> twnqx: same here.. if someone knows better than me, i will suck the knowledge out of him whether he is being an asshole to me or not. i really don;t care.
[06:35:00] <_ami_> i developed a thick skin over time.
[06:35:04] <_ami_> so no issues to me.
[06:35:10] <_ami_> knowledge is what i seek
[06:35:34] <twnqx> but i can understand if people do not like being treated that way; the first times are pretty much discouraging
[06:39:34] <_ami_> btw, twnqx: what is htpc? its a keyboard?
[06:39:42] <twnqx> home theater pc
[06:39:51] <_ami_> aha, nice
[06:41:19] <CORDIC> http://www.foaas.com/
[06:42:45] <twnqx> :)
[06:43:17] <CORDIC> I thought it's just a mith.
[06:43:19] * CORDIC drops a tear.
[06:59:56] <_ami_> twnqx: i don't when if someone replies to my query on kernel irc group.
[07:00:30] <_ami_> http://pasted.co/0ac16746 -> i added allow_signal(SIGKILL) in my kernel thread work function. kill -9 <thread_id> does not stop the thread function. any pointers?
[07:00:48] <_ami_> it should have worked but not working.n
[07:00:55] <_ami_> not sure what is wrong with the code.
[07:01:19] <aandrew> hm, isn't sarah sharp the one who was whining because LInus snapped at her?
[07:02:55] <_ami_> aandrew: yeah, they had some dispute before too.
[07:02:58] <aandrew> _ami_: I'm not sure i've ever run into the use case where I've had to try to kill a kthread under normal circumstances
[07:03:33] <_ami_> aandrew: that sample is only for testing. i am currently learning it.
[07:04:04] <aandrew> wait, that ycombinator thread a year old
[10:49:06] <twnqx> heh
[10:49:14] <twnqx> allah bot just hit #gnuradio :P
[11:24:10] <twnqx> <bzztploink> not sure of it'll work on this one, but back in the day when it was still the allah bot, you could get the damn thing to leave isntantly by saying 'peace be upon you, Guest_[insertsillynumberhere]'
[11:24:11] <twnqx> lol
[11:24:16] <twnqx> if it ever comes back, be have to try :D
[11:54:41] <Lambda_Aurigae> allah buncha bullshit....
[12:07:41] <rue_shop3> anyon know if a mega8 will do that pin toggle if you write a 1 to the PIN register?
[13:00:37] <Lambda_Aurigae> never heard of that.
[13:01:56] <Lambda_Aurigae> PORTD ^=0x80;
[13:02:08] <Lambda_Aurigae> toggles the high bit of port D
[16:08:40] <_ami_> how good is electronics for you magazine?
[16:08:59] <_ami_> is it worth to go for subscription for an year?
[20:21:52] <timBandTech> anybody here?
[20:30:31] <eszett> hm
[21:34:30] <rue_shop3> no, on a lot of avrs, you can write to the PIN register, and any bits that are set will cause a toggle of output bits
[21:34:39] <rue_shop3> I just dont know which ones
[21:41:44] <Lambda_Aurigae> guess I missed that bit.
[21:41:48] <Lambda_Aurigae> will have to research it.
[21:43:36] <Lambda_Aurigae> seems it does that on the atmega1284p.
[21:43:52] <Lambda_Aurigae> Writing a logic one to PINxn toggles the value of PORTxn, independent on the value of DDRxn.
[21:43:52] <Lambda_Aurigae> Note that the SBI instruction can be used to toggle one single bit in a port.
[21:45:35] <Lambda_Aurigae> I don't see that the mega8 does that.
[21:45:45] <Lambda_Aurigae> so, I'm guessing it is only on the new atmega cores.
[21:46:49] <Lambda_Aurigae> that doesn't show in the atmega8 datasheet at all.
[21:50:33] <Lambda_Aurigae> atmega88 has it.
[22:05:08] <rue_shop3> yea I thought the m8 might be a little old for it
[22:06:05] <Lambda_Aurigae> it seems anything with pin change interrupts has it.
[22:08:02] <rue_shop3> oooh
[22:08:05] <rue_shop3> cool
[22:08:47] <Lambda_Aurigae> it's right in the datasheet section xx.2.2 for the 4 that I looked at so far.
[22:09:04] <Lambda_Aurigae> 10.2.2 or 12.2.2 or wherever...but they are all xx.2.2 under i/o ports.
[22:10:50] <rue_shop3> yea I was searing the m8 sheet, but didn't know if I didn't find it cause it wasn't there or because I wasn't searching right
[22:10:58] <Lambda_Aurigae> not there.
[22:11:09] <rue_shop3> it makes sense they changed the io system in a way to give the pin change interrupt and the toggle at the same time
[22:11:29] <Lambda_Aurigae> I did a search for toggle and it's not mentioned anywhere in the i/o ports section to toggle the pin by writing to PINx
[22:11:51] <Lambda_Aurigae> and a single cycle instruction to do it too.
[22:12:07] <Lambda_Aurigae> using SBI
[22:12:16] <Lambda_Aurigae> single cycle to do a single bit, rather.
[22:12:41] <rue_shop3> yes, I was realizing that its not gonna help me much tho
[22:12:50] <rue_shop3> I was looking at it for clocking data
[22:13:01] <rue_shop3> but I already know the state, so there is no optimization
[22:13:24] <Lambda_Aurigae> abuse the spi port.
[22:13:40] <rue_shop3> on the tiny26, you manually toggle the spi clock to output the data, which is stupid
[22:13:45] <Lambda_Aurigae> run it in slave mode and abuse it, like jarzta does for the usi to generate vga video.
[22:13:49] <rue_shop3> I'm on the m8, but the spi is already tied up
[22:13:57] <rue_shop3> its 12 bit data anyhow
[22:14:45] <rue_shop3> I cant use the other port cause I need 6 adc channels
[22:16:00] <rue_shop3> I'm running a tl5940, they are ugly
[22:16:25] <Lambda_Aurigae> tlc5940?
[22:16:26] <rue_shop3> I have it down to 3 wires, I get an interrupt that its doing another refresh cycle and I need to clock in the 192 bits of new data
[22:16:31] <rue_shop3> 16 channel pwm chip
[22:16:47] <rue_shop3> but the timing is a pain in the ass
[22:16:59] <rue_shop3> the pwm counter dosn't auto-rollover
[22:17:24] <rue_shop3> you have to manually reset it (which DOES give you your choice of ANY pwm resolution up to 12 bits)
[22:17:59] <rue_shop3> when you strobe in the data from the shift registers, it loads them with its status info
[22:18:12] <Tom_itx> that pin register thing isn't something to rely on but it is a 'trick' you can do
[22:18:40] <rue_shop3> I suppose it can be used for software interrupts too
[22:18:50] <Tom_itx> but rue_shop3
[22:19:00] <Tom_itx> this is not getting a pipe bender done....
[22:19:19] <rue_shop3> this is a prestep in the force feedback for the mecha control
[22:19:45] <rue_shop3> the firmware for my slave tiny26 adc is the same as I'll use on the mecha
[22:20:10] <rue_shop3> its beta, I'm only streaming 10 channels cause I dont want to take over the reset yet
[22:20:30] <rue_shop3> with the reset takeover, I'll get an 11 channel adc out of it, streaming
[22:21:23] <rue_shop3> oh, and on the tl5940, its not buffered, and it uses = for the off comparison, so if you write the value during its counting, you can get a pwm glitch
[22:21:30] <rue_shop3> (100% for a cycle)
[22:21:51] <rue_shop3> the shift register loading needs to happen during the counter reset
[22:22:30] <rue_shop3> its about 1 step away from doing your own software pwm
[22:22:57] <rue_shop3> matter a fact, the arduino library manualy operates its pwm clock, so they may as well be using software pwm
[22:23:31] <rue_shop3> I'm using an external 74HC4060 to generate the count pulses and reset signal
[22:23:52] <rue_shop3> I get an interrupt from it that I need to reload the shift register
[22:24:10] <rue_shop3> whcih means I have 3 wire control, but also means I have to reload the values every pwm cycle
[22:24:26] <rue_shop3> which I can do, cause I'm only about 300Hz
[22:24:45] <rue_shop3> but am still also 12 bit resolution
[22:25:12] <rue_shop3> pita