#avr Logs

Mar 13 2018

#avr Calendar

12:09 AM z999: hi
12:19 AM * Xark links https://img00.deviantart.net/dfc0/i/2011/167/d/e/bill_the_cat_by_combatcrayola97-d3j3fc0.jpg
12:19 AM Thrashbarg: to which SYN is he ACK-ing to?
12:19 AM Xark: I'd imagine most of them...
12:23 AM day__ is now known as day
12:47 AM polprog: morning
12:47 AM polprog: heh i know that cat :)
03:07 AM ThatDamnRanga is now known as ThatDamnExRanga
07:18 AM Aslak3_ is now known as Aslak3
10:13 AM aivkiv_ is now known as aivkiv
11:51 AM nabil: I want to use a solar panel in a project of mine, and I'm looking for a good ressource about it to know more about it ...
11:51 AM nabil: Do you know any, or have you been in a similar situation and found a good book/article/link that helped?
11:57 AM Emil: eh?
11:59 AM Emil: Solar panels are just variable voltage/current sources with some caveats
11:59 AM Emil: like needing a diode to prevent flowback if you have capacitive elements and mptt being actually rather useful
12:00 PM Ameisen: Don't you usually want a rectifier?
12:00 PM Ameisen: so the flowback can be used
12:01 PM Emil: ...
12:01 PM Emil: just... no
12:02 PM theBear: i've usually got a silly large (for personal/domestic use) collection of rectifiers before i even consider wanting one, cos erm, i just inherited various "ridiculous quantity of X diode/bridges" over the years
12:02 PM theBear: but i think most people usually want one, like erm, i usually want a beer ;-)
12:03 PM Emil: mppt*
12:04 PM Emil: Ameisen: your solar panel is a source of energy but it's also an energy sink
12:05 PM Ameisen: https://www.thingiverse.com/thing:331609
12:05 PM Ameisen: just hook that up to a generator.
12:05 PM Ameisen: bam, infinite energy
12:06 PM Thrashbarg: extract the infinite yield of zero point energy!
12:06 PM Ameisen: I don't think 3d printers are precise enough to print on the scale required for ZPE
12:59 PM Ameisen: now doing a build for the arm toolchain using the latest binutils and gcc master
12:59 PM Ameisen: so gcc 8
12:59 PM Emil: Nice
12:59 PM Ameisen: we'll see how that goes
01:00 PM Ameisen: already was able to build all the libs with LTO
01:00 PM Ameisen: it makes 100% sense for static libraries to be built with LTO, to me
01:00 PM Ameisen: probably would benefit AVR as well
01:07 PM PsySc0rpi0n is now known as HelloShitty
01:37 PM Emil: Ameisen: really, do I have to write my own startupcode?
01:38 PM Emil: newlib doesn't provide that?
01:38 PM Emil: What a load of fucking thick bullshit
01:38 PM Emil: I'd rather choke on shit than waddle through this bullshit
01:46 PM polprog: lol
02:02 PM Ameisen: Why would newlib provide startup code
02:02 PM Ameisen: newlib is architecture agnostic
02:03 PM Ameisen: It has no way to know how to initialize the 50 quadrillion ARM variants
02:05 PM polprog: good point
02:09 PM Emil: Ameisen: that's not really true at all
02:10 PM Emil: The core is ARM and same on all devices
02:10 PM Emil: peripherals are different
02:20 PM Ameisen: the core of ARM doesn't really specify much about how to start it up
02:20 PM Ameisen: that's almost entirely specific to the maker
02:20 PM Ameisen: the startup code between NXT and STM, for instance, is very different
02:24 PM Ameisen: NXP*
02:28 PM McDonaldsWiFi is now known as GNUplusWifi
02:28 PM GNUplusWifi is now known as McDonaldsWiFi
04:12 PM Santh_ is now known as Santh
04:15 PM gregor2: I am having Problems programming my AtMega2561.
04:17 PM gregor2: I have connected mosi, miso, sck, gnd and reset to an uspasp.
04:18 PM gregor2: Vcc ang gnd are provided with 5V but it says device not responding.
04:18 PM gregor2: i am using avrdude
04:19 PM gregor2: whats going on there?
04:20 PM Tom_L: usbasp may not program the big chips... i'm not entirely sure
04:21 PM Tom_L: but it may have a memory boundary limit
04:21 PM Tom_L: ALL VCC and GND connected?
04:22 PM polprog: run avrdude in verbose mode... maybe that would tell you a bit more? never used the big chips
04:22 PM Tom_L: another must...
04:22 PM polprog: that too
04:22 PM polprog: :)
04:22 PM Tom_L: bbl
04:22 PM polprog: cya
04:26 PM gregor2: I will try that when i am back home
04:26 PM gregor2: in 1:30
04:26 PM gregor2: I have tried to read the program from the chip.
04:27 PM gregor2: Is it possible that this is causing it?
04:27 PM gregor2: So it fails to adress the whole flash memory?
04:29 PM gregor2: so it just says not responding?
04:38 PM Emil: gregor2: gnd to gnd, vcc to vcc, mosi to mosi, miso to miso, sck to sck and rst to rst
04:39 PM Emil: and
04:39 PM Emil: your issue is probably the clock speed
04:39 PM Emil: add the slow clock jumper on the usbasp
04:39 PM Emil: then it works
04:40 PM Emil: (also disable the fuse that divides clock internally by 8 to allow fast uploads again)
04:51 PM gregor2: i have already slowed down the clock
04:51 PM gregor2: With the -B option of avrdude
04:52 PM xoomas: hmm have strange problem
04:52 PM xoomas: trying to read i2c eeprom
04:53 PM xoomas: but after address 127 get like garbage data
04:56 PM xoomas: address = read() << 8; address |= read();
04:56 PM xoomas: im doing address good?
05:06 PM gregor2: Can it be, that it is not possible to program an atmega2561 asp
05:06 PM Emil: gregor2: not the same thing
05:07 PM gregor2: ...to program an atmega2561 with an usbasp?
05:07 PM Emil: using -B iirc
05:07 PM gregor2: What?
05:09 PM xoomas: can someone help
05:10 PM gregor2: with the i2c?
05:10 PM xoomas: if im reading eerpom and hardcode address.. it reads ok
05:10 PM xoomas: yes
05:10 PM xoomas: but if make address from 2 bytes
05:10 PM gregor2: I2C transmitts one byte at a time.
05:10 PM xoomas: i know
05:11 PM gregor2: Maybe you can only address the first part because of this.
05:11 PM xoomas: if i make address from 2 bytes its starts addressing wrong
05:11 PM xoomas: for example i can read like this: read_eeprom(1023)
05:11 PM xoomas: reads correctly from 1023 address
05:12 PM gregor2: how is it addressing?
05:12 PM xoomas: but if i make address like this
05:12 PM xoomas: address = read() << 8; address |= read();
05:12 PM xoomas: its not rading
05:12 PM xoomas: and looks like max i can read is 127
05:13 PM xoomas: exactly on eight bit its starts behaving wrong
05:13 PM gregor2: maybe the second byte is not interpreted as part of the address
05:13 PM xoomas: i tryed to debug
05:13 PM xoomas: by sending back
05:13 PM gregor2: first comes the i2c address
05:13 PM xoomas: both bytes
05:14 PM gregor2: then comes the address in memory
05:14 PM gregor2: and the third byte is the data
05:14 PM xoomas: but why if i do like this: read_eeprom(1023)
05:14 PM xoomas: it works
05:14 PM gregor2: Or
05:14 PM xoomas: there is 2 bytes of address
05:14 PM gregor2: you need to shift the bytes
05:15 PM xoomas: its 24c08 eeprom
05:15 PM xoomas: [00:11:25] <xoomas> address = read() << 8; address |= read();
05:15 PM Emil: isn't 1023 the general call address?
05:15 PM xoomas: i though i did
05:15 PM gregor2: Maybe you are sending them in the wrong order
05:15 PM Emil: so everyone would answer
05:15 PM xoomas: Emil its not i2c address
05:15 PM xoomas: its memory adress
05:16 PM gregor2: wrong order of the bytes maybe.
05:16 PM xoomas: let me try
05:16 PM polprog: my bet ^
05:16 PM Emil: what type are address and read()
05:17 PM xoomas: uint16_t
05:18 PM xoomas: read is uint8_t
05:18 PM Emil: well so
05:18 PM Emil: sometimes C fucks with you
05:18 PM Emil: and read()<<8 might result in 0
05:18 PM xoomas: if i try to read in other order bytes
05:18 PM xoomas: its still same problem
05:19 PM Emil: so why don't you just print out the address?
05:19 PM gregor2: oh yes
05:19 PM xoomas: i have only 8bits
05:19 PM xoomas: address is 16 bits
05:19 PM gregor2: maybe try typecast
05:19 PM xoomas: or i have to split it again to send it back
05:20 PM gregor2: ((uint16_t) read())<<8
05:22 PM xoomas: ill try first add one more variable
05:22 PM xoomas: to read fisrt then shift
05:22 PM xoomas: nop
05:22 PM xoomas: same
05:23 PM xoomas: but strange is that only with 7th bit that happens
05:23 PM xoomas: for example address 00 7F works ok
05:23 PM xoomas: but 00 80 not
05:24 PM xoomas: it read from eerpom but reads like address++
05:24 PM xoomas: and you can send same address many times
05:24 PM xoomas: it still reads ++
05:25 PM xoomas: gregor2 any ideas?
05:28 PM xoomas: or im counting 24c08 size incorectly
05:28 PM xoomas: and there is no 1024 bytes
05:29 PM Emil: 024c08 is 2*2^16+4c08 bytes
05:30 PM xoomas: ?
05:30 PM Emil: which is a little over 128k
05:31 PM xoomas: 24C08 eeprom
05:31 PM Emil: ah
05:31 PM xoomas: have over 128k bytes?
05:32 PM xoomas: i think its 8Kbits
05:32 PM xoomas: = 1024bytes
05:33 PM xoomas: or 1KB
05:34 PM polprog: 1kB
05:34 PM polprog: so adresses from 0 to 1024
05:35 PM xoomas: 1023*
05:37 PM xoomas: hmm
05:37 PM xoomas: now looking with scope on i2c transmision
05:37 PM xoomas: after 7F it changes a lot
05:38 PM polprog: yeah 1023
05:38 PM polprog: mmm. it uses this weird "block address" as 3 lsb of the i2c addrress
05:39 PM xoomas: yes
05:39 PM xoomas: https://pastebin.com/EWfqUUfp
05:40 PM xoomas: im doing like that
05:40 PM xoomas: for this
05:40 PM polprog: why >>7
05:40 PM polprog: ?
05:40 PM xoomas: #define EE_ADDR 0xA0
05:41 PM xoomas: to match on block bits
05:41 PM polprog: why not shift by 8?
05:41 PM polprog: ah.
05:45 PM xoomas: im just thinking why it changes so much on scope
05:45 PM xoomas: but on paper it looks ok :D
05:49 PM xoomas: maybe problem can be gere? i2c_write((uint8_t)(addr & 0xFF));
05:54 PM polprog: gcc -S :P
05:59 PM polprog: enter the world of craziness
06:04 PM Emil: xoomas: why do you have so much crap on that function?
06:04 PM Emil: if i2c_write accepts only uint8_t then you can just do i2c_write(addr);
06:06 PM polprog: i2c_write(auto addr){...}
06:08 PM polprog: :P
06:09 PM Emil: staph :D
06:09 PM Emil: you might as well overload
06:09 PM Emil: for clarity
06:10 PM Emil: but what's more concerning
06:10 PM Emil: is that i2c_write would only accept address
06:10 PM Emil: like, it should be write(address, data, length)
06:10 PM Emil: or write(address, data)
06:11 PM polprog: i like the 3 param one more
06:11 PM polprog: especially if it could write in bulk.
06:11 PM polprog: write(uint16_t addr, uint8_t* data, uint8_t len);
06:20 PM Emil: yup
06:21 PM Emil: In theory uint16_t len would be more foolproof but that's an unlikely scenario
06:22 PM polprog: indeed
06:22 PM polprog: this reminds me i should write a 24c08/c16 program on avr
06:23 PM polprog: as i never did i2c really :D
06:28 PM polprog: allright
06:28 PM polprog: gooodnight everyone
06:28 PM gregor2: guys pleas help me
06:28 PM gregor2: I still have the same problem as before.
06:29 PM gregor2: I cant program my atmega2561 with the usbasp.
06:29 PM gregor2: Why is that?
06:29 PM gregor2: Is it maybe not even possible?
06:31 PM Emil: it is supported
06:32 PM gregor2: What should i do now?
06:32 PM gregor2: it is all connected the right way
06:32 PM gregor2: i have already done this with an atmega328p.
06:33 PM gregor2: Is the footprint from the datasheet from top or bottom view?
06:33 PM gregor2: There is nothing i can do anymore.
06:34 PM gregor2: It says target does not answer.
06:34 PM gregor2: avrdude -p m2561 -B 250 -i 250 -c usbasp -U lfuse:r:file.hex:m -vvv -F
06:34 PM gregor2: This is the command
06:43 PM gregor2: Please help
06:52 PM gregor2: please
07:14 PM Tom_L: oh.. did you figure out the 2561?
07:14 PM Tom_L: i know at least one the isp isn't on the spi
07:14 PM gregor2: no!!
07:14 PM gregor2: What does that mean?
07:14 PM Tom_L: make sure what program pins
07:14 PM Tom_L: mega128? maybe
07:14 PM gregor2: What do you mean?
07:14 PM Tom_L: hang on
07:14 PM gregor2: i have an atmega2561
07:14 PM Tom_L: i know that
07:14 PM gregor2: What do you know?
07:14 PM Tom_L: lots
07:14 PM Tom_L: what do you want to know?
07:16 PM gregor2: how can i program that thing?
07:16 PM Tom_L: on the mega128 the program pins are PDO PDI not MISO MOSI
07:16 PM Tom_L: i'm telling you to check for that
07:16 PM gregor2: Its too late
07:16 PM Tom_L: it's never too late
07:16 PM gregor2: i have already ordered a pcb
07:16 PM Tom_L: i don't care
07:16 PM Tom_L: you can still check
07:17 PM theBear: heh, of course he can't Tom_L ! he's ORDERED A PCB now... that's game over man.... game over !
07:17 PM gregor2: can i use PD0 and PDI with usbasp?
07:17 PM * theBear giggles a little
07:17 PM Tom_L: i'm telling you, you need to find out
07:18 PM Tom_L: I WAS RIGHT!!!!!
07:18 PM Tom_L: you wired the wrong pins
07:18 PM gregor2: PDO and PDI are not connected on my pcb
07:19 PM Tom_L: https://www.avrfreaks.net/forum/atmega2561-isp-programming-problem
07:19 PM gregor2: now i cant program that?
07:19 PM gregor2: sp stupid
07:19 PM Tom_L: you can cut the traces and run jumper wires
07:19 PM Tom_L: well you did ask....
07:19 PM gregor2: and what does mosi and miso do then?
07:19 PM Tom_L: they do SPI like they're supposed to
07:20 PM gregor2: and isp is PDO and PDI?
07:21 PM Tom_L: you still need to do your homework and verify what i'm saying is correct
07:21 PM gregor2: I beleve you
07:21 PM Tom_L: but i'm saying i ran into that very thing on the mega128
07:21 PM gregor2: and can i configure the atmega2561 to use mosi and miso?
07:21 PM gregor2: With fuse bits for example?
07:22 PM Tom_L: Data sheet doc2549.pdf Rev H, shows that the 64 pin mega2561 follows the pinout and programming pin
07:22 PM Tom_L: designation convention of the mega128, while the 100 pin mega2560 follows the more standard convention
07:22 PM Tom_L: of using the MISO/MOSI designated pins for serial programming.
07:22 PM Tom_L: see not all avr are created equal
07:22 PM Tom_L: you found the black sheep
07:23 PM gregor2: but cant i use mosi and miso for programming to?
07:23 PM Tom_L: NO
07:24 PM gregor2: SPI?
07:24 PM gregor2: what is that?
07:24 PM Tom_L: a data protocol
07:24 PM gregor2: cant be used for programming?
07:25 PM * Tom_L gives up
07:25 PM gregor2: ok
07:25 PM gregor2: now
07:25 PM gregor2: for programming
07:25 PM gregor2: i just need to touch the pins right/
07:25 PM gregor2: ?
07:25 PM gregor2: why cutting any traces?
07:25 PM Tom_L: let me show you something about programming
07:25 PM Tom_L: well it might work
07:26 PM Tom_L: depending what you have connected to those other pins
07:26 PM gregor2: just dont shake
07:26 PM gregor2: nothing at all
07:26 PM gregor2: PDI, PDO are unconnected
07:27 PM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/attiny2313/attiny3.jpg
07:27 PM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/attiny2313/attiny9.jpg
07:27 PM Tom_L: programming fixture i did
07:27 PM Tom_L: i ended up holding them on with my thumb though
07:29 PM Tom_L: <gregor2> PDI, PDO are unconnected
07:29 PM Tom_L: therein lies your problem
07:29 PM Tom_L: theBear, give him some honey
07:29 PM Tom_L: so he feels better
07:31 PM Tom_L: gregor2, you doing a 6pin program header?
07:31 PM gregor2: you ended up like this to?
07:31 PM Tom_L: no i fixed mine
07:31 PM gregor2: No
07:31 PM gregor2: you fixed it
07:31 PM gregor2: But you did a wrong ourder to?
07:32 PM Tom_L: on the 128
07:32 PM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/boards/atmega128_exp_1.jpg
07:33 PM Tom_L: i ran jumpers on the bottom
07:40 PM theBear: without even having worked with any avr's that big or modern, or knowing anything much about usbasp specifics, i pretty sure that yer pdi/o stand for ProgrammingDigital?Input/Output, and i used to remember what MISO/MOSI stood for, i gonna go with megacool inSerialOut , and vice-versa opposite direction version... and then i can add the fact/prior-knowledge that various avr devices have variously arranged multi-purpose pins (that you can choose the
07:40 PM theBear: purpose/definition of with/in your software or maybe the odd fuse setting), and that even if many have MISO/MOSI pins shared function with programming pins, this is no reason to assume that it is so, or that MISO/MOSI are in fact programming pins, even if perhaps various un-enlightened blind-leading-the-blind kinda website and forum and generally a large portion of those introduced to the avr scene via arduino which seems to have a culture of obscuring
07:40 PM theBear: any actual facts or information from the person using/owning the things, just cos one or two of them may have foolishly said to connect to MISO/MOSI for programming, when they shoulda said the programming pins on your specific device, and if giving an example schem/diagram should have shown the used pins as programming (because that IS what they were doing in that schematic/situation/scenario, rather than being one of their other possible config'able
07:40 PM theBear: functions, which will only confuse matters if marked as such)
07:42 PM theBear: and while that may sound a little on the err, gettin' told off side of things, theBear ain't built in a way that allows him to do that reprimanding kinda talking or thinking, it's sposed to be a kinda rambling "cheer up, just cos yer got pointed the wrong way in the past, doesn't mean yer can't fix it now AND learn a bunch of useful general knowledge that will allow you to workout similar issues yourself in the future"
07:43 PM theBear: i also heard the usbasp dude or dudes ain't no fools, so likely at least the docs specific to that side of things, are likely to be sanely laid out and have things labelled as what they should be for the programmer to work, rather than some random other marking/word that they maybe seen written near that same pin somewhere in the past
07:44 PM * theBear acts casual, all none-the-wiser style, like he has no idea what dude or dudes he just referred to :)
07:57 PM enh: Hi people
07:58 PM enh: I've moved to the far north of Brazil, where connectivity is not a very well known thing
07:58 PM enh: Anybody ever heard of LambdaAurigae again?
07:58 PM enh: nickserv info Lambda_Aurigae
07:59 PM enh: Last seen : Nov 10 23:01:58 2017 (17w 4d 1h ago)
08:00 PM enh: Hi cehteh
08:00 PM enh: Hi polprog
08:07 PM gregor2: still not working
08:07 PM gregor2: I have connected MOSI with PDI and MISO with PDO now.
08:07 PM gregor2: Still not working.
08:10 PM theBear: wait, you did what ?
08:11 PM theBear: have you even looked at the datasheet for your avr, which generally you gonna refer to so often it makes sense to just leave it open on yer screen constantly while avr'ing, to see what those acronym/pin names actually mean, and which ones maybe you want to connect to a programmer
08:12 PM Tom_L: :=)
08:13 PM theBear: Tom_L, i know i lack the skill of succinct-ness, but surely those couple lines i wrote a little while ago don't appear to suggest connecting well, any pins to any other pins on the micro itself, do they ?
08:13 PM gregor2: There it says that it can be programmed with Serial downloading what ever that is
08:14 PM gregor2: and that the PDI, PDO and SCK pins are used for that.
08:14 PM theBear: you should also be looking at a dixctionary or glossary or something, among other things you NEED to lookup what "ISP" stands for
08:15 PM Tom_itx: Both the Flash and EEPROM memory arrays can be programmed using a serial programming
08:15 PM Tom_itx: bus while RESET is pulled to GND. The serial programming interface consists of pins SCK, PDI
08:15 PM Tom_itx: (input) and PDO (output). After RESET is set low, the Programming Enable instruction needs to
08:15 PM Tom_itx: be executed first before program/erase operations can be executed.
08:16 PM gregor2: With the avr isp one can programm with isp
08:16 PM theBear: and what kind of programmer a usbasp is ... the homepage for it at www.fischl.de/usbasp/ seems to clearly say that in the first sentence/title by-line
08:16 PM gregor2: an usbasp is kind of the same
08:16 PM gregor2: i did that with atmega328p
08:16 PM gregor2: and the pins are called mosi, miso and sck
08:16 PM Tom_L: the next issue you will likely face is the asp won't read all the memory that chip has
08:16 PM theBear: kind of the same as what ? you said earlier you using a usbasp, and haven't mentioned any other programming hw
08:17 PM gregor2: doesnt matter
08:17 PM Tom_L: it is an entirely different chip
08:17 PM gregor2: it is an isp programmer
08:17 PM Tom_L: 80% of all avrs are programmed using ISP
08:17 PM Tom_L: the other percent use PDI or TPI
08:17 PM Tom_L: which include xmega for PDI
08:18 PM Tom_L: and attiny 4 5 9 10 20 etc for TPI
08:18 PM Tom_L: and possibly a few others
08:18 PM Tom_L: the bulk of them use ISP
08:19 PM theBear: oh, earlier that PDI and PDO i commented on, where they actually PD1 and PD0 ? i'm starting to think they were, and i'm a bit slow today
08:19 PM Tom_L: may be a coincidence i dunno
08:20 PM theBear: good thing i qualified the comments with clear mention of them being me guessing, and having not looked at ANY related reference materials anytime recently, IF at all, ever
08:20 PM gregor2: No they are called PDI and PDO.
08:20 PM gregor2: yes
08:20 PM gregor2: but this one cant be programmed using isp?
08:21 PM theBear: wow, what do those stand for ? and by "they" i'm tempted to ask what chip has those pins
08:21 PM Tom_L: PDI is on PE0 and PDO is on PE1
08:21 PM gregor2: It is programmed using SPI.
08:21 PM Tom_L: yes
08:21 PM Tom_L: no
08:21 PM Tom_L: ISP
08:21 PM Tom_L: forget about SPI
08:21 PM theBear: read the fucking datasheet ! all the stuff like programming methods it is capable of are listed on like, the 2nd page, 1st maybe, before the effing table of contents even !
08:21 PM gregor2: in the datasheet it says SPI.
08:22 PM Tom_L: they just used the pins because it was a serial stream
08:22 PM Tom_L: but PDI PDO is also a serial stream
08:23 PM * theBear points at his earlier ramble regarding how pins often have several functions on a single given avr, and in many and sometimes all ways, those functions are completely unrelated to one another
08:24 PM theBear: in others one might suspect some shared pins were chosen to take advantage of some internal hw like maybe a uart of some kind being connected, and therefore not needing to be messed around internally when the function is different
08:24 PM gregor2: in the datasheet there is only SPI, Parallel and JTAG.
08:24 PM gregor2: it seems like it cant be programmed different.
08:25 PM theBear: it says a ton of stuff, literally hundreds of pages, you gotta use more words, cos we can't read your mind or even see what you are looking at/reading at a given time
08:25 PM gregor2: i am looking at the capture 30
08:25 PM gregor2: memory programming
08:26 PM gregor2: if ISP isnt listed there i am assuming it is not supported
08:26 PM Tom_L: let's try this again...
08:26 PM theBear: the what ? i don't even know what chip you got, or what a capture 30 is
08:26 PM theBear: tho it don't matter much, cos i ain't in the mood to be reading peoples datasheets to them
08:27 PM Tom_itx: • PDO/TXD0 – Port E, Bit 1
08:27 PM Tom_itx: PDO, SPI Serial Programming Data Output. During Serial Program Downloading, this pin is
08:27 PM Tom_itx: used as data output line for the ATmega1281/2561. For ATmega640/1280/2560 this function is
08:27 PM Tom_itx: placed on MISO.
08:27 PM Tom_itx: • PDI/RXD0/PCINT8 – Port E, Bit 0
08:27 PM Tom_itx: PDI, SPI Serial Programming Data Input. During Serial Program Downloading, this pin is used
08:27 PM Tom_itx: as data input line for the ATmega1281/2561. For ATmega640/1280/2560 this function is placed
08:27 PM Tom_itx: on MOSI.
08:27 PM Tom_L: that's all you need to know about it
08:27 PM Tom_L: .
08:28 PM Tom_L: did i happen to mention not all avrs are created equal??
08:28 PM theBear: cool, now i know what PDI/O stand for, and what pins you connect to program a handful of fancy new-series avr's i won't see for years yet, if ever :)
08:28 PM Tom_L: well at least somebody got something from it
08:29 PM gregor2: But i still dont know if i will be able to program it with my usbasp
08:29 PM gregor2: and how
08:29 PM Tom_L: just hook it up and use it
08:29 PM theBear: i like something new every day, but thismorning i've got maybe 3 already, it ain't even lunchtime yet ! i should probably take the next few days off from learning things <grin>
08:29 PM gregor2: and how?
08:29 PM Tom_L: it's a serial programming protocol
08:29 PM gregor2: the usbasp has a mosi miso and sck pin
08:29 PM Tom_L: they decided to use other pins just to mess with your brain
08:30 PM Tom_L: great
08:30 PM Tom_L: then you're all set
08:30 PM gregor2: i connected them to mosi miso and sck on the atmega2561 and
08:30 PM gregor2: ...not working
08:30 PM Tom_L: did i happen to mention i've used a few of em?
08:30 PM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/boards/mini_usb_batch1.jpg
08:30 PM gregor2: i connected them to PDI,PDO and sck on the atmega2561 and
08:30 PM gregor2: ...not working again
08:31 PM Tom_L: what does it say?
08:31 PM gregor2: device does not answer
08:31 PM gregor2: like nothing is connected.
08:31 PM Tom_L: is the atmega 2561 on the usbasp supported chip list?
08:31 PM gregor2: there is no list
08:32 PM * theBear doesn't know where those few lines tom_itx quoted a minute ago came from, but does see that they quite clearly explain what pins are needed to program a bunch of quite different avr's via an isp style programmer, and probably covers enough acronyms and attaching various terms to other terms that "match" with them to workout ANY other avr by looking up just a couple of lines in the pin name/purpose/definition list in the first several pages
08:32 PM * theBear somewhere, of every avr datasheet ever written
08:32 PM gregor2: it seems like it is.
08:33 PM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/boards/USBTiny_Mkii/USBTiny_Mkii_index.php
08:34 PM Tom_L: i know for sure that one does
08:34 PM Tom_L: i'm not so sure abou usbasp
08:34 PM theBear: www.arduinoall.com/product/206/usbasp-usbisp-avr-programmer-usb-atmega8-atmega128-support-win7-64k mmm, 1st search result for usbasp 2561, it seems pretty confident
08:35 PM gregor2: i have found a list
08:35 PM gregor2: it is listed there.
08:35 PM Tom_L: then you're golden
08:35 PM Tom_L: go forth and play
08:35 PM gregor2: but how?
08:35 PM Tom_L: unless you got something else wrong
08:36 PM gregor2: i obviously got something else wrong.
08:36 PM Tom_L: how is reset wired?
08:36 PM Tom_L: explain
08:36 PM theBear: next time spend like, 5 to 10 seconds trying to find things like list that is so very relevant to working out exactly what and/or where your problem is going on, before telling us it don't exist, if that's not asking toooooo much :)
08:37 PM gregor2: reset is connected to reset of the programmer
08:37 PM Tom_L: theBear did you see the mill i made?
08:37 PM Tom_L: pretty stoked about it really..
08:38 PM Tom_L: gregor2, that's it?
08:38 PM gregor2: GND GND, RESET RESET, MOSI MOSI, MISO MISO, SCK SCK
08:38 PM gregor2: thats how it is connectd
08:38 PM Tom_L: that's it?
08:38 PM gregor2: RESET has a pull up resistro to 5 V
08:38 PM gregor2: nothing else
08:38 PM Tom_L: how big?
08:38 PM gregor2: 10k
08:38 PM Tom_L: ok
08:38 PM Tom_L: that's fine
08:39 PM gregor2: How can it be wrong to just connect the pins how they are labeled?
08:39 PM Tom_L: ok, i'm gonna tell you what you have should work and if it doesn't you need to figure out why
08:40 PM Tom_L: for one thing, mosi goes to miso and vise versa
08:40 PM Tom_L: but on this chip it would be PDI PDO instead
08:40 PM Tom_L: i pulled txt straight from the data sheet for that
08:40 PM gregor2: so can i connect mosi and miso to PDI and PDO?
08:40 PM theBear: Tom_L, not seen any of your stuff very recently, but if i had a link or a hint where to find some of it, i'm always interested to see what yer doing... ya know, being a bit of a master at the art of microprocessorey and all kinds of interesting stuff that it lends itself to helping with :)
08:41 PM Tom_L: mosi = master out slave in. miso = master in slave out
08:41 PM gregor2: yes i know
08:41 PM gregor2: but how do i have to connect them now>
08:41 PM Tom_L: PDI = Program Data Input PDO = Program Data Output
08:41 PM Tom_L: so get the in to the out and the out to the in
08:42 PM theBear: you should really make it clear which chip's/boards pins you are referring to at this stage, cos otherwise statements/questions like "so can i connect mosi and miso to PDI and PDO?" mean absolutely nothing
08:42 PM gregor2: thats exactly what i did.
08:42 PM Tom_L: no
08:42 PM Tom_L: you said you had miso to miso and mosi to mosi
08:42 PM gregor2: atmega2561
08:42 PM Tom_L: which is wrong
08:42 PM gregor2: i tried that to.
08:42 PM theBear: Tom_L, heh, that sounds like a line from any random "get the crowd moving" kinda song :)
08:42 PM Tom_L: but those pins don't program this chip
08:42 PM theBear: get get up get down, hey fatboy ! bust a move !
08:43 PM Tom_L: hah, you should know...
08:43 PM gregor2: 02:06:37 < gregor2> I have connected MOSI with PDI and MISO with PDO now.
08:43 PM gregor2: 02:06:42 < gregor2> Still not working.
08:43 PM Tom_L: what error do you get
08:44 PM gregor2: target does not awnser.
08:44 PM gregor2: always
08:44 PM gregor2: the same
08:44 PM Tom_L: have you programmed other chips with this programmer?
08:44 PM Tom_L: can you verify that it works?
08:45 PM Tom_L: bitbanged usb is finiky at best
08:46 PM Tom_L: avrdude -c usbasp -p m2561 -U flash:w:"C:\test.hex":a -D -e
08:46 PM Tom_L: should look something like that
08:47 PM gregor2: i have to push the wires on the pins of the smd package
08:47 PM gregor2: but i am pretty shure i got it
08:47 PM gregor2: it definetly works
08:47 PM Tom_L: no you don't
08:47 PM Tom_L: on a smd package there are multiple grounds and VCC
08:47 PM gregor2: i have tried it on an atmega328p
08:47 PM Tom_L: they ALL must be connected to work properly
08:48 PM gregor2: they are connected the right way
08:48 PM gregor2: its just miso and mosi
08:48 PM Tom_L: it sure doesn't sound like it
08:49 PM Tom_L: a pic may be worth 1k words here
08:50 PM gregor2: 1k words?
08:50 PM gregor2: ok
08:50 PM gregor2: VCC is connected to 5 Volts
08:51 PM gregor2: and GND to 0 Volts
08:51 PM gregor2: all three of them
08:51 PM Tom_L: which vcc?
08:51 PM gregor2: that is pretty shure
08:51 PM gregor2: 22, 52 and 64
08:51 PM gregor2: those pins
08:52 PM Tom_L: there are 4
08:52 PM gregor2: 21, 52 and 64 are connected to 5 Volts
08:53 PM gregor2: where is the forth one?
08:53 PM Tom_L: on a tqfp they are: 10, 31, 61 and 80
08:53 PM Tom_L: for VCC
08:53 PM gregor2: AREF is left floating
08:53 PM gregor2: i am pretty shure that is not needed
08:53 PM Tom_L: gnd is 11, 32, 62 and 81
08:53 PM Tom_L: i left out any reference to AVCC or AREF etc
08:54 PM gregor2: 22 53 63 is connected to GND
08:54 PM Tom_L: those are strictly VCC and GND pins
08:54 PM gregor2: i have a atmega 2561
08:54 PM theBear: aref and avcc are related to analog sections of the chip, not powering the important bits
08:54 PM gregor2: not 2560
08:54 PM gregor2: there are only 64 pins
08:54 PM Tom_L: then we're not looking at the same chip pdf
08:55 PM Tom_itx: ATmega640/1280/1281/2560/2561
08:55 PM Tom_itx: is what i'm looking at
08:55 PM Tom_L: 100 pin tqfp
08:55 PM gregor2: Figure 1-3 on page 4 of the datasheet
08:55 PM gregor2: thats what i am looking at
08:55 PM gregor2: and my chip has 64 pins
08:55 PM Tom_L: P2, pin configuration
08:56 PM gregor2: eactly like that
08:56 PM Tom_L: ok now we know what you have
08:56 PM gregor2: what do i have?
08:56 PM gregor2: how can i program this?
08:57 PM Tom_L: just as i explained
08:57 PM gregor2: yeah
08:58 PM gregor2: i have connected mosi and miso to PDI and PDO
08:58 PM gregor2: not working
08:58 PM gregor2: both ways around
08:58 PM Tom_L: then you need to keep digging
08:58 PM gregor2: i cant dig annymore.
08:58 PM Tom_L: but we found one error
08:58 PM Tom_L: we haven't found them all yet
08:58 PM gregor2: Can i even program this with ISP?
08:58 PM Tom_L: yes
08:59 PM gregor2: then dont i have to use Mosi and miso?
08:59 PM gregor2: because they are called like that
08:59 PM Tom_L: it's one of 2 ways you can program that chip
08:59 PM Tom_L: the other way is JTAG
08:59 PM gregor2: Atmel is calling the pins on ISP like that
08:59 PM gregor2: So i need to buy a jtag programmer for thes
08:59 PM Tom_L: the pins on the chip labelled mosi miso are not intended for programming the chip you have
09:00 PM Tom_L: no you don't need a jtag programmer for this
09:00 PM Tom_L: in fact
09:00 PM Tom_L: you first need to enable the JTAG fuse with ISP before you can :D
09:00 PM Tom_L: so you're back to ISP
09:01 PM gregor2: ok
09:01 PM gregor2: jtag would be fine
09:01 PM gregor2: i have pin headers for those pins
09:02 PM Tom_L: so pins 2, 3, 11, 20 as i see it are the programming pins you need
09:02 PM gregor2: but there stants nothing about isp in the datasheet
09:02 PM gregor2: only SPI
09:02 PM Tom_L: don't get stuck on that
09:06 PM gregor2: what now
09:06 PM Tom_L: re read the log. it's all there
09:06 PM gregor2: maybe i have not hit the pins.
09:06 PM gregor2: with the wire.
09:07 PM Tom_L: is the chip soldered in anything?
09:07 PM Tom_L: or free standing
09:08 PM gregor2: maybe i have to hit them harder!!!!
09:08 PM gregor2: it is soldered
09:09 PM gregor2: hit them HARDER!!!
09:10 PM gregor2: but the reset pin has to be connected to right?
09:10 PM gregor2: by the way
09:10 PM gregor2: what does all the io pins do from stack?
09:11 PM gregor2: i hope the mcu is not shorting my pcb
09:12 PM gregor2: they are discribing how SPI works in the datasheet.
09:12 PM Ameisen: all right
09:12 PM Ameisen: think I finally fixed the toolchain build issues
09:12 PM gregor2: maybe i have to interpret that myself
09:12 PM Ameisen: now to see if ti works
09:13 PM gregor2: because nobody did it yet because everyone assumes that this is so easy everyone can do it himself
09:15 PM gregor2: guys i cant do it
09:15 PM gregor2: i have to go to bed now
09:16 PM gregor2: +I could try mosi to PDI and miso to miso.
09:18 PM gregor2: id dont know
09:20 PM _ami_: gregor2, what you can't do?
09:20 PM _ami_: you know, nothing is impossible. :)
09:20 PM _ami_: or otherway around. :D
09:21 PM gregor2: I want to program an atmega2561 with an usbasp.
09:21 PM rue_bed: 1?
09:21 PM gregor2: yes
09:21 PM gregor2: 1
09:21 PM _ami_: ok. so whats the problem you are facing?
09:22 PM gregor2: and Tom_L says it is using the PDI and PDO pins for programming seriell
09:22 PM gregor2: so i have no idea how to connect my pins
09:22 PM gregor2: also i have tried mosi and miso to PDI and PDO
09:22 PM gregor2: but it does not work
09:23 PM gregor2: note that i have to push wires onto the pins because i did my pcb design wrong.
09:23 PM gregor2: i designed it to be programmed via mosi and miso
09:24 PM rue_bed: is the pinout the same as a 2560?
09:24 PM Tom_L: basically yes
09:24 PM Tom_L: but they use different pins
09:24 PM Tom_L: the 2560 and 2561 vary in programming pins
09:24 PM gregor2: the 2561 has less pins
09:24 PM rue_bed: whaaaaaaaa -microchip-
09:24 PM rue_bed: oh
09:24 PM Tom_L: 60 uses miso mosi
09:24 PM Tom_L: 61 uses PDO PDI
09:25 PM rue_bed: like the t10?
09:25 PM gregor2: now what
09:25 PM Tom_L: no
09:25 PM Tom_L: that's TPI
09:25 PM Tom_L: these are physical pins
09:25 PM Tom_L: PDO PDI
09:25 PM rue_bed: ah, so thats the _other_ interface on your programmer?
09:25 PM Tom_L: remember.... like the mega128 is back ass
09:25 PM Tom_L: too
09:25 PM Tom_L: NO rue
09:26 PM Tom_L: teh 2561 uses ISP
09:26 PM Tom_L: but
09:26 PM Tom_L: it uses different physical pins
09:26 PM Tom_L: NOT MOSI MISO
09:26 PM rue_bed: the miso and mosi pins are on different pins?
09:26 PM Tom_L: no
09:26 PM Tom_L: the interface is
09:26 PM rue_bed: is it isp
09:26 PM rue_bed: tpi
09:26 PM Tom_L: it's all there for the reading
09:26 PM rue_bed: or the other one
09:26 PM Tom_L: forget about tpi
09:26 PM Tom_L: forget about pdi
09:26 PM * _ami_ checks DS
09:27 PM Tom_L: IT USES ISP TO PROGRAM THE ATMEGA2561
09:27 PM rue_bed: k, so there are miso and mosi pins that are not mosi and miso
09:27 PM Tom_L: no, they are called PDO PDI not mosi miso
09:27 PM Tom_L: the protocol may be similar
09:27 PM rue_bed: the miso is called pd_ and the mosi is called pd_
09:27 PM _ami_: gregor2, well, MOSI - PB2 and MISO - PB3
09:27 PM _ami_: according to DS
09:27 PM Tom_L: and they are on PE0 and PE1
09:28 PM Tom_L: in the data sheet
09:28 PM Tom_L: _ami_ we been over this for over an hour
09:28 PM rue_bed: so its the new protocol that microchip made so people have to buy their proprietory programmer ?
09:28 PM Tom_L: those are not the programming pins for this chip
09:28 PM _ami_: oh
09:28 PM Tom_L: rue_bed, no
09:29 PM Tom_L: it's been around from the beginning
09:29 PM Tom_L: there are a handfull of bastard avr chips
09:29 PM Tom_L: this is one of them
09:29 PM rue_bed: good, then miso and mosi _for programming_ have been called pd_ and pd_ respecitvly
09:29 PM rue_bed: symantics
09:29 PM gregor2: but it does not work if i connect it that way either.
09:30 PM Tom_L: then you have something else wrong
09:30 PM gregor2: what else should it be?
09:30 PM * Tom_L looks at the haystack
09:30 PM gregor2: ok
09:30 PM * Tom_L knows there is a needle in there
09:30 PM gregor2: i have to go now
09:31 PM * rue_bed tries to culvertly pour a jar of needles into it
09:31 PM * Tom_L gets out a 4" rare earth magnet
09:31 PM _ami_: Tom_L, so this is not compatible with usbasp?
09:31 PM Tom_L: it very likely is
09:31 PM Tom_L: he's just got more than one problem he's dealing with
09:31 PM gregor2: is it actually possible to hit the pins of such a smd part with wires?
09:32 PM Tom_L: we found the first one tonight
09:32 PM Tom_L: i don't know how adept you are at those things. i could do it
09:32 PM gregor2: you could do it?
09:32 PM gregor2: with 22 gauge wirees?
09:33 PM Tom_L: i wouldn't but i probably could
09:33 PM Tom_L: i dare say you don't have all the wires connected
09:33 PM gregor2: i think i did it
09:33 PM Tom_L: but i'm just blindly saying that
09:33 PM gregor2: t tried it multible times with hitting enter all over again on the pc
09:34 PM gregor2: ok
09:34 PM _ami_: gregor2, there is a avrdude verbose mode to debug what went wrong.
09:34 PM gregor2: good by then
09:34 PM gregor2: yes i now that
09:34 PM Tom_L: if you hit your head against a brick wall and the wall doesn't fall down, how long do you keep hitting it before you look for a door to walk thru?
09:34 PM gregor2: just says doenst awnser
09:34 PM gregor2: I dont find the door
09:34 PM gregor2: so
09:34 PM gregor2: good night
09:35 PM _ami_: so you need find what avrdude is complaining about.. there could be 10 reasons
09:35 PM Tom_L: the answer will become obvious after sleep
09:35 PM Tom_L: it generally does
09:35 PM _ami_: :)
09:35 PM Tom_L: i've done all i can for now
09:35 PM gregor2: maybe it will
09:36 PM gregor2: it is not complaining
09:36 PM gregor2: its just like there is no device connected at all.
09:36 PM gregor2: now
09:36 PM gregor2: good night
09:36 PM Tom_L: :)
09:36 PM nabil: in the specification of a solar panel: the voltage given is open circuit voltage and the current is short-circuit current
09:37 PM nabil: am I right?
09:38 PM Tom_L: i bet he missed some wires
09:39 PM Tom_L: deadbugging a 64pin tqfp...
09:39 PM Tom_L: i mean, it's doable but seriously?