#avr | Logs for 2014-09-03

Back
[05:16:17] <DigiGram> does anybody know a step up converter chip that does not require an inductor that can handle more than say 1A? WEBENCH suggest I use the TPS61230 to take 3.7-4.2V up to 5V, 2A. But getting an inductor for it in South Africa is kinda hard
[05:50:34] <Lambda_Aurigae> DigiGram, unfortunately, the inductor is kind of an integral part of the boost converter circuit.
[05:50:49] <Lambda_Aurigae> DigiGram, but, if you have some wire you can probably make on that will work.
[05:51:33] <DigiGram> Lambda_Aurigae I know the inductor is neccessary, it's just the requirement of 5.4A that is a bit hard to find in South Africa :D
[05:53:19] <Lambda_Aurigae> I've seen people take some copper wire and use a small writing pin to wrap it on and make an inductor that works for simple boost converters.
[05:54:02] <Lambda_Aurigae> alternatively, rip apart dead radios.
[05:54:06] <Lambda_Aurigae> bound to find one in there.
[05:54:19] <DigiGram> I might consider that. If everything works as planned I don't mind importing the correct inductor in volume, but ordering 5 or so is just to expensive with shipping
[06:47:48] <STS_Patrik> Tried to program an ATmega328p with my dragon and had contact at first but when i programmed the fuses to set clk source i received an error and now i can't enter programming mode. Is the unit beyond rescue except HVP?
[06:48:20] <Bigpet_> rue_more rue_house rue_shop3 have you ever thought about using a BNC?
[06:49:18] <DigiGram> STS_Patrik I don't know the Dragon, but can you select to use internal or external clock while programming?
[06:49:19] <STS_Patrik> Failed to enter programming mode. ispEnterProgMode: Error status received: Got 0xc0, expected 0x00 (Command has failed to execute on the tool)
[06:50:18] <STS_Patrik> I am able to set ISP Clock and it should be maximum 1/4 of F_CPU but ive tried lowering all the way to 2.152kHz without success
[06:50:57] <DigiGram> any chance you have perhaps enabled the 328's internal clock?
[06:51:24] <STS_Patrik> ye possible that the fuses went wild during the failed programming
[06:51:52] <DigiGram> try to program it again WITHOUT using the Dragon's clock
[06:53:02] <STS_Patrik> is that possible? cant find any option for that
[06:53:37] <DigiGram> sorry, I have no idea, I just use an USBasp and had the same issue once
[06:54:21] <STS_Patrik> okey i c. All i have is the interface setting for ISP Clock with a slider (and possible manual entry as well)
[07:19:53] <Tom_itx> FoxGT, pm
[07:20:57] <Tom_itx> STS_Patrik, you probably set the fuses for external clock and now you need an external clock source
[07:36:02] <STS_Patrik> either that or ISP disable? or even reset-pin disable?
[09:13:23] <ecilop> STS_Patrik: or reset-pin is broken. It has't guard from static electr..
[09:18:50] <rue_more> Bigpet_, bnc? connector?
[09:19:35] <Bigpet_> no an IRC BNC
[09:19:52] <Bigpet_> http://en.wikipedia.org/wiki/BNC_(software)
[10:03:01] <timemage> STS_Patrik, any chance you turned on debugwire?
[11:09:49] <STS_Patrik> timemage, no I didn't. I did try to enter debug mode in case the corrupt fuse programming set the fuse but couldn't access dW mode either.
[11:12:10] <STS_Patrik> I did learn how to remove a QFP though ;)
[15:13:25] <Jartza> hmmh
[19:53:58] <StevenS> hi
[19:54:20] <Lambda_Aurigae> ih
[19:55:00] <StevenS> just a quick question. I wanted my F_CPU clock to be 16mhz. I followed what the second post here said >> http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=122586&start=0 <<
[19:55:53] <Lambda_Aurigae> ok.
[19:56:22] <StevenS> But I don't think it worked because my code >> http://pastie.org/private/gm3qbmvhcw3oamm7lkyhkg << doesn't make the LED light on for 1 second, off for 1 second...
[19:57:29] <Lambda_Aurigae> how fast does it run?
[19:57:41] <StevenS> 7-8 seconds
[19:57:53] <Lambda_Aurigae> with the #define uncommented?
[19:58:00] <StevenS> yep.
[19:58:18] <Lambda_Aurigae> well, here is the problem
[19:58:34] <Lambda_Aurigae> F_CPU has no use in your program at all whatsoever.
[19:58:35] <StevenS> i added F_CPU=16000000 to symbols in the project settings screen
[19:58:55] <Lambda_Aurigae> if you were using _delay_us() then it would be used.
[19:59:08] <Lambda_Aurigae> but just defining F_CPU doesn't actually set the cpu speed.
[19:59:14] <StevenS> oohhh
[19:59:30] <Lambda_Aurigae> I'm guessing you are running it on the internal RC oscillator?
[19:59:38] <Lambda_Aurigae> no external crystal?
[19:59:50] <StevenS> i have an external crystal
[20:00:00] <Lambda_Aurigae> did you configure the fuses for the external crystal?
[20:00:26] <StevenS> that i don't know. I have this https://code.google.com/p/micropendous/wiki/Micropendous_32U2
[20:01:27] <Lambda_Aurigae> well, no clue how the fuses are configured on that.
[20:01:47] <Lambda_Aurigae> I'm guessing it's set to external crystal at 16MHz with no prescaler
[20:01:54] <Lambda_Aurigae> but no way to know without actually reading the fuses.
[20:03:24] <Lambda_Aurigae> get rid of the timer stuff and add _delay_ms(2000); in there along with your PORTB line inside the while(1){} loop and see what happens...make sure you uncomment the #define too.
[20:03:58] <Lambda_Aurigae> if it is running at 16mhz then the _delay_ms(2000); should do a 2 second delay.
[20:04:13] <Lambda_Aurigae> you will also have to include the delay stuff...just a sec.
[20:04:45] <Lambda_Aurigae> #include <util/delay.h> just below the existing include file.
[20:04:48] <Lambda_Aurigae> file/line
[20:06:12] <Casper> StevenS: the code have no way to know at which speed the avr run at, hence the #define F_CPU... To set the speed, you actually need to set the fuses for the proper clock source and type...
[20:06:50] <Casper> the default fuses are set for 1MHz internal RC oscillator...
[20:07:09] <Casper> adding a crystal without changing the fuses won't work
[20:07:14] <Lambda_Aurigae> Casper, from the line of questions there and the link he posted to the device, I'm guessing he has no knowledge of reading fuses or writing them.
[20:07:27] <Lambda_Aurigae> and that device likely is preset I would think.
[20:09:02] <Casper> the page is weird
[20:09:42] <StevenS> I'm fairly sure its set because i've never had to do anything beyond #define F_CPU before
[20:09:49] <StevenS> but that was a long time ago, and I forgot how i did it
[20:10:57] <Lambda_Aurigae> it also appears to have a LUFA bootloader so likely no way to read or write fuses.
[20:11:48] <Casper> yeah
[20:12:36] <Casper> but...
[20:12:39] <Casper> "Due to the use of a 16MHz crystal, at 3.3V you must enable the clock divider clock_prescale_set(clock_div_2); Note that the USB AVRs are not fully specified for 3.3V operation with a 16MHz crystal so reliability may be reduced. "
[20:13:01] <Casper> so it look like it really run at 8MHz
[20:13:02] <Lambda_Aurigae> so it likely has the prescaler
[20:13:18] <Lambda_Aurigae> which would drastically slow it down.
[20:13:23] <Casper> yeah
[20:13:28] <Casper> the page is confusing
[20:13:29] <Lambda_Aurigae> hence my suggestion to try _delay_ms(2000)
[20:14:26] <StevenS> should I add anything to the symbols?
[20:14:33] <Lambda_Aurigae> what symbols?
[20:14:42] <StevenS> in the project settings
[20:14:58] <Lambda_Aurigae> I have no clue what you are talking about. guessing you are using atmel studio?
[20:15:11] <StevenS> Project -> Toolchain -> AVR/GNU C Compiler -> Symbols
[20:15:17] <StevenS> yep exactly
[20:15:26] <Lambda_Aurigae> if so, I'm out of it. atmel studio does not run on my computer.
[20:15:50] <StevenS> hmmm
[20:16:02] <Lambda_Aurigae> it's a windows only program and I refuse to use windows.
[20:16:30] <StevenS> http://pastie.org/private/kiwqot6gnmfxt0szhpbw
[20:16:46] <Lambda_Aurigae> should work.
[20:16:52] <Lambda_Aurigae> see how fast it runs.
[20:17:40] <StevenS> ~15 seconds
[20:17:42] <StevenS> on
[20:17:47] <Lambda_Aurigae> dang.
[20:17:57] <Lambda_Aurigae> that thing is running at 4mhz?
[20:18:34] <Lambda_Aurigae> change your f_cpu to 1000000UL and see what happens.
[20:18:40] <StevenS> k
[20:26:58] <Lambda_Aurigae> play with the f_cpu until it is on for 2 seconds and off for 2 seconds..then you know how fast the chip is running.
[20:31:34] <StevenS> hmmm
[20:31:50] <StevenS> i changed it to 8mhz, it stays on for 8seconds
[20:32:02] <StevenS> i change it to 10mhz, it stays on for 10seconds
[20:32:45] <StevenS> yep, changing it to 2mhz gets the 2second on/off going
[20:33:17] <Lambda_Aurigae> that's an odd speed for that thing to run.
[20:33:49] <Lambda_Aurigae> I suspect some kind of prescaler setup in there but no clue what exactly.
[20:33:54] <Lambda_Aurigae> and I'm off to bed...have fun.
[20:34:20] <StevenS> lmao thanks for the help though
[20:59:52] <StevenS> Lambda_Aurigae: i figured it out
[20:59:52] <StevenS> Lambda_Aurigae: i went back to my old code and found this >> CLKPR = 0x80, CLKPR=(0)
[22:32:31] <Tom_itx> abcminiuser you around?
[22:32:51] <Tom_itx> what interface do you program the ATUC256L3U with?
[22:33:04] <Tom_itx> is that JTAG only?
[22:33:04] <abcminiuser> Yeah working from home today
[22:33:16] <abcminiuser> JTAG is preferable
[22:33:23] <Tom_itx> ISP?
[22:33:25] <Tom_itx> no?
[22:33:25] <abcminiuser> Nein
[22:33:33] <Tom_itx> that's kinda what i figured
[22:33:49] <Tom_itx> dragon should work?
[22:34:03] <Tom_itx> what's that new programmer they have out now?
[22:35:22] <abcminiuser> Dragon might work, never tried it
[22:35:26] <abcminiuser> Atmel-ICE
[22:56:37] <StevenS> Hey, just had another quick question. If i'm using this code, while using standby power save mode, should those compares cause my avr to wake up?
[22:58:27] <FoxGT> Ah! Thanks, Tom_itx & abcminiuser!
[23:31:49] <rue_shop3> whats a good tutorial on using the eeprom on the avr?
[23:34:38] <Casper> the datasheet
[23:35:01] <rue_shop3> temp = eeprom_read_byte((uint8_t*)0x00);
[23:35:01] <rue_shop3> PORTA = temp;
[23:35:01] <rue_shop3> eeprom_write_byte ((uint8_t *)0x00, temp+1);
[23:35:03] <rue_shop3> whats that...
[23:35:24] <rue_shop3> does the avr datasheet have the gnu libc info?
[23:35:36] <Casper> then you want...
[23:35:49] <Casper> http://www.nongnu.org/avr-libc/user-manual/modules.html
[23:35:55] <Casper> but you probably already have that
[23:35:57] <Casper> no?
[23:36:01] <rue_shop3> seems I did it on the m32
[23:36:06] <rue_shop3> its really small code
[23:37:20] <rue_shop3> but I'm confused
[23:37:31] <rue_shop3> by that token you can only access the first 256 bytes
[23:38:20] <rue_shop3> where is avr/eeprom
[23:38:32] <rue_shop3> right infront of me ok
[23:38:38] <Casper> hmmmm
[23:38:50] <Casper> I think that after 256 you need to read by block
[23:39:10] <Casper> so dword or block
[23:39:25] <rue_shop3> my data is 32bit
[23:39:27] <rue_shop3> ...
[23:39:58] <rue_shop3> 8k if its not byte addressing
[23:40:36] <rue_shop3> there is only 1k, so that works
[23:41:51] <rue_shop3> stupid
[23:42:05] <rue_shop3> they dont say if the address is byte or word
[23:43:04] <rue_shop3> anyone know the answer
[23:43:31] <rue_shop3> if I write a dword to address 0, and another to address 1, will 0 be 1/4 overwritten by 1?
[23:43:56] <Casper> I beleive it will go 0 4 8 16 ....
[23:44:02] <Casper> i.e. address*4
[23:44:02] <rue_shop3> yea
[23:44:15] <rue_shop3> which means I cant access the whole 1k can I?
[23:44:30] <Casper> with dword, sure you can
[23:44:32] <rue_shop3> or can I?
[23:44:40] <Casper> uint32_t eeprom_read_dword ( const uint32_t * __p )
[23:44:54] <rue_shop3> yea how many bits is the *
[23:44:59] <Casper> but I'm unsure if you musn't do <<2
[23:45:06] <Casper> i.e. *4
[23:45:14] <Casper> 32 bits for the address
[23:45:44] <rue_shop3> I bet that address isn't relivent to 32 bits
[23:48:09] <rue_shop3> but I can test that!
[23:48:11] <rue_shop3> later...