#avr | Logs for 2015-10-20

Back
[02:21:52] <cart> Hey can someone please lecture me on the various self-restarting functions of the Atmel 8bit MCU?
[02:25:48] <tkoskine> watchdog, brown out detection, and goto start come to mind first, if you mean software reset.
[02:27:51] <cart> Ok so the brownout is a Voltage check and reset right?
[02:28:02] <tkoskine> Yes.
[02:28:21] <cart> Watchdog is when something repetitively cycles through the same data and nothing really happens...like a useless infinite
[02:30:06] <tkoskine> Datasheet has details about the watchdog. Generally you need to write to some register every N instructions or reset happens. (I have used watchdog only for waking up from sleep.)
[06:48:08] <Lambda_Aurigae> http://www.atmel.com/products/microcontrollers/avr/default.aspx?tab=documents
[06:48:18] <Lambda_Aurigae> gorroth, for you...avr109 is there, pdf and source.
[06:48:22] <Lambda_Aurigae> along with other appnotes.
[06:48:41] <Lambda_Aurigae> lots of other appnotes.
[06:48:45] <Lambda_Aurigae> many with source.
[08:09:24] <zer0ptr> when you upload a program with avrdude, typically are all the registers on an AVR MP cleared?
[08:18:50] <LeoNerd> Registers?
[08:20:36] <zer0ptr> LeoNerd: like the status register for example
[08:21:00] <LeoNerd> That's not really a question that makes sense
[08:21:23] <LeoNerd> When you reprogram the flash, you reset the CPU entirely. Resetting the CPU has an effect on the registers.. you can't rely on their values on next startup anyway
[08:27:40] <zer0ptr> LeoNerd: okay i see, so one should reset the status register to ensure normal program execution?
[11:33:58] <gorroth> Lambda_Aurigae: i didn't see avr109 source anywhere on the atmel site
[11:34:06] <gorroth> Lambda_Aurigae: i can only ever find the PDFs
[11:34:47] <osteri> gorroth: http://www.atmel.com/Images/doc1644.pdf
[11:35:08] <gorroth> i JUST said i can find all the pdfs
[11:35:15] <gorroth> i can't find what's important: source code
[11:35:46] <osteri> oh, i misread your sentence
[11:35:51] <gorroth> np :)
[11:35:56] <gorroth> only one i've found is avr911 source code
[11:36:02] <gorroth> which is nice, as it's the PC side
[11:36:07] <gorroth> but i just can't find the avr-side
[11:36:37] <gorroth> however, i think i almost have my own code written now
[11:36:43] <gorroth> once i get pages handled properly, i'm done
[11:37:28] <gorroth> it'll require my own uploader for now, since avrdude doesn't support it, but my own uploader will be stupid simple, heh
[11:38:44] <tkoskine> Cannot find the official source but github seems to have some unofficial copies like https://github.com/xseregax/avr109
[11:39:27] <gorroth> oh wow!
[11:39:42] <gorroth> thanks; i don't know why google didn't bring that up when i typed "avr109 source code"
[11:40:48] <aandrew> avr109 why does that sound so familiar
[11:41:09] <gorroth> it's the appnote for the AVR Open Source Programmer
[11:41:15] <gorroth> well, the bootloader side
[11:41:19] <gorroth> avr911 is the PC side
[11:42:18] <aandrew> hm interesting
[11:54:46] <osteri> no wonder they hide the avr109 example code, looks like spaghetti code :D
[11:55:32] <osteri> ifdef-hell
[11:56:32] <aandrew> haha
[11:59:29] <antto> <gorroth> thanks; i don't know why google didn't bring that up when i typed "avr109 source code"
[11:59:36] <antto> cuz "google"
[12:03:16] <gorroth> lol
[12:03:28] <gorroth> google is bad at searching :-P
[12:04:01] <antto> nah, it just doesn't search.. it grabs stuff from a table
[12:04:36] <gorroth> yeah
[12:06:40] <antto> you may type something weird, like "gpio" but it'll show you results for "yu gi oh" cuz it has more results for it ;P~
[12:06:41] <gorroth> antto: you know a better engine to use?
[12:06:46] <gorroth> yeah
[12:06:49] <gorroth> i've seen stuff like that
[12:07:00] <antto> i get that all the time ;]
[12:07:17] <gorroth> i was searching for "ihex records" the other night, and it gave me back "metric hex nut records", lol
[12:07:17] <antto> i use duckduckgo.com lately ;P~
[12:07:28] <gorroth> thanks; i'll try that one
[12:07:32] <antto> yes, typical google
[12:08:05] <gorroth> i need to start searching for canadian entrepreneur stuff, b/c the new PM is going to be good there, and well, it's a very long story... but i'm in america and want to get funded in canada
[12:08:15] <gorroth> so maybe that website can help me find meetings easier
[12:08:28] <gorroth> 'cus google just shows me things that aren't very dynamic
[12:08:38] <osteri> i use startpage.com, it uses google's proxied search, i didn't like duckduckgo
[12:08:48] <gorroth> i'll try both
[12:09:27] <antto> i don't like duckduckgo either, but i just hate when the stupid google tells me what i meant
[12:09:34] <antto> >8(
[12:12:02] <gorroth> duckduckgo already won me
[12:12:08] <gorroth> i just typed "montreal entrepreneurship"
[12:12:12] <gorroth> already came up with good stuff
[12:49:04] <Tom_itx> gorroth, the source was in Lambda_Aurigae's link
[13:07:25] <gorroth> oh, i must have missed a link he posted
[13:07:27] <gorroth> i'll go back and look
[13:10:02] <gorroth> Tom_itx: Lambda_Aurigae: oh my! thanks for letting me know source is there. i think i just looked at the page "at face value" and didn't see any, but i had click one of the dropdown menues to get to source. i had actually found that link on my own the other day, but again, i didn't click on the dropdown and find the source
[13:10:07] <gorroth> so, i fail at internetz
[13:41:53] <wizkid057> fun code comment of the day: write_master((c&0xF)|((c&0xF)<<4)); // echo low nibble on both nibbles so the master has more nibbles to nibble
[13:50:13] <antto> r u nibbleing me
[13:59:31] <sim642> Is there any downside to reading some specific byte from EEPROM often? Other than it being possibly slower than getting it from a variable
[14:07:58] <learath> reading? not really, it's a bit more code
[14:11:50] <sim642> in that case I'll just keep it like this with eeprom reads because then I can be sure I don't forget to keep eeprom and variable in sync when I change it
[14:46:48] <zer0ptr> i cleared all bits in the DDRB and PORTB registers on an Arduino Uno but when i connect an LED to digital pin 0 and pin 12, it still emits light. can anyone think of a reason for this?
[14:50:39] <Jartza> evening
[14:52:09] <zer0ptr> something wrong with my board perhaps ...
[14:59:42] <zer0ptr> ah, PORTB is not not used for digital pin 0, my mistake but it still does not make sense for pin 12.
[15:53:44] <Jartza> iirc, pin 12 is used for SPI
[15:53:55] <Jartza> and pin 0 is uart rx
[15:56:42] <Jartza> maybe the internal pull-up is enabled
[15:56:52] <Jartza> that might be enough to lit a led :
[15:56:53] <Jartza> :)
[18:01:11] <FL4SHK> Anyone here know how I might interface 5V logic level with 3.3V logic level?
[18:02:06] <Tom_itx> with a logic level converter
[18:02:35] <Tom_itx> how many bits?
[18:02:53] <FL4SHK> I'm not sure yet
[18:03:03] <FL4SHK> Oh, wait
[18:03:05] <FL4SHK> I remember now
[18:03:07] <FL4SHK> it's serial
[18:03:23] <FL4SHK> er wait no it wasn't... what am I thinking
[18:03:34] <Tom_itx> i'm not entirely sure
[18:03:41] <Tom_itx> when you figure it out, ask a question
[18:04:01] <FL4SHK> Okay
[18:04:46] <Tom_itx> GTL2003PW is one such converter
[18:04:57] <FL4SHK> 8-bit
[18:05:04] <FL4SHK> Could I use it for a serial connection also?
[18:05:08] <Tom_itx> they have 2 to many
[18:05:16] <Lambda_Aurigae> a few transistors too, depending on whether it is bidirectional or not.
[18:05:16] <Tom_itx> pick the right part number
[18:05:39] <Tom_itx> or a simple resistor divider
[18:05:49] <Lambda_Aurigae> are you going 3.3V to 5V or versa-visa?
[18:06:02] <FL4SHK> I need bidirectional
[18:06:18] <Tom_itx> GTL200xx is bidirectional
[18:06:20] <Lambda_Aurigae> are the lines going to be bidirectional or do you have some lines one way and some the other?
[18:06:28] <FL4SHK> I don't know what that means
[18:06:37] <Tom_itx> does data go both ways or one
[18:06:41] <FL4SHK> both ways
[18:06:47] <Tom_itx> on the same line?
[18:06:50] <FL4SHK> Yes
[18:06:53] <Lambda_Aurigae> data go both ways on all the lines or one way on some lines and the other on others?
[18:06:56] <FL4SHK> Oh wait
[18:06:58] <FL4SHK> no
[18:07:00] <FL4SHK> two lines
[18:07:45] <Lambda_Aurigae> also, what devices?
[18:08:02] <Lambda_Aurigae> because some devices are 3.3V but 5V tolerant...and 5V devices can accept the 3.3V just fine.
[18:08:10] <FL4SHK> Gameboy Color and a Gameboy Advance
[18:08:23] <FL4SHK> Also, possibly AVR and Gameboy Advance
[18:08:36] <Lambda_Aurigae> no clue what chips those gameboys use.
[18:08:43] <Tom_itx> that tells us nothing
[18:08:51] <FL4SHK> I don't know what they use either
[18:08:53] <Tom_itx> except what you're hacking
[18:09:00] <Tom_itx> you'd better find out
[18:09:04] <Lambda_Aurigae> and with AVR, it depends on the AVR.
[18:09:23] <Lambda_Aurigae> I do believe there are some that are 3.3V only...could be wrong there,,,,but,,,
[18:09:33] <FL4SHK> the AVRs I have are all 5V
[18:09:52] <Tom_itx> xmegas are 3.3v only
[18:10:04] <FL4SHK> Why exactly do I need to know the chips used for serial communications in a GBA and a GBC?
[18:10:15] <FL4SHK> Can't I just know what the protocol is and work with that?
[18:10:26] <Tom_itx> then you can find the data sheet for them and know what they will do
[18:10:35] <FL4SHK> I see
[18:11:34] <FL4SHK> But
[18:11:52] <FL4SHK> There's documentation about how the serial stuff in the GB's work
[18:11:58] <Lambda_Aurigae> you can find out if it is 3.3V only or 5V tolerant.
[18:12:02] <FL4SHK> Oh, okay
[18:12:05] <FL4SHK> That's true
[18:12:12] <Lambda_Aurigae> so, you want us to read all that documentation to answer your questions?
[18:12:21] <Lambda_Aurigae> that'll cost...money.
[18:12:27] <FL4SHK> No
[18:12:36] <FL4SHK> I'm not asking for that
[18:12:40] <FL4SHK> I was going to read it
[18:13:43] <FL4SHK> it's two lines
[18:13:48] <Tom_itx> Lambda_Aurigae how much? i'm a lazy bastard...
[18:13:49] <FL4SHK> bidirectional
[18:15:21] <FL4SHK> I'll get a GTL2003PW
[18:15:51] <FL4SHK> Tom_itx, will that work?
[18:16:12] <Lambda_Aurigae> Tom_itx, depends on how much I gotta read!
[18:22:26] <Tom_itx> FL4SHK, i have no idea
[18:22:35] <FL4SHK> Hm
[18:22:40] <Tom_itx> no clue what parts you're interfacing
[18:23:06] <FL4SHK> they are two-way serial communications (same protocol), but different voltages
[18:23:11] <Tom_itx> it will convert 5v to clear down to 1v
[18:23:14] <FL4SHK> one is 3.3V, and the other is 5V
[18:23:16] <FL4SHK> Hm?
[18:23:25] <Tom_itx> read the data sheet for it
[18:23:28] <FL4SHK> Okay
[18:23:50] <Tom_itx> i've used a few hundred just fine
[18:23:54] <FL4SHK> 5V to 3.3V should work
[18:23:58] <FL4SHK> With a resistor ladder
[18:24:11] <FL4SHK> ...though I'd not have perfect accuracy, I guess
[18:24:29] <FL4SHK> so, 3.3V to 5V would probably be okay
[18:25:30] <FL4SHK> I believe that all I need to do is 3.3V to 5V
[18:25:50] <Lambda_Aurigae> you don't need perfect accuracy.
[18:25:56] <FL4SHK> Yeah, I figured as much
[18:26:00] <FL4SHK> I like tolerances
[18:26:02] <Lambda_Aurigae> guessing you've never looked at the logic levels?
[18:26:13] <FL4SHK> ...no
[18:26:16] <FL4SHK> I know what you're talking about
[18:26:31] <Lambda_Aurigae> http://www.interfacebus.com/voltage_threshold.html
[18:26:53] <FL4SHK> Alright, this should be good
[18:27:31] <Lambda_Aurigae> http://www.allaboutcircuits.com/textbook/digital/chpt-3/logic-signal-voltage-levels/
[18:38:32] <tpw_rules> just to confirm: i have something attached to OC2B on a 328p. i want a high frequency PWM whose duty cycle varies with TCNT. i set fast PWM mode, then make the interrupt reload TCNT with a value?
[18:39:45] <tpw_rules> oh no. i want to vary the compare match value
[18:39:57] <tpw_rules> durr. ok
[22:39:34] <PinkTieGuy> Hey all. New to AVR, just getting my feet wet! I was hoping someone might be able to help me out. I'm trying to control a digital potentiometer (MCP4131, datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/22060b.pdf) with an ATmega328p using SPI. I'm having a hell of a time figuring out what I'm doing. I've cobbled together some code I found online and have managed to get the pot to sweep up and down but
[22:39:34] <PinkTieGuy> I'm not quite sure how - as in, I don't exactly understand the code. As of right now, I can write a particular value to the pot but what I'd like to be able to do is simply increment/decrement it. Whenever I try sending an 8-bit command byte, however, I just end up setting the value of the wiper directly instead of incrementing it. A link to my code: http://pastebin.com/17Fp7GxZ Thank you!
[22:50:25] <PinkTieGuy> Anyone online?
[22:51:10] <Mr_Sheesh> PinkTieGuy - If you can set it's value directly then in your code just handle incrementing / decrementing the value you write, and write that incremented value or decremented value? Seems an easy fix w/o looking at the datasheet :)
[22:52:35] <PinkTieGuy> Yeah, I think that's what I'm going to have to do. Just bothered not knowing :P And the code I found wasn't really helpful in terms of comments...
[22:55:25] <Mr_Sheesh> Far too much code's like that...