#avr | Logs for 2014-02-28

Back
[03:19:44] <jerkey> https://github.com/substack/hottube/blob/master/make.sh
[03:40:17] <abcminiuser> Well I now have the greatest domain name in the history of the interwebs.
[04:09:24] <jerkey> fuck github
[04:09:26] <jerkey> fuck git
[04:09:34] <Thrashbarg> \o/
[05:25:14] <lionrouge> hi
[05:25:37] <lionrouge> tell me please which -p option should i set for avrdude to flash atmega644pa?
[05:25:57] <lionrouge> m644p or m644rfr2 ?
[08:46:11] <dunz0r> Anyone played with the Tin167 in here?
[08:46:47] <dunz0r> Got some... but I don't have any breakout boards since they only come in SMD-format, and something to put on my breadboard would be nice... tips on breakout boards?:)
[08:50:12] <The_Coolest> what's tin167?
[08:50:27] <The_Coolest> attiny?
[08:50:50] <The_Coolest> holy crap price
[08:51:01] <The_Coolest> oh shekels.
[08:51:02] <The_Coolest> ffs
[08:51:38] <The_Coolest> still pricey
[08:53:30] <dunz0r> The_Coolest: But it's got 8 PWM-channels :)
[08:53:35] <dunz0r> That's the reason I got it.
[08:53:42] <The_Coolest> ohhhhh
[08:53:49] <dunz0r> Sampled it, so it's not that expensive :D
[08:53:53] <dunz0r> *wasn't
[08:54:19] <The_Coolest> PWM Channels:
[08:54:19] <The_Coolest> 9
[08:54:29] <dunz0r> Oh, misremembered it seems.
[08:54:31] <The_Coolest> how does that work with 2 timers?
[08:56:30] <The_Coolest> what's LIN? *reads datasheet*
[08:56:48] <dunz0r> 4 channels for the 8-bit, 5 for the 16-bit I guess?
[08:56:52] <dunz0r> Or something like that
[09:02:05] <dunz0r> But I haven't used them yet, so I don't know :|
[09:02:28] <The_Coolest> not sure how this works
[09:02:39] <dunz0r> Me neither, I'm no PWM-guru :)
[09:03:14] <dunz0r> Isn't just the timer used for the counting though? And the actual "speed" of the PWM is per channel?
[09:03:19] <The_Coolest> you still only have 2 compare values
[09:03:36] <The_Coolest> pretty sure it's per timer
[09:03:47] <The_Coolest> you set the prescaler
[09:04:10] <dunz0r> Yeah, one prescaler, but I think you can have different pwm-frequencies, right?
[09:05:30] <The_Coolest> nope
[09:05:49] <The_Coolest> frequency is per timer. duty cycle is per channel
[09:06:02] <dunz0r> Oh, that was what I meant :)
[09:06:22] <dunz0r> Different frequencies isn't important for this project anyway :)
[09:06:48] <dunz0r> I'll probably run it without any prescaling anyway, going to be filtered in to an analouge voltage anyway
[09:07:06] <The_Coolest> i think the 4 pwm outputs are a 'lie'
[09:07:18] <The_Coolest> you still have 2 channels per timer
[09:07:26] <The_Coolest> just more outputs
[09:07:49] <dunz0r> As long as I can have different duty cycles per output I'm content :)
[09:08:46] <The_Coolest> that's what i'm saying, don't thik that will work
[09:08:50] <The_Coolest> think*
[09:08:51] <dunz0r> D:
[09:09:11] <The_Coolest> you still have just 2 channels, so 2 duty cycle setting per timer
[09:10:27] <dunz0r> Hmm... but on another project, I used TCCR0 as a timer but could do different duty cycles per output
[09:10:37] <dunz0r> Like this: https://github.com/dunz0r/AVR/blob/master/Minisumo2013/motors.c
[09:11:04] <The_Coolest> i could be wrong
[09:11:08] <dunz0r> TCCR0 for the prescaling etc, and OCR0A/B for the duty cycling.
[09:11:57] <dunz0r> I think I can't have different prescalers or different modes per output as I would if I had a timer per output, but it's not that important if the timers are synced or not for this.
[09:12:00] <dunz0r> Neither is the mode :)
[09:12:36] <dunz0r> I guess I'll have to whip out a breakout and test!
[09:12:58] <dunz0r> It's a TSSOP20, so it's not unbelievably tiny at least
[09:16:50] <bblaze> hey everyone.. i need a little help, last night i was pointed to AVR112 (TWI Bootloader).. I'm trying to compile the master (originally setup for 2560) to an atmega328p. I'm not getting any connectivity and was wondering if i could run my define vars past someone?
[09:18:34] <bblaze> or maybe i should choose a different target for the master side? maybe a 644p, or if i REALLY have to, a 2560 as originally designed
[09:22:18] <The_Coolest> it looks like all 8 outputs are on the 16bit timer, and the 8 bit timer only has 1
[09:22:22] <The_Coolest> dunz0r ^
[09:29:30] <The_Coolest> bblaze your target chip must be the one you're targetting
[09:29:33] <dunz0r> The_Coolest: Aaah. I'll have to do some testing, or hope that someone who actually knows this stuff better than either of us answers :)
[09:29:55] <The_Coolest> hehe yeah
[09:30:13] <The_Coolest> also look at atxmegas :P they have a crapload of timers and pwm
[09:30:21] <bblaze> the_coolest: i've setup the target and changed some of the defines accordingly. It is compiling, just not running so i suspect i have a signatur byte or defined register incorrect
[09:31:01] <bblaze> maybe if i post a few vars you could confirm / deny them ?
[09:31:01] <dunz0r> The_Coolest: Yeah... but they've got some weirdo protocol for uploading if I'm not mistaken
[09:31:32] <The_Coolest> bblaze this bootloader is for devices without a bootsection
[09:31:37] <The_Coolest> or so says the pdf
[09:31:48] <bblaze> right, so wouldn't work on the 328?
[09:32:42] <bblaze> i've got the slave on my attiny85.. and i do have an arduino mega2560 that i could try, but i don't really need all that in my final product
[09:32:50] <The_Coolest> 328p has a bootsection
[09:33:17] <The_Coolest> it *may* work if you upload as a normal program, not as a bootloader
[09:33:37] <bblaze> right, so isp it in or something
[09:34:54] <The_Coolest> bblaze why do you want to use I2C?
[09:35:56] <bblaze> so, i've got a "core" (which i'm trying to load on the 328p) and a series of i2c slaves (attiny85).. i'd like to be able to program the slaves easier
[09:36:16] <The_Coolest> ohh
[09:36:45] <bblaze> i'm not locked in to that, but thats what was suggested last night up in here
[09:36:48] <The_Coolest> so your avr112 is meant for the attiny's and the master is supposed to go on the 328
[09:37:38] <bblaze> avr112 contains both the master and slave bootlodaer bits.. i've got the slave loaded i believe, but can't get the 328 to interface w/ the provided host app.. i don't really see much of anything in serial data coming off the 328 either..
[09:37:40] <The_Coolest> but then again, you could just use isp to program the tiny's from the 328p if you can spare the pins
[09:38:30] <bblaze> i could certainly spare the pins on the 328.. maybe a jumper to decide what slave to program or something.. but then i'm shifting around isp cables.. and ultimately, i'd like the master to load the firmwares in from sd card
[09:39:22] <bblaze> thats why i'm thinking the UART reg's in my defines.h might not match up for the 328
[09:39:37] <bblaze> or it could be that its got the arduino bootloader on it and i need to ISP a fresh chip
[09:40:41] <bblaze> theres like 5-6 defines that i could see being wrong maybe
[09:40:42] <bblaze> #define _B2048 // boot size select: _Bxxxx (words), powers of two only
[09:40:52] <bblaze> #define APP_END 15658
[09:40:52] <The_Coolest> you could use a shift register or something, and just set reset to low for the attiny you want to program
[09:41:08] <bblaze> #define SIGNATURE_BYTE_1 0x1E #define SIGNATURE_BYTE_2 0x95 #define SIGNATURE_BYTE_3 0x0F
[09:42:01] <bblaze> and also #define BRREG_VALUE 103
[12:49:50] <braincracker> hello my friends :)
[13:12:57] <zmo> hi!
[13:13:43] <zmo> I don't understand why I can't find the Atmel JTAG ice 3 in atmel studio, is there anything I should install?
[13:14:51] <megal0maniac_afk> zmo: No, it should just work
[13:15:10] <zmo> :-s
[13:15:24] <megal0maniac_afk> zmo: Try this https://gallery.atmel.com/Products/Details/c578bdc7-3f6a-4ff1-b2c1-8419ba25dce7
[13:15:26] <zmo> and there I'm being regularly told that linux is harder than windows to use :-s
[13:15:46] <megal0maniac_afk> Then open Atmel Studio again and go to Device Programming, then upgrade to latest
[13:16:22] <megal0maniac_afk> I've never had a single issue with the thing. You're either just unlucky or you've somehow killed it
[13:16:33] <zmo> I guess I'm unlucky
[13:16:47] <megal0maniac_afk> Let's hope :P
[13:25:19] <megal0maniac> RikusW: o/
[13:25:29] <RikusW> hi megal0maniac
[13:25:55] <megal0maniac> Got U2S debug compiling, but can't seem to make it do anything
[13:26:01] <megal0maniac> Get "failed to get CommState"
[13:26:36] <megal0maniac> VS2010 express is not good enough it seems (project would only upgrade with pro version)
[13:26:37] <RikusW> the comport might be hardwired to COM3
[13:26:45] <megal0maniac> Ohnoe!
[13:26:49] <megal0maniac> Well I'll try that first
[13:26:57] <RikusW> find and replace should fix that
[13:27:05] <RikusW> or just find
[13:28:23] <RikusW> megal0maniac: change it in U2S_Debug.cpp
[13:28:41] <RikusW> u2s.Connect("COMxx,.....
[13:29:22] <RikusW> --> "failed to get CommState" might not be too serious...
[13:29:54] <megal0maniac> I've put it back to COM3 and changed the code back to default, but it still doesn't seem to work
[13:29:59] <RikusW> megal0maniac: single step through U2S_Debug.cpp and measure the IO pins
[13:30:08] <megal0maniac> Does U2S GUI keep the port open?
[13:30:21] <zmo> ok, there's a /!\ next to JTAGICE3 in windows' device manager
[13:30:22] <RikusW> no, unless in the debug dialog
[13:30:41] <megal0maniac> zmo: Ask windows WHY?
[13:30:52] <RikusW> zmo: sound like fun with win drivers....
[13:30:56] <zmo> indeed
[13:31:07] <zmo> when I do "update driver" he says he find it
[13:31:11] <zmo> but actually he does not
[13:31:12] <zmo> !@#$
[13:31:25] <RikusW> on which win version ?
[13:31:25] <zmo> I now remember why I stopped using windows back 15 years ago :-s
[13:31:27] <zmo> 8.1
[13:31:56] <RikusW> I don't even have 8, don't intend to get it either
[13:32:04] <RikusW> Mint is bset :)
[13:32:11] <zmo> well, I need a win 8.1 for work
[13:32:19] <zmo> as I have to test how buggy is the serial connection
[13:32:25] <zmo> with latest windows
[13:32:37] <RikusW> megal0maniac: if the comport opens the other code should work
[13:32:38] <zmo> otherwise I work only using a linux and osx :-)
[13:33:01] <RikusW> megal0maniac: you'll have to look in device manager to get the exact port to use
[13:33:56] <megal0maniac> COM3 is good, but U2S Debug is not succeeding
[13:34:18] <RikusW> I haven't booted my dual boot win7 for months, that is until I started playing Supreme Commander again :-P
[13:34:18] <RikusW> otherwise my XP virtual box is just fine
[13:34:22] <megal0maniac> Single step == Step over?
[13:34:53] <RikusW> megal0maniac: F10, that used to be single step, step over should do the same
[13:35:03] <RikusW> just a rename I guess, same thing
[13:41:32] <megal0maniac> RikusW: Do you remember off-hand which pin the LED is on?
[13:41:43] <RikusW> C2
[13:41:52] <RikusW> C2=0 for led on
[13:42:24] <RikusW> but Debug mode can't use it iirc, its used for rx/tx indication....
[13:42:48] <megal0maniac> It is, just discovered that
[13:42:51] <RikusW> use a meter connected to another pin
[13:42:59] <megal0maniac> But it's flashing as I step, so it does work
[13:43:13] <RikusW> it will because of rx/tx
[13:43:26] <RikusW> so you finally got this working ? :)
[13:43:33] <megal0maniac> Think so :P
[13:43:41] <megal0maniac> Was previously trying with VS2010 express
[13:44:02] <RikusW> its great for testing PWM setup etc
[13:44:12] <RikusW> even simple slow bitbanging
[13:44:50] <RikusW> it will save you a great deal of reflashing
[13:45:29] <RikusW> I did an entire PLL interface using just the debug mode
[13:45:54] <RikusW> I can actually make it work on _any_ avr
[13:46:12] <megal0maniac> Cool, it works with an LED!
[13:46:28] <RikusW> just need some more work on xslt to generate appropriate register files
[13:46:34] <RikusW> nice :)
[13:46:46] <megal0maniac> To what extent can you use PORTD, PIND, &= ~(1 << 6) etc?
[13:46:52] <RikusW> I bet you'll soon wonder why you didn't start using it earlier
[13:47:06] <megal0maniac> Because I didn't have a VS Pro :P
[13:47:21] <RikusW> you can use = &= |= and read using var = port;
[13:48:03] <RikusW> look at the top of U2S_Debug.h for the magic used to create this
[13:48:13] <RikusW> just operator overloading
[13:48:20] <megal0maniac> Can I test using (REGISTER & (1 << BITMASK)) ?
[13:48:38] <megal0maniac> Oh yes. That part wouldn't compile. I needed to specify a return type..
[13:48:39] <RikusW> not sure, it might work
[13:48:51] <RikusW> use step into to check
[13:49:02] <RikusW> it should go into operator u8() { return u2s.ReadByte(address); };
[13:49:12] <megal0maniac> error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
[13:49:21] <megal0maniac> For: operator=(u8 u) { u2s.WriteByte(address,u); return 0; };
[13:49:32] <megal0maniac> So I made it: int operator=(u8 u) { u2s.WriteByte(address,u); return 0; };
[13:49:55] <RikusW> that might not work as expected
[13:50:05] <megal0maniac> I don't know what to expect :D
[13:50:08] <megal0maniac> pm?
[13:50:14] <RikusW> ok
[13:50:46] <Xark> RikusW: Just return void in that case. :)
[13:50:53] <Xark> er, megal0maniac
[13:51:50] <RikusW> megal0maniac: seems I still need to learn a few things about operator overloading and how it effects everything...
[13:51:52] <megal0maniac> I shall try that. Thanks!
[13:55:25] <megal0maniac> Xark: void returns error C2562: 'IOPort::operator =' : 'void' function returning a value
[13:55:31] <megal0maniac> For all instances
[13:55:42] <RikusW> remove the return 0
[13:58:56] <RikusW> megal0maniac: I might have to overload the & and | operators
[13:59:33] <megal0maniac> You have
[13:59:40] <RikusW> like so:
[13:59:41] <RikusW> operator&(u8 u) { return u2s.ReadByte(address) & u; }
[13:59:41] <megal0maniac> I'm just using the first line as an exampe
[13:59:59] <RikusW> operator|(u8 u) { return u2s.ReadByte(address) | u; }
[14:00:15] <RikusW> just add there 2 lines to the header
[14:00:19] <megal0maniac> Ah, rather that |= and &=
[14:00:31] <RikusW> no both
[14:00:38] <RikusW> &= & |= |
[14:00:47] <megal0maniac> Well yeah, I meant that :)
[14:01:24] <RikusW> did the void return value work ?
[14:01:27] <megal0maniac> Hang on that's wrong
[14:01:38] <megal0maniac> void for the first 3, yes
[14:02:02] <RikusW> I'll have to update on my side too
[14:02:22] <megal0maniac> http://pastebin.com/raw.php?i=yxP4ZXwK
[14:02:38] <megal0maniac> It's plaintext, don't be scared :P
[14:02:57] <RikusW> no wrapping html even :)
[14:03:12] <RikusW> raw.php :)
[14:03:40] <RikusW> bottom 2 should not be void
[14:03:51] <RikusW> *3
[14:04:18] <megal0maniac> Changed the & and | to int
[14:05:18] <RikusW> megal0maniac: Have you used C++ before ?
[14:05:30] <RikusW> or is this right into the deep end ? ;)
[14:05:38] <megal0maniac> http://pastebin.com/raw.php?i=8s93mTzt
[14:05:42] <megal0maniac> That's main
[14:06:02] <megal0maniac> Never hits the breakpoint :/
[14:06:09] <RikusW> and is it working for LCD ?
[14:06:15] <megal0maniac> In app, yes
[14:06:23] <RikusW> and this code
[14:06:41] <megal0maniac> The breakpoint is on the line where LCD_DDR_CTRL is set
[14:06:52] <megal0maniac> (Sorry, makes little sense without the header)
[14:07:04] <RikusW> breakpoint on failed to connect too
[14:07:15] <megal0maniac> RikusW: I know a fair bit of C, and Java. No C++
[14:07:35] <RikusW> Java and C++ is somewhat similar
[14:09:07] <RikusW> megal0maniac: I made a console app, hence using main and not winmain
[14:09:43] <megal0maniac> Okay, breakpoints on both lines. It stopped the first time, got 2 lines in then deadlocked. Now it isn't listening anymore and U2S GUI won't start :P
[14:10:00] <megal0maniac> Ah, it starts but can't connect
[14:10:51] <RikusW> maybe time to kill all apps using the serial port and unplug then replug the U2S
[14:11:05] <RikusW> (or reset the U2S)
[14:11:20] <megal0maniac> :D
[14:11:24] <megal0maniac> Explorer just crashed
[14:11:33] <RikusW> how ?...
[14:12:04] <RikusW> win XP 7 8 ?
[14:12:41] <RikusW> if you really want to see windows crash start messing with hooks and debug while using hooks....
[14:12:48] <RikusW> things can get really bad
[14:13:00] <megal0maniac> I don't plan on it :P
[14:13:04] <megal0maniac> Win 7
[14:13:41] <megal0maniac> Alright, it pauses for 2s after setting data port to output. After function set, it runs away from me
[14:13:59] <megal0maniac> Pausing says the process is deadlocked
[14:14:01] <RikusW> wierd
[14:14:28] <megal0maniac> Indeed
[14:14:33] <megal0maniac> Which version of VS did you use?
[14:15:09] <megal0maniac> And U2S GUI can't communicate anymore
[14:15:25] <RikusW> 97
[14:15:39] <megal0maniac> Ah...
[14:15:48] <RikusW> should work in 2010
[14:15:53] <megal0maniac> It mostly does
[14:16:04] <megal0maniac> I'll try be more manual, and explicit
[14:16:27] <RikusW> Does my example code work right at least ?
[14:16:56] <megal0maniac> Haven't tried it :P
[14:17:08] <megal0maniac> But I could single step through an LED flashing, so it seems to be fine
[14:20:32] <megal0maniac> Oh wow. My code is wrong and messes with the lower bits of PORTC. That explains a lot :)
[14:21:23] <megal0maniac> AND IT WORKS! :d
[14:21:25] <megal0maniac> :D
[14:21:31] <RikusW> ugh
[14:21:35] <RikusW> PORTC again
[14:21:45] <RikusW> so the LCD code works ?
[14:23:30] <megal0maniac> Maybe you should put exception handling for any attempt to write to the dangerous bits?
[14:23:49] <megal0maniac> http://i.imgur.com/m6VFBwfl.jpg
[14:24:21] <RikusW> nice :)
[14:24:53] <RikusW> that looks like a lot of wires to me...
[14:25:00] <megal0maniac> It's 8bit parallel
[14:25:23] <megal0maniac> VCC + GND for main power and backlight, 3 control lines, a contrast line and 8 data
[14:25:58] <megal0maniac> So 16 total
[14:26:15] <RikusW> now you know why I like serial ;)
[14:26:23] <megal0maniac> :P
[14:26:33] <RikusW> imagine connecting a 64 bit bus like that :-D
[14:26:41] <megal0maniac> You can use it in 4bit mode, with an I2C bus expander
[14:26:55] <megal0maniac> I have another screen which is hardwired to work like that
[14:27:07] <megal0maniac> From the Arduino days, when I2C was easy :(
[14:27:28] <RikusW> 32U2 don't have I2C, you'll have to bitbang
[14:30:15] <megal0maniac> I have other chips which will do it, but it's a mission
[14:30:50] <RikusW> thats why I haven't yet used I2C :-P
[14:31:08] <megal0maniac> Cool. Put everything back into methods. Now I just call lcdInit and lcdWriteText :)
[14:31:37] <RikusW> functions in C speak
[14:31:46] <megal0maniac> functions
[14:34:44] <megal0maniac> Ah, this works nicely
[14:35:06] <RikusW> now you see why I recommended it
[14:35:49] <megal0maniac> Just needs a bit of an update ;)
[14:36:04] <megal0maniac> And to work with VS express, if that's even possible
[14:36:20] <RikusW> not sure about express
[14:36:26] <RikusW> you need native compilation
[14:37:26] <megal0maniac> Trying it with Dev C++ (uses MinGW)
[14:38:01] <megal0maniac> I clearly don't know enough to make this work
[14:38:02] <megal0maniac> :)
[14:38:45] <RikusW> I did get debug mode to work in Linux
[14:43:47] <megal0maniac> I'm still at level n00b
[14:44:21] <megal0maniac> But it's working nicely. Integrated the init, setCursor, clear etc. functions
[14:44:28] <megal0maniac> All working
[14:44:46] <megal0maniac> It runs at 8Mhz right?
[14:44:56] <RikusW> in debug mode ?
[14:44:59] <RikusW> probably
[14:45:09] <megal0maniac> Sies :P
[14:45:17] <RikusW> but since everything goes over USB its much slower than that
[14:45:18] <megal0maniac> You should know :P
[14:45:57] <RikusW> and you won't be able to change CLKPR using debug mode...
[14:46:08] <megal0maniac> Yeah, but the execution of the commands. I mainly ask for stuff like PWM which requires a known F_CPU
[15:05:05] <guanche> is anybosy using an atx power supply to power a circuit?
[15:07:05] <guanche> I wonder if it's safe to use the stand-by line, while also wanting to use the usart, such that both grounds are shared
[15:37:16] <naquad> did someone here hooked servomotor mg90s? i can't figure out its pulse length and min/max duty :(
[16:20:17] <naquad> any good tutorial on how to work with servo motors?
[16:53:32] <naquad> for pwm how do i calculate pulse cycle length?
[21:36:41] <Joel_re> hi, has anyone interfaced over Nokias Fbus protocol?
[21:37:07] <The_Coolest> https://www.kickstarter.com/projects/70308014/kings-assembly-a-computer-mouse-full-of-awesome
[21:37:20] <Joel_re> I want to hook this phone http://www.cpkb.org/wiki/Nokia_1650_pinout
[21:37:23] <Joel_re> to a uC
[21:37:29] <Joel_re> and use it as a cheap GSM modem
[21:37:34] <Joel_re> any thoughts?