#avr | Logs for 2012-08-13

Back
[00:45:24] <buhman> stupid question: if I said something like: uint8_t = "a"; the value of the "a" string literal is the same thing as saying: uint8_t = 97 (that is, that string literals are ASCII).
[00:54:56] <CapnKernel> buhman: You're missing something, a variable name perhaps?
[00:55:04] <buhman> CapnKernel: erm right
[00:55:04] <timemage> buhman, likely what you'll get is the least significant byte of the address of the string literal.
[00:55:16] <buhman> what I mean is more like http://codepad.org/vDvoh0Oj
[00:55:19] <buhman> can I rely on that?
[00:55:41] <CapnKernel> buhman: What are you trying to achieve?
[00:56:30] <buhman> CapnKernel: well, I noticed that the value of a *"!" appears to match the value that a "!" character on my LCD controller
[00:56:35] <buhman> I wasn't sure if this was a coincidence or not
[00:56:59] <CapnKernel> I'm not surprised, but not necessarily for the reason you think it does.
[00:57:05] <buhman> I have no idea why
[00:57:10] <buhman> that's why I'm asking
[00:57:22] <CapnKernel> Can you show me the whole line where you have *"!"?
[00:57:32] <buhman> http://codepad.org/vDvoh0Oj ?
[00:57:35] <CapnKernel> I need to see the type of the whole line.
[00:57:44] <timemage> buhman, * dereferences a pointer. "!" points at a string containing {'!','\0'}, so *"!" is '!'
[00:58:04] <buhman> indeed
[00:58:04] <CapnKernel> "Yes".
[00:58:26] <buhman> I was reading the /topic stuff and came across http://www.avrbeginners.net/conversions/ascii.html
[00:58:31] <CapnKernel> *"!" is the same as saying "!"[0]
[00:58:36] <buhman> and I though "those numbers look awefully familiar"
[00:59:14] <buhman> looks like that makes things easier for me: I can just iterate through a string literal and put that stuff directly on the screen
[01:00:02] <CapnKernel> Yes you can iterate through string literals, but your attempt at initialising a uint8_t with a string literal is very suspicious
[01:01:38] <buhman> erm where?
[01:01:52] <buhman> oh, right, I was being stupid
[01:02:06] <buhman> then I started fiddling around on codepad.
[01:16:25] <buhman> so if I have a PROGMEM uint8_t array, the identifier/name would already be a pointer to that array, yes?
[01:17:37] <buhman> that is, if I did "uint8_t foo[] PROGMEM;"; if I talked about just talked about "foo" it would be a pointer to some address in flash, right?
[01:18:40] <buhman> so I could easily say something like "uint8_t bar = foo"; and then use bar the same way foo is used (the whole pgm_read_byte nonsense) without having to reference and dereference foo?
[01:20:31] <buhman> the alternative of course being: "uint8_t *bar[] PROGMEM = &foo;" which I think looks rather silly
[02:05:44] <buhman> are there any arguments with this? http://sprunge.us/CgVX?c
[02:12:03] <R0b0t1> yes
[02:12:10] <R0b0t1> I don't like your code formatting
[02:12:37] <R0b0t1> :]
[02:21:32] <specing> buhman: you can also use uint8_t __flash array[]
[02:21:51] <specing> that way the compiler generates LPM automagically for you
[02:24:54] <specing> though it generates horrible code, both for PROGMEM and __flash
[05:37:03] <nerilex> hi, I have problems programming an ATtiny85 via avrdude (5.11) using an jtagice mkII
[05:37:36] <nerilex> I always get a verification error and warnings about changed fuses
[08:49:34] <rue_house> what kinda programmer do you have
[08:55:15] <nerilex> jtag-ice mk2
[08:59:24] <rue_house> can you show us how you have it connected to the programmer?
[14:37:52] <Essobi> Howdy guys...
[14:38:04] <RikusW> hi Essobi
[14:38:29] <Essobi> RikusW: how's it been?
[14:39:10] <RikusW> I'm ok, more or less, not been doing much electronics related stuff recently
[14:39:25] <Essobi> Ah.. My ARM920T died a few months ago...
[14:39:43] <RikusW> What did you do to it ?....
[14:39:50] <Essobi> Got two raspberry pi's to replace it.
[14:40:10] <Essobi> I didn't do anything... had Motion running on it for a few days, rebooted it, and it wouldn't boot up again. :(
[14:40:42] <Essobi> Sadly my pi's are 2x as fast (not counting the GPU) and 1/4 of the price.
[14:40:58] <RikusW> corrupted flash maybe ?
[14:43:12] <RikusW> Only with starting with E I've been studying recently is Endocrinology....
[14:43:35] <RikusW> Particulary Adrenals
[14:43:50] <RikusW> It seems that coffee is bad for it....
[14:48:51] <Essobi> RikusW: caffeine is a great adenosine impersonator..
[14:51:07] <RikusW> Essobi: it will eventually result in burnout....
[14:51:18] <Essobi> yurp
[14:51:37] <RikusW> its like debt, using tommorows energy today...
[14:51:47] <Essobi> it's a fun trip thou... :D
[14:52:09] <Essobi> I stop drinking caffeine several times a year..
[14:52:54] * RikusW drinks it only several times a year, or none at all ;)
[14:56:08] <waldi_> hi, i have an atmega8, and i want to use the PC6 Pin as I/O. i already know that i have to programm RSTDISBL fuse, but how do i do that in winavr and how do i change the programming protocol.. little bit confused
[14:56:51] <RikusW> once you do that you better have a bootloader on that m8....
[14:57:00] <RikusW> do you have AVRStudio ?
[14:57:11] <RikusW> or avrdude ?
[14:57:20] <waldi_> avrdude
[14:58:03] <RikusW> you need to set bit7 of hfuse to 0
[14:58:14] <RikusW> bitmask = 0x80
[14:58:35] <RikusW> how will you program the m8 after doing this /
[14:58:47] <RikusW> ? ISP will no longer work....
[14:59:26] <RikusW> you can use -t terminal mode of avrdude to change fuses
[14:59:35] <RikusW> or the commandline itself
[15:00:12] <RikusW> you'll need HVPP to disable RSTDSBL again, do you have access to HVPP ?
[15:00:28] <waldi_> mhm i think your bootloader idea is better than all this :D arduino works for m8 doesn't it
[15:00:51] <waldi_> whereby..
[15:01:10] <waldi_> i need all the 23 pins, that's the problem xD
[15:01:52] <RikusW> here is my stk500 bootloader http://www.ruemohr.org/code/BLM8.zip
[15:03:18] <waldi_> how do i install this, and can i still use all the 23 pins ?
[15:03:22] <RikusW> you can tweak the osccal register to 7.3MHz for proper uart baud
[15:04:43] <RikusW> you'll probably want to customize it a little eg: osccal value and a pin used to enter the bootloader (pulled low on reset)
[15:05:17] <RikusW> its loaded high in flash, then you set lockbits to 0xEF to protect it
[15:06:07] <RikusW> there is smaller bootloaders available too, mine is 1kb (you'll need to set the bootsection size fuses too)
[15:08:41] <RikusW> I'd say the easiest will be to get a mega324A ;)
[15:13:47] <waldi_> xD ok
[15:14:36] <waldi_> do u know HVPP? is this working with avrdude?
[15:17:04] <waldi_> oh you already wrote it
[15:17:19] <waldi_> how do i get access to hvpp?
[15:17:29] <RikusW> you need a HVPP programmer
[15:17:51] <RikusW> what kind of programmer do you have ?
[15:18:37] <waldi_> USBasp (and i have a arduino uno if it's possible with it)
[15:19:19] <RikusW> HVPP needs 12V on the reset pin... and about 21 connections to the avr....
[15:19:36] <RikusW> read the mega8 datasheet for more details
[15:19:51] <RikusW> you could build one that works only for fuses rather easily
[15:21:09] <RikusW> another thing, when using PC6 add a diode (1N4148 or similar) to PC6 -> Vcc
[15:25:14] <RikusW> because there is no protection diode built in
[15:25:40] <waldi_> ok thanks for help (:
[15:28:26] <cyronin> If you get a dragon to do HVPP, make sure that its hooked up over a powered up :)
[15:28:29] <cyronin> hub
[15:28:57] <cyronin> hvpp draws an excess of 800 mA from the usb bus, and if it cant get enough power, the regulator circuit fried
[15:29:21] <RikusW> 800mA ?! really ?
[15:29:38] <Essobi> lulz
[15:29:54] <RikusW> I connect my dragon to an onboard usb port only
[15:30:07] <RikusW> never ever to the frontpanel ones...
[15:30:29] <RikusW> And I have done HVPP a few times
[15:30:37] <RikusW> 800mA sounds a bit high....
[15:30:47] <cyronin> i remember it being higher than usb spec
[15:30:56] <cyronin> 800 mA might be wring
[15:31:05] <cyronin> wrong, fat fingers today
[15:31:16] <RikusW> to low a USB voltage results in frying
[15:31:22] <RikusW> *too
[15:31:53] <Essobi> I love bacon.
[15:31:58] <cyronin> from what I hear. lemme see if i can find the page again
[15:32:28] <RikusW> I know that if the regulator chip is touched it can cause problems
[15:32:50] <cyronin> yeah, the dragon is such a fragile snowflake
[15:32:58] <RikusW> lol Essobi, just as long as its not fried on a dragon
[15:33:25] <Essobi> RikusW: nomnomnom bacon.
[15:33:27] <Essobi> :D
[15:33:35] <cyronin> I don't think there are any avrs that can generate enough heat to fry bacon :(
[15:33:50] <RikusW> cyronin: I rarely use it for ISP anymore since building http://sites.google.com/site/megau2s/home
[15:34:01] <cyronin> http://sites.google.com/site/megau2s/home
[15:34:09] <cyronin> putty >.>
[15:34:31] <cyronin> oh nice, debugwire!
[15:34:39] <RikusW> cyronin: you might be surprised... connect vcc and gnd the wrong way round... and all protections diodes conduct
[15:34:49] <RikusW> dW isn't working yet
[15:35:06] <RikusW> http://www.ruemohr.org/docs
[15:35:17] <Essobi> oh yea.. I was jkust about to ask how far you got on that...
[15:35:20] <RikusW> You'll find most dW commands there
[15:35:35] <RikusW> not been working on that lately
[15:36:13] <RikusW> cyronin: dW is just an open drain rs232 connection
[15:37:35] <cyronin> interesting
[15:38:16] <RikusW> m8 don't have dW though
[15:38:19] <RikusW> m168 do
[17:38:12] <awozniak> Help, I'm stupid. I've got an atmega32u4. I want to set up TC1 as a 1ms timer, and I'm doing something stupid wrong. IIn my setup, I've got:
[17:38:22] <awozniak> OCR1A = (F_CPU / 64 / 1000);
[17:38:22] <awozniak> TCCR1A = 0;
[17:38:22] <awozniak> TCCR1B = (1 << WGM12) | (1 << CS11) | (1 << CS10);
[17:38:24] <LoRez> find a pastebin
[17:40:38] <awozniak> Help, I'm stupid. I've got an atmega32u4. I want to set up TC1 as a 1ms timer, and I'm doing something stupid wrong. What am I missing? http://pastebin.com/9hkCRJ2e
[17:41:34] <karlp> is it not firing at all, or firing at the wrong time?
[17:41:59] <awozniak> I'm manually checking the TOV1 flag in TIFR1 (no interrupts)
[17:42:13] <awozniak> can't tell if it is firing or not
[17:46:28] <awozniak> looks like it never fires
[17:49:36] <Tom_itx> did you enable interrupts?
[17:49:57] <Tom_itx> err maybe you're not using them...
[17:51:26] <awozniak> Not using interrupts, polling the TIFR1 TOV1 flag
[17:52:06] <awozniak> http://pastebin.com/9hkCRJ2e
[20:10:51] <buhman> R0b0t1: what about it?
[20:11:08] <buhman> specing: does __flash come from progmem.h?
[21:33:27] <OndraSter_> so
[21:33:32] <Phantom> da
[21:33:35] <OndraSter_> I bought cheaply transistors while they were being sold out
[21:33:37] <OndraSter_> guess what
[21:33:40] <OndraSter_> I didn't check its package :D
[21:33:46] <OndraSter_> so it is SOT363 instead SOT23
[21:33:49] <Tom_itx> heh
[21:34:01] <OndraSter_> I will have to spend another 40 mins there and 40 mins back to get a new one
[21:34:14] <OndraSter_> two NPNs, one PNP
[21:34:17] <OndraSter_> the PNP one is the wrong one
[21:34:18] <OndraSter_> damnit
[22:02:20] <buhman> so I have the sd card all wired up for spi (I think); but I don't want to do any of that fancy fatfs stuff
[22:02:41] <buhman> I'm guessing I'm supposed to just do raw spi magic to read the data?
[22:02:42] <Essobi> EATMAHFAT!
[22:02:44] <Essobi> heh
[22:09:02] <Kevin`> buhman: there should be some code in-between the filesystem and spi for the block layer you can use
[22:09:34] <learningc> buhman: you want raw data saving?
[22:09:38] <buhman> reading
[22:10:04] <learningc> reading fat sextors?
[22:10:06] <buhman> I already put several bytes at the *very* beginning of the sd card (no filesystem) and I want to put them on the lcd screen
[22:10:16] <learningc> sectors
[22:10:37] <buhman> not even fat sectors, should be just completely "raw" data
[22:11:06] <learningc> yeah, you can do that with spi mode
[22:11:23] <buhman> erm, so how do I "ask" the sd card for the data?
[22:11:30] <buhman> surely there's some initialization sequence or similar nonsense
[22:11:46] <learningc> you send the command
[22:11:54] <buhman> what command :S
[22:11:55] <learningc> and you get back the data
[22:13:50] <learningc> I don't remember off my head, but it's a long string of bits + error correction
[22:23:46] <Kevin`> buhman: the sd initialization is somewhat annoying, I really would use a library for it
[22:24:09] <buhman> Kevin`: meh, but I want to know how everything works
[22:24:47] <Kevin`> well, it IS documented (sort of. plenty enough to write the code at least)
[22:24:53] <Kevin`> if you want to, go ahead :)
[22:26:11] <buhman> hrm, just found a 113 page datasheet on the sd protocol
[22:28:12] <Essobi> sure there isn't a lib somewhere?
[22:28:21] <buhman> there are several
[22:28:46] <buhman> but libraries don't give me hard-ons like datasheets do
[22:28:56] <buhman> well-written datasheets that is
[22:30:48] <buhman> all these blogging-hipsters pretty much just say "blah blah pinout blah.. and I gave up and just used this library"
[22:32:40] <buhman> that's no fun