#avr | Logs for 2013-01-28

Back
[00:00:07] <Xark> This is a compiler issue (avr-gcc) not just Arduino.
[00:00:48] <Xark> Some compilers do kludgy things like store a third "flag byte" as to pointer type [sdcc] (but that blows too).
[00:07:44] <seldon> Xark, that's why avr-gcc has PROGMEM, PSTR and stuff.
[00:08:23] <seldon> So you put the string literal into progmem and instead of just dereferencing the pointer use pgm_read_(byte|word|dword).
[00:09:03] <Xark> seldon: Sure, I am aware of that. I was just mentioning the issue as it is often an unexpected RAM drain for the unwary. :)
[00:09:23] <seldon> That is true. I ran into it myself in the beginning :P
[00:09:47] <Xark> seldon: Yep. Seen it a lot. Then you add more debugging prints and it gets worse. :)
[00:09:48] <seldon> Not just string literals, either, everything global.
[00:10:37] <Xark> seldon: Right, but I expect an (e.g.) int to take RAM, you don't expect foo("blather"); to be copied to RAM. :)
[00:10:41] <seldon> And then you end up writing (((void)(*)(void)) pgm_read_word(&menu[choice].func))();
[00:11:23] <Xark> seldon: Yes, and if you get PROGMEM "wrong", no errors or anything, just "hilarity" at run-time. :)
[00:11:35] <seldon> :D
[00:12:47] <seldon> I have yet to find a way to put a pointer into progmem that points to something in progmem in a single statement.
[00:15:44] <seldon> What does the CPU actually do when you tell it to ld r0,$(somewhere in progmem)?
[00:18:06] <Casper> seldon: actually, it's not somewhere in progmem
[00:18:10] <Casper> but somewhere in ram
[00:18:30] <Casper> it take an address, and that address is for ram
[00:18:40] <seldon> But you don't have enough RAM for the address.
[00:19:22] <seldon> for example, on an attiny88, the address spaces for RAM and progmem don't overlap.
[00:20:08] <Casper> if the address is bad, then 3 things could happend: the address get screwed up and written somewhere else, the instruction is ignored or something random can happend
[01:47:34] <Tandoori> what was that page for info on avr programming?
[01:47:51] <Tandoori> I want to do something simple.
[01:48:03] <dhiltonp> run /topic
[01:48:05] <Xark> Tandoori: You mean the one in the topic?
[01:48:57] <Tandoori> hmm? was that the one?
[03:17:42] <Tandoori> I was reading those links and I still could bot find the info I needed
[03:18:06] <Tandoori> I'm not interested in programing avrs via asm.
[03:19:28] <theBear> what info you need ?
[03:19:33] <Tandoori> that takes too long and is entirely unnecessary. (IMO)
[03:19:45] <Tandoori> I am a c kind of guy.
[03:20:29] <theBear> what info you need ?
[09:54:28] <inductiveload> hello! I have an Xplained A1 and a JTAG ICE mkII. I just tried to use avrdude on Linux. The first thing I did was to try to set the JTAG fuse off to use PDI, but now all I have is 8 rapidly flashing LEDs and no ability to communicate with the device. The LED by the USB connector is solid green/red, though the red flashes when you replug the USB. Does anyone have any idea how to get communication back?
[09:55:05] <inductiveload> whe i try to program, I get this:
[09:55:08] <inductiveload> avrdude: jtagmkII_setparm(): bad response to set parameter command: RSP_FAILED
[09:55:08] <inductiveload> avrdude: initialization failed, rc=-1
[09:55:44] <inductiveload> and the avrdude command is: avrdude -p x128a1 -c jtag2slow -P usb -v
[09:58:39] <inductiveload> if i press SW0, the LEDs stop flashing, but they start again as soon as I let go
[09:58:51] <TheJH> inductiveload, what commands did you use to set the fuses?
[10:01:01] <inductiveload> -Ufuse4:w:0x1:m (I took it from Eclipse, which I was setting up to use later)
[10:06:37] <Steffanx> Uhm, you disabled JTAG to enable PDI? Isn't PDI always enabled?
[10:07:04] <Steffanx> Anyway, if you disabled it. Shouldn't you use jtag2pdi and not jtag2slow ?
[10:08:07] <inductiveload> from the XMEGA-A! Xplained User's Guide, it says "Because JTAG_TDO and PDI_DATA are connected on the PCB for this kit, JTAG must be disabled on the device in order to use PDI."
[10:09:05] <inductiveload> and I tried PDI as well, but I still got the "RSP_FAILED" and "RSP_ILLEGAL_EMULATOR_MODE" and nothing else
[11:10:00] <creep> i search for "cmos vco" and see what i get ? http://www.bing.com/images/search?q=cmos+vco&go=&qs=n&form=QBIR&pq=cmos+vco&sc=8-8&sp=-1&sk=&view=detail&id=1FBC35E572CEAB42264DC5CCDF8F9B12364072AD#
[11:23:12] <Casper> creep: no wonder, that's bing...
[11:23:43] <Casper> bing can't even show up microsoft's own products, like microsoft security, called by microsoft MSSE
[11:23:56] <creep> yes it is kind of crap sometimes, and it likes frencs pages more with lame stuff
[11:24:11] <creep> french
[11:24:36] <Casper> can't say, because I always use google
[11:24:56] <Casper> but even google have issues with results in french, which I don't mind since I speak french
[11:25:09] <tandoori> Casper: hey guy whats going on
[11:25:25] <Casper> tandoori: hmmm let's see....
[11:25:33] <tandoori> uh oh
[11:25:34] <tandoori> hehe
[11:25:56] <Casper> https://www.dropbox.com/s/m4xzxsec9hhj36a/IMG_0258.JPG ← still going up
[11:29:12] <Casper> tandoori: did you checked the pic?
[11:29:19] <tandoori> sure did.
[11:29:24] <tandoori> looks like a mound of snow
[11:29:28] <Casper> yup
[11:29:37] <tandoori> oh lord. did you make that?
[11:29:44] <Casper> no
[11:29:49] <tandoori> oh okay
[11:29:56] <Casper> walmart
[11:30:34] <tandoori> hey im looking for a few c tutorials on how to work with Avrs. and those links in the topic aren't helpful
[11:30:52] <tandoori> that first one uses asm and i am like, oh hell no, lol
[11:31:24] <Casper> start with the datasheet
[11:31:36] <tandoori> huh
[11:31:50] <tandoori> the datasheet uses c? Intriguing...
[11:31:51] <Casper> and you might want to do a tiny prog with assembler first to understand the inner working
[11:31:58] <Casper> like a led blinker
[11:32:18] <tandoori> oh i understand asm well enough. its just that its a pita to work with
[11:32:23] <Casper> and yes, the datasheet have assembler AND C example
[11:32:49] <tandoori> and largely unnecessary imo
[11:32:52] <Casper> http://www.nongnu.org/avr-libc/user-manual/modules.html ← that is what you want to bookmark
[11:33:43] <Casper> true, usually asm isn't great... sure, in theory it will be faster and smaller... in practice it's unmaintainable and hightly depend on the user skill to make anything fast...
[11:34:49] <creep> wow, a zombie alarm with presettable tone http://www.youtube.com/watch?v=HzsTG5twQ1s
[11:55:21] <Casper> creep: me no like
[11:55:43] <Casper> I prefer this one: http://www.youtube.com/watch?v=kQ-l5PlDa-k
[11:55:55] <Casper> http://www.youtube.com/watch?v=8zEH5GxPNO8 ← and that one
[12:07:53] <creep> so there is no limit on human stupidity http://www.youtube.com/watch?v=LHoubxvPPuU
[12:10:28] <Malinuss> tandoori, are you comming from arduino, or a total beginner?
[12:11:08] * tandoori throws an adruino off the top of a 20000 storey building
[12:11:22] <tandoori> Malinuss: nope, beginner
[12:11:36] <tandoori> Malinuss: I REALLY hate arduinos, btw
[12:11:50] <Malinuss> tandoori, what about programming experience?
[12:12:21] <tandoori> Malinuss: I have extensive c programming experience. I also hate OOP languages
[12:12:42] <tandoori> just 0 experience programming microprocessors
[12:12:48] <Malinuss> which uc did you buy? if any yet
[12:12:56] <Malinuss> also, what programmer?
[12:13:31] <tandoori> Malinuss: I have this sparkfun avr programmer
[12:14:42] <Malinuss> which uc?
[12:14:50] <Malinuss> (uc = microcontroller)
[12:15:44] <tandoori> i have an assortment of MCUs for a couple of my planned projects. ATM, I am focusing on the ATTINY2313
[12:16:10] <tandoori> oh. lol so many names for them. i usually say mcu :-P
[12:17:06] <tandoori> Malinuss: I have also installed the Atmel Studio
[12:18:00] <tandoori> for additional informaiton, I have diptrace installed (man that is the awesomest easy to use app in the world, imo. beats crappy eagle)
[12:19:16] <Malinuss> I have never tried to design a pcb (yet), so wouldn't know which softwere is best, heh... So, you already tried doing something simple?
[12:19:20] <Malinuss> or just starting?
[12:21:04] <tandoori> hmm?
[12:21:27] <tandoori> i have a lot of schematics drawn on graphing paper
[12:21:48] <tandoori> i just completed transferring one into driptrace
[12:22:02] <Malinuss> I mean - since you are asking for tutorials, have you tried to program them yet?
[12:22:09] <tandoori> oh, not at all
[12:22:16] <tandoori> this would be my very first go!
[12:22:42] <creep> [183822] <Casper> http://www.youtube.com/watch?v=8zEH5GxPNO8 ← and that one < terrorist alarm, hacking alarm cocks relays
[12:26:03] <Malinuss> okay, well the most important part is to realise that everything you do, is to change values of different registers...
[12:26:15] <OndraSter_> yep
[12:26:24] <OndraSter_> that is what microcontrollers are about
[12:26:38] <OndraSter_> the #1 feature
[12:26:53] <Malinuss> so starting with the I/O pins is what I would do
[12:26:54] <tandoori> right, pull up registers, etc
[12:27:10] <tandoori> i think thats what its called :-P
[12:27:20] <Malinuss> there is a pull up resistor ;D
[12:27:25] <tandoori> there you go
[12:27:26] <tandoori> haha
[12:28:13] <tandoori> yeah my first project is very simple. its a keypad that, if you enter the correct code, it will activate a relay
[12:28:47] <Malinuss> tandoori, start simpler. start with turning a LED on and off..
[12:28:56] <tandoori> i am using shift registers to save pins, so that will be slightly extra work i imagine
[12:28:58] <Malinuss> also - read something about DC
[12:29:12] <tandoori> Malinuss: i am not THAT much of a beginner
[12:29:18] <tandoori> :-P
[12:29:28] <Malinuss> you said you never programmed a microcontroller before?
[12:29:46] <tandoori> aye, but have worked with other components
[12:30:08] <yunta> any programming exp?
[12:30:19] <tandoori> extensive c programming
[12:30:34] <tandoori> been using that for years, and i absolutely refuse to move to cpp
[12:30:57] <yunta> then all should be easy
[12:31:27] <tandoori> you see thats what i thought too, so i was just looking for a set of examples so i can just jump right in
[12:32:28] <yunta> do you need anything else than simple control of io pins ?
[12:35:11] <Malinuss> tandoori, after simple control of IO pins you might want to look into timers.... then look into PWM.. then you are ready to use whatever peripheral (the different "extra" features of the mcu)
[12:40:27] <tandoori> Malinuss: mmm that sounds so sexy
[12:40:42] <Malinuss> I know, right?
[12:40:52] <tandoori> Malinuss: I am planning small projects so that I can gain experience programming avrs and interfacing other components
[12:41:03] <tandoori> ive told some people but they think im crazy
[12:41:21] <OndraSter_> lol
[12:41:34] <OndraSter_> people respect me for my knowledge of micros and electronics and my ability to learn practical stuff :D
[12:41:38] <OndraSter_> (that is why I am failing at school)
[12:41:46] <tandoori> like...my second projcect which involves an ATMEGA is a tabletop vending machine.
[12:41:53] <OndraSter_> wow :D
[12:42:39] <Malinuss> sounds expensive (in material)
[12:43:07] <tandoori> yeah, i really wanted to do this because I wanted to gain an understanding of various tech. driving stepper motors, LCD displays, biometric readers, magnetic stripe modules, chip and pin modules, also may dabble in NFC stuff
[12:43:16] <tandoori> Malinuss: not really. not for such a small project
[12:43:26] <tandoori> doubt id spend more than 200$
[12:43:58] <yunta> tandoori: take xmega, make proper use of it's usb port, when you finish you're god of microcontrollers :D
[12:44:35] <Malinuss> yeah make the guy write his own usb stacks... lel
[12:44:36] <RikusW> tandoori: from your perscpective registers will appear to be variables eg: DDRB = 0xFF; PORTB = 0xFF; to set all pins to output and high
[12:44:48] <tandoori> yunta: ATTINY first...babysteps, my friend. baby steps
[12:45:06] <RikusW> usb is well... complicated...
[12:45:18] <tandoori> USART is better imo
[12:45:21] <yunta> tandoori: I wouldn't say attiny is easier to control than xmega. Quite the opposite.
[12:45:23] <RikusW> OndraSter_: got that usb stuff of yours working yet ?
[12:45:27] <tandoori> ive read up on that and i can use that just fine
[12:45:41] <OndraSter_> I haven't really messed with it. But if I connect it via chinese $2 hub, it works RikusW lol
[12:45:47] <tandoori> yunta: hmm? why do you say this?
[12:46:04] * RikusW would use the hub then :-P
[12:46:23] <Malinuss> tandoori, what do you need connection to the pc with, btw.? Since you are making a vending machine?
[12:46:26] <yunta> tandoori: e.g. xmegas have more memory - so your C may be cleaner, less hacks
[12:46:34] <OndraSter_> also xmegas contain useful stuff
[12:46:36] <OndraSter_> like "set bits" registers
[12:46:42] <OndraSter_> instead of using some bitwise operations
[12:46:45] <OndraSter_> (for IO that is)
[12:46:45] <RikusW> tandoori: then there is things like the AVRDragon allowing on chip debug too
[12:46:46] <yunta> true
[12:47:09] <Malinuss> tandoori, yeah you need to learn bitwise operations
[12:47:25] <tandoori> Malinuss: i already know how to use bitwise operations
[12:47:28] <OndraSter_> there is not much to learn :D
[12:47:40] <tandoori> lord. shift left. shift right, etc etc etc
[12:47:52] <RikusW> tandoori: the tiny2313 does have debugWire, but DON'T turn that on unless you have a Dragon or jtagice mkii
[12:48:06] <OndraSter_> hahaha
[12:48:22] <OndraSter_> dangerous buttons
[12:48:23] <tandoori> im not knowledgable of all the various abbreviations yet
[12:48:24] <RikusW> tandoori: PORTB |= 1; ;)
[12:48:33] <tandoori> mkii = ?
[12:48:45] <RikusW> mkii = ver2
[12:49:12] <RikusW> the dragon is like $50
[12:49:19] <RikusW> the AVRONE! is $500 iirc
[12:49:21] <tandoori> i dont know what those things are. programmers?
[12:49:27] <RikusW> yes
[12:49:30] <RikusW> and debuggers too
[12:49:39] <RikusW> it can debug conde while running on the AVR
[12:49:42] <RikusW> *code
[12:49:45] <tandoori> i have a sparkfun PGM-09825 pocket AVR programmer
[12:49:57] <RikusW> thats a programmer only...
[12:50:08] <tandoori> https://www.sparkfun.com/products/9825
[12:50:15] <RikusW> probably ISP only
[12:50:17] <OndraSter_> JTAGICE3 is $99
[12:50:21] <OndraSter_> which is very nice pricetag
[12:50:33] <RikusW> but it lacks HVPP
[12:50:34] <Malinuss> now I want to make a vending machine too :/
[12:50:38] <OndraSter_> who needs HVPP nowadays :)
[12:50:47] <RikusW> until you do ;)
[12:51:23] <tandoori> Malinuss: why? many of the parts will need to be machined. im also getting a cnc mill so i can mill my pcbs
[12:51:32] <tandoori> id rather not dabble in dangerous chemicals
[12:51:47] <Malinuss> "dangerous"... nah
[12:51:57] <Malinuss> just do it outside ;)
[12:52:15] <inductiveload> tandoori: mostly dangerous for your clothes ;-)
[12:52:17] <RikusW> some etching chemicals is less hazardous than others
[12:52:30] <RikusW> like ammonium persulphate
[12:52:44] <tandoori> i did have plans on using hydrochloric and hydrogem peroxidde
[12:52:49] <RikusW> HNO3 is a bit worse ;)
[12:52:53] <tandoori> *hydrogen
[12:53:04] <inductiveload> don't wear a white shirt and use ferric chloride, for example
[12:53:09] <yunta> tandoori: UV technique is pretty good. and quite safe.
[12:53:11] <tandoori> only because they are easily obtainable
[12:53:17] <RikusW> H2SO4 + H2O2 will work if you have the right catalyst...
[12:53:31] <tandoori> im sorry i have digressed. why do i need anything other than this lovely pocket avr programmer?
[12:53:46] <RikusW> it will work fine for your purposes
[12:54:00] <RikusW> but sometimes it is nice to have OCD -> on chip debug
[12:54:23] <OndraSter_> yep
[12:54:34] <OndraSter_> and I am not going back to not having OCD
[12:54:39] <yunta> hm, I own dragon, never tried ocd
[12:54:41] <Malinuss> that makes me remember that I once accidently chloroform in organic chemisty and almost passed out... lel
[12:54:41] <OndraSter_> (unless I use attiny4/5/9/10)
[12:55:14] <Malinuss> no wait, that wasn't in organic chemisty... but still haha
[12:55:24] <RikusW> yunta: OCD appears like you're in the AS simulator, except is actually running on the AVR
[12:55:54] <dhiltonp> how is the OCD better than the simulator?
[12:56:00] <OndraSter_> it is real
[12:56:03] <dhiltonp> io actually working, I would guess?
[12:56:05] <OndraSter_> yes
[12:56:07] <RikusW> yes
[12:56:09] <yunta> hm, somehow I can't see much value in ocd for my use cases
[12:56:15] <Malinuss> can the usb-tiny into OCD?
[12:56:23] <Malinuss> the one that somebody from in here is selling
[12:56:24] <yunta> RikusW: what's AS simulator?
[12:56:31] <OndraSter_> builtin simu
[12:56:34] <OndraSter_> in as
[12:56:37] <RikusW> AVR Studio Simulator
[12:56:41] <yunta> ah, atmel studio
[12:56:56] <tandoori> i like atmel studio. looks pretty full featured
[12:56:57] <OndraSter_> yeees
[12:57:12] <RikusW> and slow on old pcs...
[12:57:21] <OndraSter_> it is slow even on fast PCs
[12:57:21] <RikusW> I still use AS4
[12:57:24] <tandoori> something i dont have to worry about :-p
[12:57:28] <OndraSter_> doing 500ms ticks is not easy
[12:57:29] <OndraSter_> takes ages :P
[12:58:02] <tandoori> oh hey did you want to know what i wanted to do with another project? this one got a lot of laughs. remember those 500-in-one handheld brick games?
[12:58:04] <tandoori> well
[12:58:04] <RikusW> for realtime stuff OCD isn't all that good, you'll get buffer overruns on the UART for example...
[12:58:07] <tandoori> i want to make one
[12:58:40] <RikusW> hmm, good luck with making all the games ;)
[12:59:01] <OndraSter_> hehe yep
[12:59:07] <tandoori> it will give me experience with driving LCD matrix displays (no colour)
[12:59:17] <yunta> RikusW: that explains my attitude to OCD, I only do realtime stuff on avr :)
[12:59:46] <RikusW> yunta: there is some situations where it can be very very usefull though
[12:59:46] <tandoori> RikusW: haha, no no, mine would be less than that. hey what kind of avr has the ability to use external memory?
[12:59:58] <RikusW> mega128
[12:59:58] <OndraSter_> many
[13:00:03] <yunta> tandoori: there is also a lot of food for thought in xmega based usb client devices
[13:00:04] <OndraSter_> xmega*a1*
[13:00:05] <RikusW> mega162
[13:00:23] <tandoori> like flash memory
[13:00:26] <OndraSter_> oh
[13:00:27] <OndraSter_> none
[13:00:28] <RikusW> tandoori: the AVR cannot execute from RAM though :(
[13:00:35] * RikusW would have liked that very much
[13:00:41] <OndraSter_> yep
[13:00:47] <OndraSter_> what about softcore AVR running on AVR!
[13:00:51] <RikusW> AVR32 can execute from RAM but its much more complicated...
[13:01:01] <OndraSter_> AVR32 is nice
[13:01:15] <OndraSter_> but does not cost $5 :)
[13:01:16] <tandoori> let me guess, you have to read chunks into the internal registers and execute from there?
[13:01:24] <Malinuss> how different is programming on a avr32 compared to 8-bit?
[13:01:24] <OndraSter_> no
[13:01:32] <OndraSter_> avr32 is arm-like really
[13:01:41] <OndraSter_> Malinuss, you are working with 32 bit stuff. Same as on ARM...
[13:01:45] <RikusW> Malinuss: a lot
[13:02:18] <RikusW> xmega to AVR32 might be less of a leap, what do you say OndraSter_ ?
[13:02:27] <OndraSter_> I have never tried avr32
[13:02:30] <Malinuss> but if you program in C? Do you even care about if it's 32bit or not? Other then the registers are 32bit instead of 8...
[13:02:32] <OndraSter_> but xmega is as easy as mega
[13:02:54] <creep> oh yea, TSA patdown 6yo girl
[13:02:56] <creep> http://www.youtube.com/watch?v=GKZH2Y0f-7M
[13:02:58] <OndraSter_> the "x" in xmega can mean not just extra, but also expanded
[13:03:06] <RikusW> Malinuss: the whole architecture is different
[13:03:11] <tandoori> thats why i want to use c, so i wont have to worry about all that smaller stuff and focus on the funcionality, if that makes sense
[13:03:11] <OndraSter_> the base is the same as mega, but in the future you can do much more
[13:04:00] <RikusW> mega and xmega even use the same instruction set
[13:04:11] <OndraSter_> yep
[13:04:16] <RikusW> well, xmega got some extra instructions like DES
[13:04:29] <Tom_itx> i was gonna ask that next
[13:04:36] <Malinuss> RikusW, well like I said, if you program in C you don't care all that much about the architecture.... so is there any other difference then the peripherals that are 32bit registers and not 8?
[13:04:43] <dhiltonp> has anyone here used one of these: http://www.digikey.com/product-detail/en/C232HM-DDHSL-0/768-1106-ND/2714139
[13:04:48] <RikusW> the AES is in a module, not an instruction
[13:04:51] <Tom_itx> is xmega 16bit internal?
[13:04:57] <OndraSter_> Tom_itx, no
[13:05:02] <OndraSter_> 8bit registers, everything
[13:05:06] <OndraSter_> but it has got 16bit peripherals
[13:05:12] <OndraSter_> all timers are 16bit etc
[13:05:21] <Tom_itx> no 8 bit timers?
[13:05:21] <RikusW> Malinuss: by arch I mean the registers and all related stuff too
[13:05:36] <OndraSter_> Tom_itx, you can use them as 8bit :)
[13:05:51] <tandoori> hmm what do you lot think about avr dude
[13:05:53] <Tom_itx> i know
[13:06:00] <OndraSter_> there are always 4+2 PWM 16bit channels for each timer
[13:06:05] <Tom_itx> avrdude is a cool dude
[13:06:15] <tandoori> simple to use?
[13:06:18] <OndraSter_> OR you can split the 4PWM timer into 8 PWM 8bit ones
[13:06:23] <Tom_itx> yeah
[13:06:27] <Tom_itx> just cmd line
[13:06:28] <RikusW> tandoori: if you have AS 6 rather use that to program...
[13:06:45] <RikusW> tandoori: and do be really carefull with fuse settings....
[13:06:49] <Tom_itx> i still use notepad to program but use studio to upload
[13:07:03] <Tom_itx> yeah we don't wanna have to bail you out on that
[13:07:08] <RikusW> Tom_itx: Programmers Notepad ?
[13:07:17] <Tom_itx> yes
[13:07:22] <tandoori> RikusW: yes i have AS 6
[13:07:28] <RikusW> tandoori: wrong fuse settings can brick your AVR
[13:07:41] <tandoori> beg pardon?
[13:07:51] <Malinuss> RikusW, but you can unbrick it :)?
[13:07:55] <RikusW> render it unprogrammable...
[13:08:34] <RikusW> Malinuss: yes, either by supplying a clock if you messed up the clock fuses, or using HVPP for things like RSTDSBL or DWEN
[13:09:22] <inductiveload> on this subject, i seem to have got an Xmega-A1 Xplained into some bad state by disabling the JTAGEN fuse (setting to 1) in order to use PDI on a JTAGICE mkII using avrdude on Linux (though I am happy to not use PDI, I heard it was faster, so I tried it)
[13:09:38] <inductiveload> any hope of making it talk to me ever again?
[13:09:56] <OndraSter_> you can use PDI and JTAG
[13:10:02] <OndraSter_> you don't have to disable JTAGEN fuse
[13:10:13] <OndraSter_> (unless it was in some errata)
[13:10:13] <RikusW> inductiveload: in the first place you don't have to disable JTAGEN to make PDI work....
[13:10:30] <inductiveload> according to the Hardware user's Guide "Because JTAG_TDO and PDI_DATA are connected on the PCB for this kit, JTAG must be disabled on the device in order to use PDI. "
[13:10:37] <OndraSter_> lies
[13:10:40] <RikusW> inductiveload: your mkii might be an older on that doesn't support PDI...
[13:11:18] <RikusW> xmega jtag is just a wrapper for pdi anyways...
[13:11:41] <RikusW> its a xmega128A1 on there right ?
[13:11:47] <inductiveload> right
[13:11:56] <RikusW> the dragon don't want to talk to that on on PDI...
[13:11:58] <RikusW> only JTAG
[13:12:10] <RikusW> I'd try a different mkii
[13:12:12] <OndraSter_> no idea why jtag for dragon on a1 chipsets is broken
[13:12:14] <OndraSter_> on a1u it is fine
[13:12:14] <inductiveload> it's a JTAG ICE mkII
[13:12:16] <OndraSter_> err, PDI
[13:12:41] <RikusW> inductiveload: you might even try a AVRISP mkii
[13:12:50] <RikusW> those support PDI programming
[13:13:35] <RikusW> I used a LUFA mkii clone to connect to xm128A1
[13:13:58] <RikusW> inductiveload: do you have atmega32u2 or another usb avr around ?
[13:14:06] <inductiveload> i don't think so
[13:14:21] <inductiveload> as far as i know we only have a mkii and this Xplained
[13:14:37] <inductiveload> though i have a usbasp at home
[13:14:40] <tandoori> okay eat time, brb
[13:14:43] <RikusW> try borrowing a AVRISP mkii somewhere
[13:15:02] <RikusW> or get Tom_itx's clone
[13:15:18] <abcminiuser> Autobiography title: "Bacon is not a condiment"
[13:15:32] <abcminiuser> Now I just need some content...
[13:15:42] <RikusW> bread ? ;)
[13:15:46] <inductiveload> abcminiuser: chapter 1) yes it is.
[13:15:51] <inductiveload> chatper 2) the end.
[13:16:02] <inductiveload> :-D
[13:16:21] <inductiveload> RikusW: so i'm not going to be able to fix it with what i have?
[13:16:45] <RikusW> jtagice mkii should be able to do PDI, but check its version numbers
[13:17:17] <inductiveload> firmware 6.06
[13:17:24] <inductiveload> as far as i know, it's pretty new
[13:17:59] <RikusW> atmel help file -> Note: JTAGICE mkII units with hardware revision 0 do NOT have PDI capabilities
[13:18:11] <abcminiuser> inductiveload, does it hava an internal green LED near the USB connector?
[13:18:16] <inductiveload> yes
[13:18:22] <abcminiuser> Then it can do PDI
[13:18:27] <RikusW> Hardware revision 0 does NOT support the PDI or aWire interface, and have serial numbers starting with A0... as shown here.
[13:18:32] <RikusW> Hardware revision 1 supports both PDI and aWire. Serial numbers start with A09-0041 or B0... as shown here.
[13:18:43] <RikusW> Revision 1 also has a green LED inside the encapsulation, which light up when a USB connection is made. Revision 1 units are also fully RoHS compliant.
[13:18:59] <abcminiuser> RikusW, that's a wordy version of "yup"
[13:19:16] <RikusW> help, copied from the AS4 mkii docs ;)
[13:19:21] <inductiveload> A09-0041/09
[13:19:29] <abcminiuser> Sadface, AS4 :(
[13:19:32] <OndraSter_> our school uses AS4 and AVR Butterfly
[13:19:34] <OndraSter_> :(
[13:19:37] <OndraSter_> very sadface from me
[13:19:42] <RikusW> inductiveload: recheck connections...
[13:19:49] <OndraSter_> if my boards had display I would use my own boards :D
[13:19:59] <RikusW> OndraSter_: sell them your xmega boards ?
[13:20:24] <OndraSter_> but they do not have segment display :(
[13:20:50] <inductiveload> well it did do something when i programmed the fuse (complained about verification), but no connection since
[13:20:52] <RikusW> guess you'll have to use m169 then....
[13:21:28] <inductiveload> just checked the ribbon cable socket, the header connection and the usb connection, all seems OK
[13:21:34] <RikusW> inductiveload: you might have to connect to another pinheader instead...
[13:21:56] <diametric> inductiveload: did you actually set the fuse to disable the reset pin..
[13:22:26] <RikusW> is that required for PDI use ? afaik its not
[13:24:49] <abcminiuser> No it's not
[13:25:09] <abcminiuser> BACON IS NOT A CONDIMENT
[13:25:28] <RikusW> inductiveload: you might have to make a adapter to use PDI
[13:25:44] <diametric> abcminiuser: "A substance such as salt or ketchup that is used to add flavor to food.", I add bacon bits to salads to add bacon flavor. It's a condiment in that context. Checkmate.
[13:26:30] <abcminiuser> It's a foodstuff that shall not be defiled by being used to flavour lesser foodstuffs
[13:27:13] <Malinuss> How is it again. If I have a .h and .c file. And have all the declerations in .h and definitions in .c, how would I do so that some of the functions can only be used in the .c file, and not in lets say the main.c (even though the .h is included)
[13:27:17] <Malinuss> hope it makes sense, lel
[13:27:24] <Malinuss> there should be some kind of macro for it
[13:27:27] <RikusW> inductiveload: seems you need to connect TDI and not TDO to PDI data
[13:27:28] <abcminiuser> Static functions
[13:27:38] <OndraSter_> wait what?
[13:27:42] <OndraSter_> PDI data has got its own pin
[13:27:47] <OndraSter_> on the device
[13:27:50] <OndraSter_> or are we talking programmer?
[13:28:43] <RikusW> Malinuss: don't put it in the .h file
[13:28:50] <RikusW> and static too..
[13:29:09] <Malinuss> RikusW, so just make it static, and don't put it in the .h file.. that makes sense..
[13:29:10] <RikusW> OndraSter_: mkii connections
[13:29:11] <Malinuss> thanks
[13:29:14] <OndraSter_> ahh
[13:29:59] <RikusW> Malinuss: you can put declarations at the top of the .c file if you need to
[13:30:15] <Malinuss> yeah okay.
[13:30:21] <inductiveload> hmm, well since I programmed fusebyte4 to 0x1, that would disable external reset....
[13:30:31] <inductiveload> :-|
[13:32:00] <RikusW1> PDI should still l work
[13:32:39] <inductiveload> the PDI pins on the header appear to be connected to GND, VTref and nSRST on the PCB of the ribbon cable, corresponding to GND, VCC and CLK on the board itself
[13:33:13] <inductiveload> `avrdude -p x128a1 -c jtag2pdi -P usb` gives:
[13:33:23] <inductiveload> avrdude: jtagmkII_setparm(): bad response to set parameter command: RSP_FAILED
[13:33:23] <inductiveload> avrdude: jtagmkII_close(): bad response to GO command: RSP_ILLEGAL_EMULATOR_MODE
[13:37:26] <creep> Homemade nuke http://www.youtube.com/watch?v=XwmHoWfwHiw
[13:38:35] <diametric> nothing has never happened as much as that has never happened.
[13:52:55] <inductiveload> pulldown from TDO/PDI_data doesn't solve it either
[13:54:46] <Tom_itx> mmm bacon grease and pork rinds
[13:57:06] <Steffanx> perhaps you are in the position to try AVR Studio inductiveload, maybe it gives an error you can really do something with
[13:57:32] <Tom_itx> do they use jtag or just pdi?
[13:59:27] <inductiveload> switching to windows is a bit of a pain, i'll probably need to do it tomorrow
[13:59:56] <Steffanx> :P
[14:00:57] <inductiveload> nevermind, i'll sleep on it
[14:01:04] <inductiveload> thanks anyway, people!
[14:01:05] <inductiveload> :_)
[14:01:11] <inductiveload> :-),even
[14:20:08] <Grievre> what /should/ the signal at the xtal pins look like?
[14:22:36] <Casper> sinewave
[14:25:00] * Grievre nods
[15:18:49] <Malinuss> evening
[15:37:04] <tandoori> anyone know of an avrdude plugin for atmel studio?
[15:40:17] <Malinuss> tandoori, can't you just like, run it trough command window every time after compiling ;D?
[15:40:33] <tandoori> maybe
[15:41:09] <Malinuss> properties->Build events->post-build event command line
[15:41:38] <Malinuss> but maybe someone else knows how it is actually suposed to be done :)
[17:12:46] <Tom_itx> tandoori there isn't one
[17:13:05] <Tom_itx> if you use programmers notepad you can run it from the menu
[17:23:51] <Malinuss> or do what I said ;D
[17:24:11] <Malinuss> which would give it the auto-magic feel
[17:24:50] <Tom_itx> or Tools -> Program from the PN menu
[17:25:12] <Tom_itx> once you set it up in your makefile
[17:28:18] <Malinuss> b-but makefiles are scary :o
[17:28:25] <Tom_itx> pfft
[17:28:31] <Malinuss> hehe
[17:28:45] <Tom_itx> studio will even generate them for you you weenie
[17:29:52] <Malinuss> exactly why I use studio hehe
[17:30:01] <Malinuss> automagic yay
[17:30:31] <Tom_itx> i've used it a few times
[17:30:37] <Tom_itx> i'd rather use pn
[17:31:01] <Malinuss> pn?
[17:31:24] <Tom_itx> programmers notepad
[17:33:02] <Malinuss> ah
[21:37:03] <Tom_L> http://www2.electronicproducts.com/How_NXP_and_Cherry_s_battery_less_wireless_switch_works-article-fajb_CES_nxp_cherry_switch_jan2013-html.aspx
[21:49:02] <damjan> very cool
[22:12:21] <Tom_itx> jadew, were you playing with bootloaders the other day?
[22:12:27] <Tom_itx> if not you... who was it..
[22:14:13] <jadew> I was
[22:14:17] <jadew> why do you ask?
[22:14:26] <Tom_itx> i just found it in the logs :)
[22:14:35] <Tom_itx> just curious
[22:14:35] <Tom_itx> did you get it working?
[22:14:52] <jadew> yeah
[22:15:22] <Tom_itx> what's that bootloader do?
[22:15:28] <jadew> avrdude was broken
[22:15:39] <jadew> what do you mean?
[22:15:46] <Tom_itx> did you use it?
[22:15:49] <jadew> yeah
[22:15:58] <Tom_itx> what does it do?
[22:16:18] <jadew> it writes the firmware over the serial connection
[22:16:21] <Tom_itx> k
[22:16:27] <Tom_itx> that's what i wondered
[22:16:35] <Tom_itx> similar to arduno
[22:17:06] <jadew> well, probably arduino is similar to this one
[22:17:14] <jadew> since this is from an app note from atmel
[22:17:16] <jadew> avr109
[22:18:05] <Tom_itx> yeah i just grabbed it
[22:18:50] <Tom_itx> does it work with gcc?
[22:18:56] <Tom_itx> you had to edit something...
[22:19:02] <jadew> yeah, it works
[22:19:20] <jadew> I don't know if you have to edit it for every chip
[22:19:31] <jadew> it might depend on the avrdude config
[22:20:00] <jadew> for atmega8 avrdude is sending the address in bytes, while the bootloader expects it in words
[22:20:00] <Tom_itx> oh, it's got a gcc directory as well as iar
[22:20:11] <Tom_itx> what about a 328
[22:20:15] <jadew> commenting out the part that handles the words in the bootloader fixed the issue
[22:20:34] <jadew> I don't know, didn't try it, but I suspect it's the same config
[22:20:57] <Tom_itx> default mcu is 168 so it should be ok
[22:21:41] <jadew> yeah, I noticed
[22:21:56] <Tom_itx> might have to change the base address in the makefile
[22:21:58] <jadew> maybe the avrdude guy got it wrong or never tried it
[22:22:06] <jadew> yeah, you have to do that too
[22:22:18] <jadew> however, I failed to compile it with a different base address
[22:22:30] <Tom_itx> really?
[22:22:35] <jadew> which means you are kinda stuck with a 1k bootloader section
[22:22:44] <jadew> altho it fits in 256 bytes
[22:22:52] <jadew> yeah, I'm sure that can be fixed, but I didn't have time
[22:24:06] <Tom_itx> i don't have a purpose for it right now just looking
[22:24:32] <jadew> it's deffinitely good to have around
[22:24:53] <jadew> I wouldn't have needed it either, but I forgot to add an ISP socket on that project and tbh didn't had the space either
[22:25:09] <jadew> loading the software over serial, which was there anyway, made it a lot easier to route
[22:25:29] <Tom_itx> what is the base address?
[22:25:36] <Tom_itx> in relation to the bootloader section of flash
[22:25:57] <Tom_itx> the data sheet says it's 0x0FFF
[22:26:03] <Tom_itx> not 0x1800
[22:26:27] <jadew> Tom_itx, the base address in the makefile is in bytes
[22:26:36] <jadew> while the one in the datasheet is in words
[22:26:38] <jadew> so F00 * 2
[22:26:53] <jadew> and it's actually at the end
[22:27:02] <jadew> so xxK - Base Address
[22:28:46] <Tom_itx> F00?
[22:29:12] <jadew> yeah, that's what it said for me I think
[22:29:24] <Tom_itx> what chip?
[22:29:25] <Tom_itx> 8
[22:29:26] <Tom_itx> ?
[22:29:29] <jadew> yeah
[22:29:31] <jadew> let me check
[22:29:54] <Tom_itx> $FFF
[22:30:07] <Tom_itx> is the end
[22:30:14] <jadew> wait
[22:30:25] <jadew> C00 for 1024
[22:30:46] <Tom_itx> do you figure back from the end of flash?
[22:31:00] <jadew> yeah
[22:31:18] <jadew> wait
[22:31:21] <jadew> not from the end
[22:31:26] <jadew> but it's at the end
[22:31:33] <jadew> it's 1024 from the end
[22:32:05] <jadew> FFF - C00 = 1023
[22:32:20] <jadew> I suppose it's F000
[22:33:08] <jadew> hold on
[22:33:10] <jadew> this doesn't make sense
[22:33:28] <Tom_itx> fff-1023 is c00
[22:33:53] <jadew> yeah, it's not F000, it's 1000
[22:34:22] <Tom_itx> so you would set that number in the makefile as the bootsize subtracted from the end of flash?
[22:34:24] <jadew> however, I don't understand why 1000
[22:34:38] <jadew> which is 4096
[22:34:50] <Tom_itx> so if you boot size is 1024 you would subtract that from the end of flash for the number to enter in the makefile?
[22:35:06] <Tom_itx> set by your boot fuses
[22:35:12] <jadew> that's the thing that doesn't make sense
[22:35:20] <jadew> the fuses are set for 1024 (C00)
[22:35:28] <Tom_itx> your boot size is set by fuses
[22:35:38] <Tom_itx> so don't you figure that back from the end of flash?
[22:35:44] <Tom_itx> to set for your makefile
[22:35:59] <Tom_itx> i want to figure this out
[22:36:15] <Tom_itx> even though i may never use it
[22:36:22] <jadew> ok, C00 is the address in words, where the bootloader starts
[22:36:38] <jadew> so 3072
[22:36:55] <Tom_itx> i'm gonna look at the 168 example since that's what they used
[22:36:57] <jadew> 3072 * 2 (to get it in bytes) is 6144
[22:37:11] <Tom_itx> so the end of flash for the 168 is 0x1FFF
[22:37:22] <Tom_itx> and the boot size is 1024 right?
[22:37:26] <jadew> yes
[22:38:18] <jadew> so 0x2000 - 1024
[22:38:18] <jadew> that's what you have to have as the base address
[22:38:18] <Tom_itx> so the address for the makefile should be 0x1C00
[22:38:18] <Tom_itx> right?
[22:38:20] <Tom_itx> for that example
[22:38:32] <jadew> it appears so
[22:39:08] <Tom_itx> so if i changed the BASEADDR = 0x1800 to 0x1C00 it should work
[22:39:29] <jadew> yeah
[22:39:52] <Tom_itx> what does the terminal program see when it's in boot mode?
[22:40:04] <Tom_itx> or how do you trigger it
[22:40:43] <jadew> you hold a button down (you can configure it) before powering it up
[22:40:50] <Tom_itx> ahh you use a pin to enter boot mode
[22:40:56] <jadew> yeah
[22:41:09] <jadew> this boot address thing still doesn't make sense
[22:41:11] <jadew> hold on
[22:41:26] <Tom_itx> do you remember what the default was?
[22:41:35] <jadew> 1800
[22:41:52] <jadew> fuse calculator says that for 1024 bytes, the address is C00 (in words)
[22:42:08] <jadew> C00 * 2 = 1800
[22:42:18] <Tom_itx> for which chip?
[22:42:24] <jadew> for mega8
[22:42:31] <Tom_itx> the 8 or 168
[22:42:31] <Tom_itx> ok i'll buy that
[22:42:41] <Tom_itx> but the makefile says it's for a 168
[22:42:55] <Tom_itx> MCU =
[22:43:07] <jadew> Tom_itx, it has 8k of flash too, no?
[22:43:17] <jadew> oh
[22:43:18] <jadew> nvm
[22:43:21] <jadew> it's 1024 words
[22:43:22] <jadew> not bytes
[22:43:28] <jadew> so you're pissing away 2k
[22:43:29] <jadew> nice
[22:44:02] <jadew> I'm sure I can make a smaller bootloader
[22:44:15] <jadew> something that can fit in 128 bytes for example
[22:44:19] <jadew> *128 words
[22:44:44] <jadew> that's 256 bytes - plenty!
[22:44:44] <Tom_itx> so if you can set the boot fuse for 1024 that should be big enough?
[22:44:44] <Tom_itx> i'm not sure you can
[22:44:44] <Tom_itx> the system would ignore it though wouldn't it?
[22:44:44] <Tom_itx> based on the boot size fuse
[22:45:04] <jadew> what system?
[22:45:09] <Tom_itx> the chip
[22:45:26] <Tom_itx> the boot size fuse tells it where to look... right?
[22:45:30] <jadew> well, the fuse tells it where to jump the moment it boots up
[22:45:40] <Tom_itx> you just have to match that in your makefile
[22:45:46] <jadew> yeah
[22:46:03] <jadew> it jumps there, runs the code at that address and the code there will then jump to the default resent handler (at 0)
[22:46:32] <Tom_garage> dammit
[22:48:02] <Tom_itx> the 8 can have 128 words
[22:48:11] <Tom_itx> up to 1024 words
[22:48:34] <Tom_itx> and studio tells you the boot address
[22:48:34] <jadew> yeah, but the linker complained when I tried to use any other value than 1800
[22:48:55] <Tom_itx> for the 8 at 1024 it's $0C00
[22:49:07] <Tom_itx> *2
[22:49:29] <jadew> yeah
[22:49:31] <Tom_itx> which is 1800
[22:49:34] <Tom_itx> so that's right
[22:49:50] <jadew> yeah
[22:49:52] <Tom_itx> but you can change the fuse to a smaller boot size
[22:49:53] <Tom_itx> and then fix the address
[22:50:03] <jadew> yeah, but it won't compile
[22:50:10] <Tom_itx> so studio sees words but gcc sees bytes
[22:50:17] <Tom_itx> it won't?
[22:50:26] <jadew> I couldn't compile it with gcc
[22:51:03] <Tom_itx> so 1F00 for 128 words
[22:51:10] <Tom_itx> i'm gonna try that
[22:51:15] <jadew> it won't fit in 128
[22:51:23] <jadew> you should run the xls
[22:51:25] <Tom_itx> words?
[22:51:28] <Tom_itx> how?
[22:51:35] <jadew> double click on it
[22:51:35] <jadew> :P
[22:51:35] <Tom_itx> i've never used em
[22:51:38] <jadew> it's a spreadsheet
[22:52:09] <jadew> you specify the chip you have and the boot size and it will give you the config you need to enter in defines.h
[22:52:18] <jadew> it will also tell you if the boot size is enough or not
[22:58:18] <Tom_itx> sleep time