#avr | Logs for 2016-05-15

Back
[02:17:50] <wasim> PicKit3, Pin2=+ve and Pin3=-ve, right?
[02:23:44] <Xark> wasim: When I google it, I see 1 = VPP, 2= target VDD, 3=GND
[02:25:01] <wasim> Xark: you here too :), yes I saw that too, so VDD is +ve and 3 is yes -ve
[02:25:46] <Xark> wasim: Yes, but you may need +ve on 1 too...
[02:26:17] <wasim> Xark: I have developer board for its testing.
[02:27:14] <wasim> Xark: let me connect all 5 pins to 16f877a
[02:32:35] <wasim> Xark: here is error which made me doubted about my pickit3, .... The target circuit may require more power than the debug tool can provide. An external power supply might be necessary.
[02:33:40] <Xark> wasim: I think I have always used external power.
[02:34:03] <Xark> wasim: (Typically my dev board will be on USB)
[02:34:38] <wasim> so pickit3 doesn't offer power !!!
[02:34:59] <Xark> https://www.microchip.com/forums/m795438.aspx
[02:35:07] <Xark> ^ sounds like "not really". :)
[02:35:44] <Xark> But maybe for one chip? ~30mA should light an LED though...
[02:36:27] <Xark> wasim: Do you have the software setup, I could totally see it requiring a special command to even try to enable target power.
[02:39:27] <wasim> Xark: I have installed mplab and pickit 3 programmer, I also have set Power target circuit from Pickit3 checked and to 5.5v in MpLab,
[02:39:51] <Xark> Okay
[02:40:04] <Xark> I take it this is a cheap clone PicKit3? :)
[02:41:07] <wasim> problem is, for once I had turn ON led to test connection but now its not turning led ON, don't know if its a clone, bought from aliexpress for 18$
[02:42:09] <Xark> That would be "yes". :)
[02:42:36] <Xark> However, glad it is working.
[02:42:53] <wasim> Xark: for PIC16F877A I am going to give 5v External Power, PIN12 is GND but which one is +ve here http://www.hobbyprojects.com/microcontroller-tutorials/pic16f877a/images/pic16f877a-pin-diagram.jpg
[02:42:54] <Xark> Or is it...
[02:44:23] <Xark> wasim: Try http://www.getmicros.net/pic16f877a-rgb-led-example.php
[02:44:47] <Xark> VDD= +5 and VSS= GND
[02:47:12] <wasim> Xark: but this example doesn't contain instruction for how to burn chip with a code, So I should just connect 5 pins of Pickit3 as it is?
[02:47:25] <wasim> to pic16f877a
[02:51:24] <Xark> Not sure. That chip seems too old to find good info. :)
[02:52:43] <wasim> Xark: too old !!! wow I was thinking its most famous, which one is most famous ?
[02:53:19] <Xark> I see a lot for info about 18xxxx chips
[02:53:25] <Xark> lot more*
[02:54:03] <Xark> It may be 16xxxx chip people used pickit2 more. :)
[02:57:00] <wasim> Xark: I applied external power to chip and pin 1,4,5 (pickit3) to chip, this time it says Connection Failed.
[02:57:13] <wasim> means my pickit3 is mulfunctioning now
[02:57:26] <wasim> ?
[02:57:30] <WormFood> Is this now a pic channel?
[02:58:49] <Xark> WormFood: One big happy Microchip family now. :D
[02:59:02] <WormFood> not yet it isn't.
[02:59:43] <Xark> Hmm, http://www.reuters.com/article/idUSASC08JPQ
[02:59:53] <WormFood> and this would still be an AVR channel, unless they merge the 2 lines of microcontrollers.
[03:00:21] <Xark> WormFood: Well, I was just being helpful for wasim. There was no other chat in this channel.
[03:01:15] <WormFood> The merger isn't complete yet.
[03:01:27] <WormFood> They're still in the process.
[03:02:07] <WormFood> And, Microchip obviously isn't gonna kill off the AVR line right away.
[03:02:23] <Xark> WormFood: Umm, okay, just going by the headlines "Microchip Technology completes Atmel acquisition" that I read in April...
[03:02:35] <Xark> Of course not.
[03:02:44] <WormFood> I'm still waiting for the page to load.
[03:02:54] <WormFood> has the merger been completed 100% now?
[03:03:09] <Xark> Just google "microchip completes atmel acquisition" there are a bunch of stories, so I think it is a done deal as of last month.
[03:03:50] <WormFood> ok. my bad
[03:04:46] <Xark> WormFood: At any rate, me saying that was mostly a jest. :)
[03:04:52] <WormFood> Googling isn't so easy from behind the Great Firewall of China
[03:05:07] <WormFood> how about 4.2%
[03:05:15] <Xark> WormFood: Ahh, did not know.
[03:07:28] <WormFood> I live in one of the best places for an electronics geek to be. I'm literally walking distance from dozens of distributors who sell Atmel ICs.
[03:07:53] <WormFood> Google "huaqiangbei". That's about a 15 minute walk from where I live.
[03:11:00] <Xark> Fun.
[03:11:18] <WormFood> It is loads of fun, when you know where to go ;)
[03:11:36] <Xark> I only know a tiny bit about it that I read on DangerousPrototypes.com. :)
[03:12:19] <WormFood> One of my friends says he hates going there. I told him, that is because he didn't go with me. I went with him to pick up 2 required items, and 1 optional item. We got all 3 things, and were out of there in about 45 minutes.
[03:12:39] <WormFood> He said that was the fastest he's ever been in and out of HQB
[05:34:24] <twnqx> eszett/cehteh: i'll probably post a mouser order soonish... like sometime this week
[05:34:37] <twnqx> (or digikey, whoever is cheaper - which usually is mouser)
[05:46:25] <eszett> twnqx: oh, really? bitte bitte bei digikey, die haben viel mehr auswahl!
[05:46:50] <twnqx> mouser hat meistens das gleiche für 80% des preises
[05:47:01] <twnqx> nicht immer, aber meistens.
[05:47:31] <eszett> 80%? soviel? also ich baue gerade eine super slim tastatur und da plane ich lauter teile für die es nur bei digi gibt
[05:47:42] <eszett> glaub ich..
[05:47:45] <twnqx> es kann so viel sein
[05:47:49] <twnqx> ich mache meine liste und prüfe
[05:48:22] <twnqx> aber nicht jetzt, bin grad über's lange wochenende mit paar freunden in wiesbaden um boardgames zu spielen ;)
[05:48:31] <eszett> soll ich dir meine email addy geben, oder einfach weiter im IRC?
[05:48:39] <eszett> achso, was für boardgames?
[05:48:53] <twnqx> alles mögliche
[05:49:04] <twnqx> is ne kleine europaweite runde ;)
[05:49:12] <twnqx> wir treffen uns paar mal im jahr irgendwo in europa
[05:49:22] <eszett> ich hab früher mal bei so treffen magic gespielt also dieses kartenspiel
[05:49:28] <twnqx> kenne ich
[05:49:35] <twnqx> ne wir spielen richtige
[05:49:43] <twnqx> und ich fahre jetzt auch rüber vom hotel, bbl
[05:49:52] <eszett> ja ok bis später
[05:53:54] <theBear> hmm, you crazy foreigners talking one of those confusing not-deutsch langauges or just using lots of words i don't know
[06:49:44] <LeoNerd> Ooooh.. here's a cute idea. I²C sensor chip with separate SDA_in and SDA_out pins. Because: much easier to optoisolate that
[07:07:57] <wasim> The target circuit may require more power than the debug tool can provide. An external power supply might be necessary. How to solve this?
[07:08:11] <wasim> Pickit3
[10:27:14] <liwakura> uhm. when i want to drive a piezo speaker with a square wave of varying frequency
[10:27:33] <liwakura> i should set the timer to CTC mode and use OCR match toggle?
[10:28:40] <Lambda-Aurigae> pwm
[10:28:56] <Lambda-Aurigae> no, that won't work..nevermind.
[10:29:29] <Lambda-Aurigae> I was never here...you did not see my comment....
[10:30:04] <liwakura> i know exactly who you are. Everything you say can and will be used against you.
[10:30:13] <Lambda-Aurigae> it usually is.
[10:30:21] <Lambda-Aurigae> I'm married after all.
[10:30:32] <liwakura> oh. how many children?
[10:30:40] <Lambda-Aurigae> none with the current wife.
[10:31:01] <Lambda-Aurigae> on my 3rd marriage, 2nd wife....yes, I was an idiot and remarried the first one...the sex was good..that's about all.
[10:31:21] <liwakura> after watching full metal alchemist i decided never to have children.
[10:31:42] <Lambda-Aurigae> children are a sexually transmitted disease!
[10:31:46] <Lambda-Aurigae> and 100% fatal at that.
[10:32:13] <liwakura> Lambda-Aurigae: also, if you feel like you fucked your marriages up, meet my mom
[10:32:29] <Lambda-Aurigae> my first wife liked to fight and argue...I refused to...
[10:32:34] <Lambda-Aurigae> and, she went rabidly mormon on me.
[10:32:37] <Lambda-Aurigae> I refused to.
[10:32:42] <liwakura> i have 6 siblings, only 2 share a dad.
[10:32:47] <Lambda-Aurigae> so, yet another fight that ended up with her coming at me with a knife.
[10:32:56] <liwakura> wat
[10:33:05] <Lambda-Aurigae> I disarmed her and ended up in jail for bruising her wrist while taking the knife away from her.
[10:33:14] <liwakura> for real?
[10:33:18] <Lambda-Aurigae> the judge told me I should have let her cut me first then she would have been in jail.
[10:33:25] <Lambda-Aurigae> for real..don't live in missouri...ever..
[10:33:36] <Lambda-Aurigae> fucked up state full of morons..err..mormons...ok..same thing.
[10:33:39] <liwakura> i don't even live in the US
[10:33:44] <liwakura> thank god
[10:33:49] <Lambda-Aurigae> You're welcome.
[10:34:09] <liwakura> "hurr durr men are so privileged"
[10:34:31] <liwakura> but in the end its always the wife which is the victim
[10:34:53] <Lambda-Aurigae> missouri has a "someone goes to jail" law if the cops are called for a domestic dispute.
[10:35:04] <Lambda-Aurigae> 98% of the time it is the man who goes to jail there.
[10:35:11] <liwakura> for how long?
[10:35:18] <Lambda-Aurigae> I was in for all of 2
[10:35:20] <Lambda-Aurigae> hours
[10:35:38] <Lambda-Aurigae> saw the judge, paid my bail, went camping for the next 8 years.
[10:36:12] <liwakura> whats the logic behind putting someone in jail for like 2 hours
[10:36:37] <liwakura> people end up in jail for 24 hrs because they are suspected of sth
[10:36:43] <Lambda-Aurigae> along with having a mental breakdown, not wanting to talk to human beings of any kind for 3 years or so, getting my journeyman electricians card, and digging more water leaks than should be allowed by law.
[10:36:48] <liwakura> just for being at the wrong time at the wrong place
[10:36:56] <Lambda-Aurigae> I was there until I saw the judge and paid my bail.
[10:37:12] <liwakura> hm, no idea how this works in the US
[10:37:21] <Lambda-Aurigae> had to go back 6 weeks later for the trial and all that...that's when the judge told me I should have let her cut me.
[10:37:45] <Lambda-Aurigae> hell, most people in the US don't know how the US injustice system works..
[10:38:00] <liwakura> what if she would have stabbed you?
[10:38:07] <Lambda-Aurigae> then I would have had to kill her.
[10:38:21] <Lambda-Aurigae> and likely would have tried to.
[10:38:34] <Lambda-Aurigae> I had the training and have the reflexes to do so...instead I chose to disarm her first.
[10:41:21] <Lambda-Aurigae> I barely remember it happening actually...she had the knife then the knife was on the ground and she was holding her wrist then the cops were pulling in the driveway. Neighbor called them because it happened outside and we lived like 2 blocks from the police station.
[10:41:53] <Lambda-Aurigae> but because she was injured and I wasn't, I got hauled off in cuffs.
[10:41:55] <Lambda-Aurigae> oh well...
[10:42:01] <Lambda-Aurigae> I'm out of that situation.
[10:42:05] <Lambda-Aurigae> have a good wife now.
[10:42:19] <Lambda-Aurigae> we don't argue, we don't fight,,,,and we don't have kids.
[10:42:56] <Lambda-Aurigae> whenever we feel the need to have kids(usually her), we borrow a niece or nephew for the weekend..that solves the problem for 4 to 8 months at least usually.
[10:43:38] <liwakura> :D
[10:43:47] <liwakura> i'll note that.
[11:42:26] <l9> morning all :)
[12:18:58] <l9> debugging what little did i know i would be spending countless hours on it
[12:29:32] <Casper> debugging is always the hardest part
[12:31:11] <cehteh> start write workig code from a start :D
[12:31:28] <l9> i debug while writing :P
[12:32:44] <l9> anyone knows python that could explain why this doesnt work if int(self.temp) < temp-offset:
[12:34:12] <l9> but if int(self.temp > temp+offset: does
[12:45:59] <liwakura> "this" what?
[12:50:59] <_ami_> l9: share the code somewhere?
[13:17:54] <Lambda-Aurigae> python....bah.
[15:59:18] <liwakura> hm.
[15:59:46] <liwakura> did someone ever had any project where not less then the half of the interrupt table was actually used?
[16:10:22] <kre10s_> I need lots of ram to implement an algorithm. some 300Kbytes. But I only need some 200 bytes at a time. I'd like to do it with an 8bit mcu. What are the most common methods for extending memory?
[16:11:06] <LeoNerd> SPI RAM?
[16:22:24] <twnqx> external memory with bank switching
[16:24:55] <kre10s_> SPI ram only goes up to 125Kbytes 1Mbit So I'd need 3.
[16:30:30] <kre10s_> Dram is so much cheaper but needs all those pins. and refreshing and crap.
[16:38:09] * Chillum has a dram of whisky
[16:49:43] <LeoNerd> I still can't quite decide what's best for my "two uarts on 328P" problem. I want a (slowish) RS-485 link, and also a debugging serial console.
[16:50:12] <LeoNerd> I reckon my best bet given no extra hardware (notably, other chips) is to use the real UART and also a soft UART. But I still can't -quite- decide which should be which.
[16:50:37] <ricii> need some help understanding a linker error: In function `__vector_16': .. relocation truncated to fit: R_AVR_13_PCREL against symbol 'some_func'
[16:51:00] <LeoNerd> Debugging is unlikely to matter too much during when the real link wants to work, so I sortof feel like the real link wants to take the hardware UART. Buuuut... The hardware UART is nicely pre-wired up to the USB-CDC bridge so it's convenient on the USB port, which would be nice for debug
[16:51:08] <ricii> but sould'nt vector table use jmp instead of rjmp
[16:51:31] <LeoNerd> Plus I get more control of my TX-enable output line if I run the soft UART for that link
[16:58:19] <Lambda-Aurigae> kre10s_, you need 300KBytes of program space?
[16:58:31] <Lambda-Aurigae> or data space?
[16:58:49] <kre10s_> data.
[16:59:16] <Lambda-Aurigae> know that GCC won't be able to actually put variables and such in external ram for most avr chips.
[16:59:36] <Lambda-Aurigae> you would have to do lots of manual access to external ram.
[16:59:48] <kre10s_> yea. I realize I'll have to write extra code to get it back out.
[17:00:05] <Lambda-Aurigae> I would do it with either spi sram at 128KBytes at a time or use something like an atmega128 with an external ram interface.
[17:00:27] <Lambda-Aurigae> with the atmega128 or similar you can bank switch in up to 64K at a time...I would do it 32K at a time.
[17:01:05] <Lambda-Aurigae> I've used external 1Mbyte sram chips with the atmega128 in the past and just done bank switching of 32KByte banks at a time.
[17:01:16] <Lambda-Aurigae> also done such with 8052 chips.
[17:03:48] <Lambda-Aurigae> with 4 spi ram chips it would be easily doable.
[17:03:57] <Lambda-Aurigae> or even 3
[17:05:52] <Lambda-Aurigae> the microchip spi sram chips can do quad data interface too..so by paralleling two of them you can do 8bits at a time.
[17:19:59] <kre10s_> D: atmega128 is like 10 bucks
[17:21:14] <Lambda-Aurigae> there are other AVRs with external ram interfaces.
[17:21:24] <Lambda-Aurigae> atmega8515
[17:21:35] <Lambda-Aurigae> atmega128 is old actually.
[17:21:50] <Lambda-Aurigae> it was just the first one I thought of with the external sram interface.
[17:37:33] <liwakura> just had an shitty idea
[17:37:46] <liwakura> how about building a DC/DC switch converter using an AVR
[17:37:57] <liwakura> and the AVR measures the voltages and calculates the duty cycles
[17:39:42] <cehteh> thats done
[17:40:17] <cehteh> avrs are used for voltage regulators and i've seen someone where the avr regulates its own power
[17:40:36] <liwakura> how do i google that?
[17:40:38] <cehteh> needs some unswitched bootstrap/bypass for startup
[17:40:57] <cehteh> then the avr takes over and generates proper voltage
[17:40:59] <liwakura> if i enter "DC/DC converter atmega", just get atmegas powered via an DC/DC converter
[17:41:10] <cehteh> dunno i dont remember the url either
[17:41:41] <liwakura> i don't intend to run the avr via the output voltage of the switch conv
[17:41:42] <cehteh> AVR advertizes some of the tinys for such purposes
[17:42:18] <cehteh> atmel i meant
[17:42:27] <liwakura> i figured.
[17:44:34] <cehteh> maybe there is a appnote somewhere
[17:45:35] <cehteh> Atmel AT04204: Design a Buck Converter with XMEGA E for example
[17:45:56] <liwakura> i'd prefer to use my existing atmega328p for that
[17:46:10] <liwakura> mostly because i have a shitton of those
[17:46:42] <cehteh> of course
[17:46:47] <cehteh> i'd use some tiny for that
[17:47:00] <cehteh> i just google about some appnote, maybe it has some hints
[18:17:42] <kre10s_> AVR SMPS?
[19:16:22] <Lambda-Aurigae> there are AVRs made for power control
[19:16:56] <Lambda-Aurigae> well, for battery management rather
[19:16:57] <Lambda-Aurigae> but,,
[19:18:27] <carabia> given a fat-filesystem, if i wanted to read a directory backwards, how'd you do it?
[19:19:28] <carabia> as in, i want a function that reads x amount of valid dir entries (skip lfns, and empty entries) into a buffer
[19:19:43] <carabia> and the function would keep track of the current cluster and an offset within the cluster
[19:20:31] <carabia> but, it should be able to read the directory backwards, as in x amount of valid entries preceding the current offset, and cluster if there's an edge-case
[19:20:58] <Lambda-Aurigae> read the fat specification.
[19:21:03] <Lambda-Aurigae> it's all very open..
[19:22:01] <carabia> I have. And there's no way to determine the preceding cluster given you have the current one to work with
[19:22:46] <Lambda-Aurigae> then read the whole directory into memory and build a linked list.
[19:22:59] <carabia> Just trying to figure out an elegant solution to this. One would be to store all the already-read cluster numbers in an array and traverse that backwards if needed but it's just... meh
[19:23:20] <carabia> Yeah, I really would. But given the ram of avrs, you run out of it fast.
[19:23:48] <Lambda-Aurigae> so add an external spi serial sram.
[19:24:04] <Lambda-Aurigae> or just store what you absolutely need.
[19:24:13] <Lambda-Aurigae> heck, the avr I use most has 16K of sram..
[19:24:52] <Casper> carabia: this is why fat can be problematic for all non-sequential read/write
[19:25:07] <Casper> you may have to just recalculate all the time
[19:25:59] <carabia> Casper: yeah. defragmenting after every delete/write would help, but is not pragmatic
[19:26:27] <carabia> Lambda-Aurigae: even with 16K, you _COULD_ run into trouble
[19:27:22] <carabia> in this application i'm only going to be 1-directory deep, as in root only
[19:28:50] <Casper> you could store the file cluster blocks in ram "file=X bytes, first cluster = Y/Z bytes long, next is ..."
[19:29:19] <Casper> then it's easy to go forward/backward, as long as there is not too much fragmentation
[19:29:27] <Lambda-Aurigae> so either use a microcontroller suited for the project or find another way to do it.
[19:29:49] <carabia> Casper: any fragmentation breaks it
[19:30:04] <Casper> yes and no
[19:30:08] <carabia> filesize does not imply cluster numbers
[19:30:19] <Casper> it do not
[19:30:44] <Casper> but you can go cluster a-b, c-d, e-f, ....
[19:30:56] <Casper> just store the list for the file you are interressed in
[19:31:33] <Casper> shouln't take too much ram, as long as there is not too much fragmentation, if too much then revert to an optimised on the fly calculation
[19:32:38] <Casper> as in: store the current block (as in cluster x-y) that you was last interessed in and you calculated, if the data you want is within this range then no need to recalculate, else do recalculate
[19:33:21] <carabia> i know. I guess what i'll do is just limit the amount of maximum files I can have in the directory
[19:33:46] <carabia> then I can have a fixed size array of clusternumbers stored
[21:54:40] <kre10s__> what does it mean when sram access is 'Address Controlled'?
[22:34:05] <rue_shop5> sounds like protected memory