#avr | Logs for 2012-06-12

Back
[00:00:13] <R0b0t1_> So in an attempt to generate a delay (for an acknowledge pulse), I set a timer/counter to a value, disable the pin change interrupt (through the mask register), enable the timer overflow interrupt, bring the line low, and then return from the pin change interrupt. The timer overflow interrupt disables itself, brings the line high, enables the pin change interrupt, and resets the timer/counter (although it should already be reset).
[00:00:15] <R0b0t1_> The issue is, this doesn't always work. Some of the pulses are missed. If I instead use a hardcoded delay, it always works.
[00:25:46] <Essobi_> iR0b0t1: sounds like a race condition somewhere...
[00:26:14] <iR0b0t1> Which is avoided by sleeping for the delay?
[00:26:16] <iR0b0t1> Hmm...
[00:59:24] <Sefid_Par> How can I find list of avr studio assembly codes?
[01:00:19] <Sefid_Par> I haven't AVR Studio, I use linux.
[01:03:15] <spjt> assembly codes?
[01:04:06] <Sefid_Par> spjt: yes.
[01:04:29] <spjt> I'm not sure what that means.
[01:05:03] <Sefid_Par> I need something like AVR Studio's Help.
[01:05:13] <spjt> Sefid_Par: There's the datasheet
[01:05:55] <Sefid_Par> spjt: Oh, Let me check it.
[01:06:43] <spjt> http://www.atmel.com/Images/doc2545.pdf
[01:06:47] <Xark> Sefid_Par: For the opcode descriptions you probably want "AVR Instruction Set" manual (the datasheet just has a list).
[01:08:07] <spjt> http://www.atmel.com/Images/doc0856.pdf
[01:08:18] <spjt> The first one explains all the registers, the second explains the instructions
[01:08:18] <Sefid_Par> Xark: Yes, I need Instructions too
[01:11:34] <Xark> Sefid_Par: The doc0856 is likely what you seek (but double check the datasheet on the specific chip to make sure you have a specific instruction or for timings).
[01:12:12] <Xark> Doc0856 is for "all" the AVR 8 bit chips (superset of instructions).
[01:12:14] <spjt> Xark: He'll need the datasheet for all the registers
[01:12:24] <Xark> spjt: Yes, that too.
[01:12:36] <spjt> I haven't done any ASM and you need the datasheet all the time to set registers, etc
[01:37:52] <_abc_> Has anyone here compiled simavr with freeglut? Any way to compile examples/board_reprap and examples/board_simpleduino ?
[02:43:36] <iR0b0t1> _abc_: What's this project you're working on?
[02:56:28] <_abc_> iR0b0t1: you are so full of questions I will just ignore you
[02:56:41] <_abc_> questions on two channels even
[02:56:49] <iR0b0t1> _abc_: Give me some love!
[02:56:55] <iR0b0t1> Tell me what you're doing :#
[02:56:58] <iR0b0t1> :3
[02:57:51] * _abc_ plonks iR0b0t1 in cold blood on all channels
[03:41:32] <mitsakos> hello, can somebody explain me the purpose of the watch dog timer? where can you use it and y?
[03:55:34] <Tom_itx> i could have
[06:39:10] <mitsakos> hello, i have designed an RTC using atmega168 timer2 in asynchronous mode with axternal 32.768khz on XTAL1 XTAL2 but i don't know what capacitors to use do you have any idea?
[06:43:20] <mrfrenzy> look in the datasheet for the atmega or the crystal
[06:46:33] <mitsakos> i have looked but i haven't found something specific
[07:00:04] <Tom_itx> none
[07:00:07] <Tom_itx> they are internal
[07:02:51] <Tom_itx> The Oscillator is optimized for use with a 32.768 kHz crystal.
[07:02:54] <Tom_itx> P.154
[07:03:36] <mitsakos> yes but i also use the internal oscillator
[07:04:01] <mitsakos> so i have set the appropriete fuses for internal 8mhz clock and i use 32.768khz as an external clock for timing the timer2
[07:04:41] <mitsakos> http://www.ladyada.net/make/icetube/design.html here she uses 12.5pf oscillator with 22pf capacitors in parallel
[07:06:49] <Tom_itx> that's for the main clock
[07:07:04] <Tom_itx> you said you wanted to use a 32khz clock for timer 2
[07:07:53] <mitsakos> yes that is the way she also use it
[07:08:17] <Tom_itx> When AS2 is set, pins TOSC1 and TOSC2 are disconnected from Port C. A crystal can
[07:08:17] <Tom_itx> then be connected between the TOSC1 and TOSC2 pins to serve as an independent clock
[07:08:17] <Tom_itx> source for Timer/Counter2. The Oscillator is optimized for use with a 32.768 kHz crystal.
[07:10:28] <OndraSter> yes
[07:10:36] <OndraSter> and the TOSC doesn't need external loading caps
[07:10:57] <Tom_itx> The Oscillator is optimized for use with a 32.768 kHz crystal.4
[07:10:59] <Tom_itx> The Oscillator is optimized for use with a 32.768 kHz crystal.4
[07:10:59] <Tom_itx> The Oscillator is optimized for use with a 32.768 kHz crystal.4
[07:11:00] <Tom_itx> The Oscillator is optimized for use with a 32.768 kHz crystal.4
[07:11:06] <CapnKernel> Is that right?
[07:11:14] <Tom_itx> word.
[07:11:29] <CapnKernel> Now write it out another 96 times, and don't let me catch you saying it's optimised for other frequencies
[07:12:24] <OndraSter> btw why is the watch xtal 32768?
[07:12:29] <OndraSter> not... 1 or 2Hz? :)
[07:12:56] <CapnKernel> I'm not sure piezo crystals want to oscillate at 2Hz
[07:13:08] <CapnKernel> Quartz crystals even
[07:13:52] <CapnKernel> OndraSter: You might be happy to oscillate at 2Hz, but you're not a quartz crystal
[07:14:14] <CapnKernel> My guess is that 32768 was the lowest multiple of two that could be reliably made to oscillate
[07:15:02] <OndraSter> hmm
[07:15:04] <OndraSter> makes sense
[07:15:48] <CapnKernel> Your turn: Why is green the most common colour for PCBs?
[07:17:00] <Tom_itx> they had an excess of green lawn paint left over and decided to use it
[07:17:45] <CapnKernel> Tom_itx: Next boards you order from me, I'm coating them with lawn paint myself.
[07:18:13] <OndraSter> lol
[07:18:19] <OndraSter> CapnKernel, I had that question too
[07:18:38] <CapnKernel> And you know what they told me? "Don't ask"
[07:19:11] * CapnKernel has researched the issue
[07:19:17] <CapnKernel> Which means I googled for a bit
[07:21:18] * Tom_itx pulls a wisdom tooth while waiting for an answer
[07:25:25] <Tom_itx> It was the native color of the first solder mask that was developed and remained the standard color for so long because it was the cheapest to buy either because the process is easier or because that is the most widely produced color
[07:26:37] <mitsakos> by writing "The Oscillator is optimized for use with a 32.768kHz crystal." does it mean that there is no need for external capacitors?
[07:27:05] <Tom_itx> <Tom_itx> none
[07:27:05] <Tom_itx> <Tom_itx> they are internal
[07:27:40] <mitsakos> and if you use for example a 6pf 32.768 crystal and a 12.5pf 32.768 wil you have the same aquracy?
[07:28:08] <CapnKernel> I read that green was chosen because of some study about colour combinations of solder mask and silk screen
[07:28:35] <CapnKernel> But since then, seems to be that it's a "legacy" thing: It was cheapest yesterday, so it's the cheapest today
[07:29:48] <CapnKernel> The capacitance should be independent of accuracy
[07:30:30] <mrfrenzy> whatever sells most will be produced in larger quantities, larger quantities makes it cheaper per unit. and people will buy more of it since it cheap
[07:30:33] <mrfrenzy> rinse and repeat ;)
[07:31:13] <Tom_itx> i recall pcbs that had none
[07:31:58] <mrfrenzy> all were like that before solder mask was invented
[07:32:04] <mrfrenzy> and some even after that due to cist
[07:32:05] <mrfrenzy> cost
[07:32:22] <Tom_itx> and back then it was 'cheap jap crap'
[07:35:13] <Tom_itx> with those words i leave the comfort of my broken office chair to go out into the world to pay for this ridiculous hobby
[07:35:52] <CapnKernel> There's a world out there?
[07:36:23] <Tom_itx> i've been told
[07:37:10] <CapnKernel> Can't handle... the extra dimension!
[08:00:54] <OndraSter> I'd love some purple or blue or red PCBs :)
[08:00:59] <OndraSter> or white :o
[08:16:11] <specing> pink <3
[08:37:42] <OndraSter> specing, :P
[08:37:46] <OndraSter> I almost wrote pink instead of purple :D
[08:38:21] <mrfrenzy> whatever you do, don't image google for blue waffles
[08:38:34] <OndraSter> you do realize that now I have to do that, right?
[08:39:13] <mrfrenzy> yes
[09:36:42] <_abc__> Where is #simavr? On freenode?
[09:39:15] <_abc__> Yes
[11:16:55] <Tom_itx> OndraSter, order from laen and you will get purple
[11:21:06] <OndraSter> laen?
[11:21:11] <OndraSter> but.. how much is it :)
[11:23:21] <Tom_itx> reasonable
[11:23:37] <Tom_itx> $5 sq in plus shipping to you and you get 3 back
[11:23:58] <Tom_itx> reasonable for prototypes
[11:24:45] <OndraSter> hmm
[11:25:29] <Tom_itx> http://oshpark.com/
[11:25:34] <Tom_itx> wow he updated his pages
[11:37:45] <chupas> is there a way to do a stopwatch type thing win AS5 and AVR one JTAG debugging?
[11:39:49] <budwaa> Hi, is it ok to compare and assign an enum constant to a byte in avr c?
[11:56:54] <OndraSter> chupas, stopwatch of what?
[12:21:55] <CapnKernel> OndraSter: Order from me and you won't be stuck with purple
[12:22:16] <CapnKernel> But there's a bunch of different colours to choose from, and at a lot less than $5/sq inch
[12:23:40] <OndraSter> :)
[12:23:48] <OndraSter> we'll see
[12:24:15] <OndraSter> I need to earn some money first though
[12:24:25] <Steffanx> Work harder
[12:24:30] <OndraSter> wo-what? :D
[12:24:53] <Steffanx> krow
[12:25:09] <OndraSter> work backwards?
[12:25:13] <OndraSter> aka do not work?
[12:28:39] <Tom_itx> careful though, the green will be lawn paint
[12:32:49] <Steffanx> lawn paint :S
[12:39:46] <specing> CapnKernel: Define "bunch" :D
[12:40:21] <Steffanx> #define bunch ()
[12:40:45] <Steffanx> Sorry, I'm not CapnKernel
[12:45:04] <asteve> timezones?!
[12:46:37] <specing> asteve: time-zone continuum
[14:15:26] <Xata> hello
[16:50:19] <Xata> I have very weird trouble
[16:50:50] <Xata> seems like my program works only when i turn the mc on/off
[16:51:20] <Xata> why can be so? on two same atmega32, one 100% working
[16:51:54] <Xata> and it works in isis emulation
[16:53:04] <Xata> http://pastebin.com/xnNMDq9H
[16:56:25] <OndraSter> turn the MC?
[16:56:27] <OndraSter> what mc?
[16:57:39] <Xata> OndraSter: mc=microcontroller, ie atmega32
[16:57:46] <OndraSter> ah
[16:57:50] <OndraSter> I am used to MCU :)
[16:58:20] <Xata> MC unit, whatever. any ideas why this insanity can even exist?
[16:58:57] <OndraSter> so - if you start the program, it works. Once you reflash the firmware it doesn't work till you power cycle the MCU?
[17:00:49] <Xata> no. sometimes when i turn power on it starts blink fast as it supposed to for half second and then nothing untill i turn the power off. maybe because i have quite powerfull capcity between +5 and gnd for noise reduction.
[17:01:17] <Xata> when i turn the power off it blinks for another half of second
[17:01:29] <Xata> and it is not every time i do so.
[17:01:32] <Xata> wtf?
[17:01:54] <OndraSter> eh
[17:02:04] <Xata> another firmware works fine.
[17:03:19] <Xata> maybe you have a look at code?
[17:03:44] <OndraSter> looking at it right now
[17:04:17] <OndraSter> Xata, why are you always starting the conversion manually instead using free running mode? :)
[17:05:37] <Xata> because i thought this is a only way, or something else - i already defined it in brain and don't remember why
[17:06:46] <Xata> OndraSter: maybe you can check it on some board you have foe testing purposes? because simulation ok, compilation ok, but something is definitely wrong
[17:07:10] <OndraSter> maybe when I get back on Friday
[17:09:39] <Xata> friday... to damn long. do you know any other way than asking somebody to check it, so that it would be at least 90% legit?
[17:10:05] <OndraSter> if it works in emulator just fine, then:
[17:10:09] <OndraSter> a) the emulator is broken
[17:10:09] <Xata> maybe some ultra-precise online simulator or stuff
[17:10:18] <OndraSter> b) there is electronic problem on the device which I can not find out anyway
[17:11:59] <Xata> but i checked 2 devices, one that i used for wave generation for long time and another that has nothing at all connected to it except power, quartz and aref
[17:13:15] <OndraSter> hm....
[17:13:49] <Xata> OndraSter: look at line 27. can be this a cause? pb1 is unused on current version
[17:14:13] <Xata> and is not set as output. maybe this halts mcu?
[17:16:40] <OndraSter> yes, those two were drilling my head too
[17:16:44] <OndraSter> why do you set it low and then high?
[17:16:55] <OndraSter> is it pullup?
[17:17:18] <OndraSter> oops, now I understand it
[17:17:19] <OndraSter> sorry
[17:17:35] <Xata> yes, pb0 is CS
[17:17:53] <OndraSter> honestly I have no idea
[17:18:03] <OndraSter> I'd have to have the circuit right here
[17:19:56] <Xata> OndraSter: well, when i tried on mcu with nothing except quartz, voltage sources, aref and pot on adc0 - the situation was same. i think the cause is somewhere in compilator
[17:20:15] <Xata> *compiler
[17:21:05] <OndraSter> hmm
[17:21:09] <OndraSter> check out disassembly :)
[17:22:09] <Xata> i don't understand disassembly :C. maybe there is some way to compile the code not on avr-gcc? i think not, bnut hope dies last
[17:22:34] <OndraSter> then using what? :P
[17:23:20] <specing> Xata: learn avr assembly
[17:24:47] <OndraSter> :)
[17:27:13] <Xata> specing: i will, my lord
[17:28:15] <Xata> OndraSter: strange - led lights up like when there is high-freq signal on sck. but not on the others, that have less freqency.
[17:28:43] <Xata> i need oscilloscope <_<
[17:28:48] <OndraSter> yeah
[17:28:49] <OndraSter> :)
[17:29:18] <OndraSter> everything is easier with scope
[17:29:21] <OndraSter> and logic analyzer
[17:29:29] <Xata> well, first i have to get enough money to buy welding station
[17:29:42] <Xata> than the other stuff.
[17:29:42] <OndraSter> first I have to get money so I can launch product so I can make money
[17:30:33] <specing> Heh
[17:30:35] <Xata> yes, this is how it works, and that's are what credits for micro-bussiness is
[17:30:40] <specing> I got a scope today ;P
[17:31:29] <Xata> but you have to be 100% sure that you will that money back, and any other profit source, like work, you know.
[17:31:43] <Xata> *will have that
[17:32:11] <OndraSter> :)
[17:32:17] <OndraSter> I need one or two boards for me, myself
[17:32:23] <OndraSter> then already few people asked whether I would make few more
[17:32:24] <OndraSter> for them
[17:32:30] <OndraSter> so why not
[17:32:34] <OndraSter> I can make 10 boards!
[17:33:39] <Xata> that's are what credits for
[17:33:41] <Xata> micro-bussiness is
[17:33:51] <Xata> english level 80
[17:34:37] <Xata> specing: soo... you can check my program? :3
[17:35:07] <OndraSter> I got a scope for over a month, my teacher gave it to me, just as some frequency generator
[17:35:33] <OndraSter> the generator was "old and useless, I'd trash it... but since I already gave you my old scope, maybe you could use that too?"
[17:35:35] <OndraSter> "sure!"
[17:35:36] <OndraSter> :D
[17:35:40] <specing> Oh my god here we go
[17:36:00] <specing> line 6: unformated hardcoded values...
[17:36:00] <Xata> OndraSter: well, you can take first only money for parts and than rest after you have a ready board.
[17:36:06] <specing> WTF is this shite
[17:36:30] <Xata> specing: sinewave table :3
[17:36:52] <OndraSter> Xata, :)
[17:36:52] <specing> NO
[17:36:55] <Xata> it is faster to table-lookup that generating sine in realtime
[17:37:01] <specing> ***UGLY*** sine table.
[17:37:02] <OndraSter> one board = less than 10 euro
[17:37:05] <Xata> *than
[17:37:41] <Xata> specing: why it is that ***UGLY***?
[17:37:48] <specing> functions returning volatile variables...
[17:38:11] <Xata> i mean i know why - i made it. but what is ugly about it?
[17:38:45] <specing> 20 lines off spammed initialisations in main()....
[17:39:59] <specing> failure to use macros in interrupts and resorting to completely unreadable bitwise spam all over the place
[17:40:07] <Xata> specing: about volaile this is my mistake, i made it automaticly, as you see it is not static volatile in function itself
[17:41:21] <specing> Whatever, Im going to bed
[17:41:28] <Xata> specing: how do i make intialisations another way? in separate function? what for?
[17:41:37] <specing> nightmares dead ahead
[17:41:47] <OndraSter> I don't see the reason to use volatile at all?
[17:41:52] <OndraSter> you are returning single byte
[17:42:05] <OndraSter> that is in register, not in memory
[17:42:14] <Xata> OndraSter: thay said here that volatile will protect it from compiler
[17:42:23] <OndraSter> protect it from what?
[17:42:27] <OndraSter> dark ghosts?
[17:42:36] <Xata> from optimisations
[17:43:10] <OndraSter> uh and the same thing for the parameter of the position
[17:43:22] <OndraSter> it is global variable
[17:43:25] <OndraSter> that one should be volatile
[17:43:42] <OndraSter> and why is it done through & * and as parameter beats my mind too
[17:45:41] <Xata> because in original code, where i took this function from position can be not global var, at least it was planned
[17:46:57] <OndraSter> duh
[17:47:19] <Xata> and it is volatile because wave_pos1 is volatile, and compiler says about type conflict if i remove volatile
[17:47:59] <OndraSter> but why does it return volatile
[17:48:29] <OndraSter> when the "local" variable is not volatile at all
[17:48:47] <Xata> that was a mistace i made when converting all global variables to volatile, look at the function it is not volatile, just unsinged char
[17:48:56] <Xata> *mistake
[17:49:05] <OndraSter> hmm wondering how come that gcc doesn't show error then :)
[17:50:23] <Xata> yes, even more - it is in pedantic mode. still no even a single warning
[17:51:15] <OndraSter> you might have run into gcc issue, you wouldn't be the first one
[17:53:33] <Xata> i know. i still remeber how i tuned the generator project setings to start working.
[17:53:53] <Xata> OndraSter: also, who won today? rus/pol?
[17:54:03] <OndraSter> no idea
[17:54:06] <OndraSter> I am neither from those
[17:55:01] <Xata> OndraSter: i thought you are from poland
[17:55:07] <OndraSter> no
[17:55:15] <OndraSter> that's too much north
[17:57:29] <Xata> oh, yeah. you are from south african republic
[17:57:36] <OndraSter> :D
[17:58:02] <OndraSter> (not sure if that was joke or serious) nope
[17:58:43] <Xata> somebody i had a conversation on irc last month was from there.
[17:58:49] <OndraSter> yes
[17:58:51] <OndraSter> I remember him too
[18:00:20] <Xata> it is 35 at daytime in ukraine. i am scared to think about how it is there, in african countries
[18:00:40] <Xata> 35 degrees of celcium, i mean
[18:00:40] <Tom_itx> RikusW is i think
[18:00:43] <Tom_itx> isn't he?
[18:01:04] <OndraSter> 35 degrees of calcium
[18:01:11] <Xata> maybe, i dont't remember
[18:01:31] <Xata> OndraSter: that is realy bad steel, keke
[18:01:37] <OndraSter> :D
[18:02:55] <Xata> my cat thinks that 4-legged fets are NOMie, and 3-legged ones are not interesting at all. why so?
[18:03:32] <OndraSter> what?
[18:03:34] <Xata> maybe he has lack of Si?
[18:04:16] <Xata> if i push my burned atmega16 streight into his ass - would this help?
[18:04:29] <Xata> or i have to buy a working one?
[18:06:51] <eadthem> i think you shuld buy some organiser bins
[18:09:10] <Xata> eadthem: glued together boxes from matches are organiser bins for real man
[18:09:54] <OndraSter> :D
[18:16:23] <Xata> what an irony. if i could buy oscilloscopes, wielding stations and organiser bins - i wouldn't be here, but when i am in electronics to build a synthesizer i cannot afford - i need all that stuff
[18:17:59] <Landon> I'm not sure getting into electronics to do things on the cheap is the right mentality :P
[18:19:08] <OndraSter> one needs to be efficient
[18:24:22] <Xata> well, this has some advantages as new knowledge, C code training and maybe even profit if some day i'll make it good enough to sell. also this is typical post-soviet mentality i took with blood of my ancestors - there was nothing in ussr, or very shitty, and only way was to build it yourself. that's why russians and ukrainians are usually quite handy
[18:24:47] <OndraSter> I saw USSR version of... what was it... 8086 or 80286? :)
[18:24:52] <OndraSter> it was LOL
[18:25:05] <OndraSter> the USSR had the biggest mice and smallest elephants
[18:25:12] <OndraSter> that's what our teacher says :D
[18:25:19] <OndraSter> well, used to say, I am already gone from the school
[18:25:23] <Xata> in ussr Z80 was _very_ popular
[18:26:12] <Xata> we only had z80 and clone of 80286 up to 1991
[18:27:02] <OndraSter> :)
[18:27:06] <OndraSter> we were part of USSR
[18:27:13] <OndraSter> "too bad" I was born "too late"
[18:29:07] <Xata> well, i was born 1988, but i had quite "powerfull" z80-clone (as for z80. 7mhz!!!!111) up to 1999
[18:30:48] <OndraSter> wow
[18:30:52] <OndraSter> I had atari 800 XE I got years ago
[18:30:55] <OndraSter> but I sold it...
[18:30:58] <OndraSter> no use for it
[18:33:00] <Xata> OndraSter: funny thing that spectrum named profi+ is standing on table near me. but i still dream of getting somehow a comodore c64...
[18:33:12] <OndraSter> :)
[18:33:17] <OndraSter> you'd like my project probably
[18:33:31] <OndraSter> some 400+ MHz ARM9 or Cortex M4 MCU
[18:33:34] <OndraSter> with 32MB RAM
[18:33:40] <OndraSter> (or more)
[18:33:44] <OndraSter> few megabytes flash
[18:33:49] <OndraSter> external CPLD as display driver
[18:33:52] <OndraSter> and 5" WVGA display
[18:33:57] <OndraSter> running all kinds of emulators :)
[18:34:07] <OndraSter> 8086 - 386 for starters probably
[18:34:10] <OndraSter> then add NES
[18:35:25] <Xata> you will have problems of emulating sound - 400mhz will be not enough i suppose. i have 2,5 4-core phenom, and it sometimes glitches on precise sound emulation
[18:35:31] <OndraSter> I2S?
[18:35:34] <OndraSter> wait
[18:35:36] <OndraSter> sound of what?
[18:35:58] <Xata> in-game music, you know
[18:36:10] <OndraSter> isn't that just PWM + triangle?
[18:36:26] <Xata> that is done on separate chip on most retro consoles
[18:36:27] <OndraSter> the difference is - I have direct access to sound hardware :)
[18:37:05] <Xata> OndraSter: on nes - maybe, but emulatins SID for c64 is huge pain in butt
[18:37:33] <OndraSter> hmm
[18:37:37] <OndraSter> haven't studied that
[18:38:22] <Xata> oh, i have to check abou nes, as far as i reme,ber there is 2-pulse and one tri
[18:40:25] <Xata> yeah, square+square+tri+noise+simple low-quality samples made wicked way
[18:41:08] <Xata> and you'l have to emulate all the registers, otherwise rom's won't work.
[18:41:42] <Xata> but you can install android and some ready emulator.
[18:41:59] <Xata> man, making your own dingoo is not that easy.
[18:42:13] <Landon> don't reinvent the wheel, just make a better spoke ;)
[18:43:14] <OndraSter> screw android
[18:43:17] <OndraSter> android is POS :)
[18:44:09] <Xata> but on the other hand - 400mhz is not enough for android and emulator i think. so only way - make everything yourself, without resource-eating operating systems
[18:44:23] <OndraSter> exactly
[18:44:47] <Xata> and the main thing - gained experience will be enough for several lvl-ups
[18:45:10] <OndraSter> yep
[18:47:17] <Xata> so, i have NOSTALGY playing in my hearrrrt. anybody got sid-chips here? or sid-emulating software for atmega, and not insane stuff from linus atkinson?
[18:47:41] <OndraSter> linus atkinson?
[18:47:54] <Xata> *akesson
[18:48:48] <Xata> he wrote 8-bit music tracker for atmel chip, but in assembler and for some old avr family chip, i don't even know about
[18:48:59] <OndraSter> eh
[18:50:27] <Xata> http://www.linusakesson.net/hardware/chiptune.php
[18:51:30] <OndraSter> atmega88?
[18:54:07] <Xata> looks like
[18:54:58] <OndraSter> hmm the SID chip is fairly complex
[18:55:38] <Xata> but sounds RAD
[18:56:03] <Xata> that's why everybody loves hypnoto^W sid
[18:56:20] <ColdKeyboard> Hi there! I guess you get this a lot but I have messed up my fuses on my ATMega8 and now I cannot re-programm it. I have accidentally set the fuse to use EXT oscilator and LOW frequency with 1K and I think 6ms start time. Is there a way I could repair fuses by programming my ATtiny2313 and use it as clock source?
[18:56:43] <Xata> yes, there is
[18:57:44] <ColdKeyboard> Could you please explain to me how, since I guess low freq ext clock is something less or equal to 1MHz and I don't have 1MHz crystal...
[19:00:53] <OndraSter> create app that just bitbangs some pin on the tiny
[19:00:56] <OndraSter> :)
[19:01:10] <OndraSter> something like SBI PORTA, PA0
[19:01:12] <OndraSter> NOP NOP NOP
[19:01:16] <OndraSter> CBI PORTA, PA0
[19:01:22] <OndraSter> NOP NOP JMP BEGIN
[19:01:39] <OndraSter> and connect that to XTAL2 (I think, check datasheet whether it is xtal1 or xtal2 pin)
[19:01:41] <Xata> ext osc is not crystal. you can make attiny change one pin from 1 to 0 at 1mhz or less and connect to xtal1
[19:01:47] <ColdKeyboard> Ok, and then that port I lead to XTAL1 of the ATmega8, right?
[19:01:52] <Xata> OndraSter: first one, i did that today
[19:01:57] <OndraSter> okay
[19:02:14] <OndraSter> I thought it was something that caught my mind - probably different chip I was looking at then :)
[19:03:00] <Xata> NOP NOP NOP
[19:03:20] <Xata> muppet show, damn
[19:04:22] <Xata> i just have that scary hairy thing doing NOP NOP NOP right in my mind, poisoned by night tea
[19:04:33] <OndraSter> :D
[19:05:08] <Xata> why sometimes i vomit when i have tea at night?
[19:05:25] <OndraSter> we didn't really need to know that... ;D
[19:05:26] <OndraSter> no idea
[19:05:52] <Xata> maybe this is boolemia
[19:06:14] <OndraSter> that depends
[19:06:17] <OndraSter> are you skinny like...
[19:06:17] <OndraSter> hmm
[19:06:47] <OndraSter> http://www.healthpictures.org/images/bulimia-4.jpg
[19:06:48] <OndraSter> like this?
[19:06:53] <Xata> my weght is 150+ kilos at 193cm high. skinny, yeah, kinda
[19:07:00] <OndraSter> duh
[19:07:12] <OndraSter> I have _only_ 80kg at 170cm height :D
[19:08:12] <ColdKeyboard> I have 196cm and 83Kg :)
[19:08:21] <Xata> at least i am high and don't look like most fat short piglets i saw
[19:08:24] <Xata> oink
[19:10:41] <OndraSter> :D
[19:10:45] <OndraSter> yeah, I am fairly short
[19:10:51] <Xata> ColdKeyboard: if you are as huge in width as i am _and_ have 93kilos - girls love you, lucky one. usually you are or tall and thick or tall and fat.
[19:12:37] <Xata> OndraSter: oh, that's ok, my friend is 175 and his gf is ~169
[19:12:51] <Xata> but her weight is 39 damn kilos
[19:13:00] <Xata> _4_ times less than me
[19:13:57] <Xata> i think doing something for my cat would be quite a challenge for her
[19:15:19] <ColdKeyboard> Xata: I trained volleyball for 8 years so I'm tall and kinda muscular...at least girls say so :)
[19:15:37] <OndraSter> heh
[19:16:05] <ColdKeyboard> And does it matter what oscilator freq I'm using on ATtiny2313 for generating clock to ATmega8 to fix fuses?
[19:17:00] <ColdKeyboard> I have code that is just like you all said... DDRB = 0xFF; and in main PORTB = ~PORTB; asm(nop); asm(nop)
[19:18:30] <Xata> girls? what girls?
[19:18:55] <Xata> i never worked with attiny and asm, so idonnolol
[19:19:07] <OndraSter> ColdKeyboard, should be good
[19:19:40] <ColdKeyboard> OndraSter: And it doesnt matter what crystal frequency attiny2313 is running?
[19:20:32] <Xata> ColdKeyboard: girls, what they are alike?
[19:20:52] <ColdKeyboard> Xata: Lol :)
[19:21:20] <ColdKeyboard> Btw we have few girls in engineering class in Serbia and they're pretty hot :)
[19:22:07] <Xata> mom told me that they are used to something called sax. is that some kind of academic instrument?
[19:22:23] <OndraSter> lol Xata
[19:22:31] <OndraSter> ColdKeyboard, not really
[19:22:44] <OndraSter> if you set external clock
[19:22:49] <OndraSter> it is external clock for all ranges
[19:22:52] <OndraSter> right?
[19:22:59] <OndraSter> if not, just add few more NOPs :D
[19:23:05] <OndraSter> to get target clock lower
[19:23:10] <Xata> ColdKeyboard: i am metallurgist. there is no girls, if even i knew what is that. mom told me i will understand when i see them
[19:23:17] <ColdKeyboard> LFuse was set to D9 if I remmember
[19:24:43] <OndraSter> Xata, so when I was at uni to write the test I saw a LOT of chicks
[19:24:45] <OndraSter> about 20%
[19:25:10] <OndraSter> when I entered the classroom (about 100 people there, another 120 behind me), I sat next to some chick
[19:25:14] <OndraSter> fairly hot..
[19:25:28] <OndraSter> she moved by one seat because there was space for another person (yes, the room was absolutely filled)
[19:25:39] <OndraSter> then she moved back with "if you won't mind, I'd rather sit here"
[19:25:43] <OndraSter> ("WOOOT" said my brain)
[19:25:52] <OndraSter> then another two chicks sat from the other side ;D
[19:26:09] <Xata> oh gosh, fap super cool story incoming
[19:26:09] <OndraSter> so yeah, IT unis have chicks
[19:26:18] <OndraSter> already ended :D
[19:27:08] <Xata> so, was your faith powerfull enough to overbear your boner?
[19:27:22] <OndraSter> yeah, I scored 17 out of 20 questions
[19:27:28] <OndraSter> which is fairly good since I didn't bring calculator
[19:27:34] <OndraSter> and did all the math from top of my head
[19:27:41] <OndraSter> not really fun to do 81x81
[19:27:46] <OndraSter> (actually that one was simple)
[19:27:57] <OndraSter> 27x81 was fun :)
[19:28:06] <OndraSter> square root from 2304 I just skipped
[19:28:14] <OndraSter> the same for converting from base 10 to base 7 I gave up
[19:28:18] <OndraSter> too big numbers in there
[19:28:39] <Xata> blahblahblah
[19:28:48] <Xata> so you lost your virginity?
[19:29:06] <ColdKeyboard> AVR-Osp II still doesn't see my ATMega8 when I attach output pin from ATTiny2313 to XTAL1
[19:30:46] <Tom_itx> is it xtal1 or xtal2? and what freq?
[19:30:59] <Tom_itx> it should be 4x the programmer rate
[19:31:23] <OndraSter> Xata, I didn't get even to base 2 :D
[19:31:29] <OndraSter> let alone base 7 I was supposed to
[19:31:52] <Xata> actually, this is very, very sad, that you try to forget about chicks by overriding with geekery. 23yo fat nerd can guarantee this
[19:32:13] <ColdKeyboard> Tom_itx: Noone told me anything about the freq. I just used code like PORTB=~PORTB; asm(nop); asm(nop); and that's it
[19:32:20] <ColdKeyboard> And I connected it to XTAL1 pin
[19:33:22] <Tom_itx> my programmer puts out a recovery clock and it doesn't work unless it's 4x the spi freq
[19:33:34] <Xata> why not PORTB^=(1<<PINB0) for example?
[19:33:36] <OndraSter> it is mentioned in the datasheet btw
[19:34:11] <Tom_itx> what is?
[19:34:16] <ColdKeyboard> So my AVR911 has 7.3728MHz and I need to create square wave signal that is 4x greater than that one?
[19:34:50] <Tom_itx> 4x greater than the selected freq for the spi ISP programming freq
[19:35:10] <OndraSter> <Tom_itx> my programmer puts out a recovery clock and it doesn't work unless it's 4x the spi freq
[19:35:14] <OndraSter> yes, that is in the datasheet :)
[19:35:15] <Tom_itx> i dunno how avrdude does that but studio has a dropdown to select the freq
[19:35:26] <OndraSter> avrdude has flag for it...
[19:35:30] <OndraSter> switch*
[19:35:37] <Tom_itx> so set it to a slow speed
[19:35:44] <Xata> ColdKeyboard: how do ou programm it? what programmer?
[19:35:45] <Tom_itx> 125khz is default iirc
[19:36:00] <ColdKeyboard> Xata: I have AVR911 ISP
[19:38:08] <ColdKeyboard> Can I set spi freq in AVR-OSP II ?
[19:38:53] <winman> hey, trying a new atmega328p, from sparkfun, and i keep getting 'target board won't answer.' I'm not using a crystal, checked my connections 1k times. power coming from usbasp. 5 volts at pin 7&20. 8 and 21 share ground and i have a switch on the reset. I haven't played with the fuses yet. didn't want to mess things up too bad.
[19:38:55] <Xata> i don't think spi is 8mhz. it can be, but what for?
[19:39:21] <Tom_itx> winman do you have a pullup on reset as well?
[19:39:41] <Tom_itx> ColdKeyboard, OndraSter says avrdude has a switch for that
[19:40:00] <winman> at one point i did, but now i don't. and i'm showing neg volts with the switch open
[19:40:12] <ColdKeyboard> Tom_itx: When I run avrdude from my command promt it hand on "Connecting to programmer: ."
[19:40:16] <OndraSter> check its manual
[19:40:25] <OndraSter> -B
[19:40:26] <OndraSter> I think
[19:40:35] <Tom_itx> that may be it
[19:40:39] <Tom_itx> it sets a delay i know
[19:40:49] <winman> i've set that all the way down to 8 mhz
[19:40:55] <OndraSter> default = 10 = 10kHz
[19:40:56] <OndraSter> supposedly
[19:40:58] <OndraSter> ye
[19:41:03] <winman> sorry khz
[19:41:16] <Tom_itx> You can use the -B option to specify the ISP speed. By default the value is 10 which means 100KHz clock, this is good for target clock speeds > 500KHz. If you want the high speed clockrate (400KHz) for target frequencies > 4MHz you can use "-B 1" to speed up programming
[19:41:16] <Tom_itx> To calculate the SPI frequency from the delay value, use this formula:
[19:41:18] <OndraSter> try -B 32
[19:41:22] <OndraSter> Tom_itx, ladyada :)
[19:41:26] <Tom_itx> SPI clock frequency in KHz = 1000/(1.5+B) where B is the delay value
[19:41:37] <OndraSter> http://www.ladyada.net/make/usbtinyisp/avrdude.html
[19:42:25] <Tom_itx> so figure out what your chip is putting out for a clock
[19:43:24] <ColdKeyboard> Ok, but I have nasty problem with avrdude, when I type any command in command promtp like "avrdude -p m8 -c avr911 -B 32" it hangs on "Connecting to programmer"
[19:43:24] <Xata> ok guys, have to go sleep. see you next time i'll be empty enough to fuck with avr. so see you tomorrow!
[19:43:43] <ColdKeyboard> Xata: See ya, and thanks for help
[19:44:51] <OndraSter> windows or linux?
[19:44:58] <ColdKeyboard> Win7 x64
[19:45:09] <OndraSter> make sure there is nothing else using it
[19:45:13] <OndraSter> like some flashing app or whatever
[19:45:14] <Tom_itx> try studio?
[19:45:22] <Tom_itx> oh wait.. you can't
[19:45:32] <Tom_itx> your programmer isn't supported
[19:46:11] <ColdKeyboard> I closed all of the apps and it still hangs on connecting to programmer
[19:46:23] <OndraSter> try re-inserting the programmer
[19:47:20] <ColdKeyboard> ehm... how exaclty to do that?
[19:47:38] <OndraSter> disconnect from your PC
[19:47:41] <OndraSter> connect again? :)
[19:47:52] <ColdKeyboard> It is serial programmer... but will try
[19:48:00] <OndraSter> oh
[19:48:05] <OndraSter> hmm
[19:48:17] <winman> win vista basic and windows 03 server. same on both
[19:48:37] <OndraSter> winman, cool nickname :D
[19:49:40] <winman> ondraster thks
[19:49:45] <winman> i just dropped a 10k pull up on reset and same result
[19:50:10] <OndraSter> winman != ColdKeyboard or does it?
[19:50:12] <OndraSter> not by the DNS
[19:50:31] <ColdKeyboard> I'm not winman :)
[19:50:45] <winman> i'm winman
[19:51:07] <ColdKeyboard> ok, now avrdude reads something from programmer but signature is ff ff ff
[19:51:14] <OndraSter> hmm
[19:51:22] <OndraSter> that means it did not connect to the target successfuly
[19:51:33] <OndraSter> winman, I must have missed your story then :D
[19:51:40] <winman> lol
[19:51:47] <OndraSter> <winman> win vista basic and windows 03 server. same on both
[19:51:50] <Tom_itx> OndraSter yes there are 2 problem threads going at once here
[19:51:53] <OndraSter> oh
[19:51:58] <Tom_itx> pay attention!
[19:51:59] <Tom_itx> :)
[19:52:00] <OndraSter> OH
[19:52:08] <OndraSter> well winman has the same color as you, Tom_itx
[19:52:16] <winman> yeah, i was getting 'target not anserwing'
[19:52:19] <OndraSter> plus he has the same length of nickname as you
[19:52:34] <winman> and i just put my os's that i've tried with
[19:52:47] <Tom_itx> winman, yeah don't mess with the fuses
[19:53:01] <Tom_itx> default is a 1Mhz internal oscillator for a clock source
[19:53:23] <winman> ummm, i've also changed the signature in .conf
[19:55:04] <winman> and to recap i've set the oscillator to 8mhz as well.
[19:55:10] <Tom_itx> is it a P chip?
[19:55:14] <Tom_itx> 328p
[19:55:24] <winman> yes. using usbasp
[19:56:40] <winman> i did see on sparkfun that they say to use a serial dongel/programmer, but i've also seen folks do it the a version of my usbasp
[19:58:55] <winman> not sure if this raises a flag, but on the reset pin seems to only show -1v. I hit my reset switch and it goes to 0v, but showing -1 otherwise.
[20:00:35] <OndraSter> -1?
[20:00:47] <winman> -1volt
[20:01:40] <OndraSter> like... below zero?
[20:01:45] <OndraSter> that's weird
[20:01:49] <OndraSter> they are clamped..
[20:01:52] <OndraSter> including reset
[20:02:00] <OndraSter> so not below -.6V or so should appear on any pin
[20:02:57] <winman> battery is low in my meter, but yeah, -1.02
[20:03:30] <OndraSter> Tom_itx, is it just me or is that weird?
[20:03:47] <winman> scratch that. +1.02. sorry
[20:04:21] <OndraSter> oh lol
[20:04:27] <OndraSter> well is there something happening?
[20:04:31] <OndraSter> like a programmer maybe?
[20:04:45] <ColdKeyboard> I have connected Attiny2313 PORTB pin to ATMega8 XTAL1 and still avrdude can't find it when I tell him to use -B 32
[20:06:17] <OndraSter> hmm
[20:06:28] <OndraSter> can you somehow make sure that there is something happening on the PortB pin?
[20:07:52] <ColdKeyboard> I connect LED and it is always on, but I have coded my pin to work at 125KHz
[20:10:00] <OndraSter> sorry, it is 0300 andI need to get up soon, gotta run
[20:10:01] <OndraSter> bb
[20:10:14] <ColdKeyboard> You are in my timezone :)
[20:10:26] <OndraSter> obviuosly
[20:10:29] <OndraSter> obviously*
[20:14:14] <Tom_itx> dead batteries cause all sorts of problems
[20:15:00] <winman> tell me about it. I think they finally gave up the ghost. dangit!!
[20:15:32] <Tom_itx> use a wall wart
[20:16:32] <winman> yeah, cause now meter is reading the -1.whatever on the reset pin again
[20:18:09] <ColdKeyboard> This ATmega8 is driving me crazy, it took 2weeks to get to me and now low fuse is on D9 which requires EXT. Low-freq crystal that I don't even know what frequency is that and where to get it :\
[20:18:21] <ColdKeyboard> And I need ATmega8 to build USBasp
[20:18:23] <ColdKeyboard> :\
[20:18:47] <winman> oh, just fyi, you'll get a -1volt on the reset pin if you reverse polarity on your meter on accident
[20:25:43] <ColdKeyboard> Any ideas what can I do about this ATmega8?
[20:27:44] <Tom_itx> nothing solid
[20:28:06] <Tom_itx> i could suggest you try one of my programmers but if it didn't unbrick it, you'd be pissed at me
[20:29:42] <iR0b0t1> To program a µC with the external fuse set you usually need an external crystal, so, he'll need to put on an external crystal at some point.
[20:30:24] <Tom_itx> unless it's an external clock source which a crystal wouldn't work in that fuse setting
[20:30:29] <iR0b0t1> Actually there's a difference. If you have more than one ATmega8, and if they have the CLKOUT bits, _and_ it's actually the external clock, not external oscillator bits are set, you can use one to clock another.
[20:34:24] <ColdKeyboard> Problem is that this is the only ATmega8 I have and I only have crystals that are 2, 4, 7.3728, 10, 12 MHz
[20:35:05] <ColdKeyboard> But this External Low-frequency crystal is lower that 2MHz I guess, since my 2MHz crystal and 2x 22pf caps dont work