#avr | Logs for 2014-05-31

Back
[07:31:24] <Lambda_Aurigae> mischief, ye
[07:31:35] <Lambda_Aurigae> mischief, yes..I have experience with it.
[10:58:39] <megal0maniac> Lambda_Aurigae: Another person collecting statistics :P
[11:03:36] <Lambda_Aurigae> megal0maniac, seems so.
[11:54:57] <rue_shop3> whats the free air speed of a dialed up tiny13?
[11:55:00] <rue_shop3> 4mhz?
[11:55:20] <rue_shop3> (unlaiden)
[11:56:15] <rue_shop3> oooh wait a sec, the t13 dosn't have a uart
[11:58:15] <Lambda_Aurigae> wrong answer...over the edge you go!
[12:01:07] <rue_shop3> oh its 4.8/9.6 Mhz
[12:01:10] <rue_shop3> :)
[12:29:11] <ferdna> isn't today the 31st?
[12:29:16] <ferdna> saleae.com/downloads
[12:32:03] <ferdna> maybe in their GMT time is not 31st yet...
[14:25:18] <ferdna> well maybe its next year... they didnt specified the year... who knows... =/
[14:54:59] <robinsz> Hi, im using Atmel Studio and I have a working C application, id like to convert to C++, initially just using a simple class to store and acess some data. How can I convert a project from C to C++? I've written a skeleton of the class methods and a suitable header file, but the compilation fails when I include the class header
[14:56:38] <robinsz> my somwhat limited understanding was that C++ was (pretty much) backwards compatible with C, so using the C++ preprocessor on a C project should probably compile, or may need a few monot tweeks
[14:56:42] <robinsz> *minor
[14:58:28] <specing> robinsz: is the C++ compiler installed?
[14:58:53] <robinsz> its Atmel Studio 6.1
[14:58:57] <specing> I use vim + g++ so dunno about your setup
[14:59:38] <specing> I've never used atmel studio
[14:59:51] <robinsz> k
[15:00:20] <robinsz> if I start a new C++ project it seems to accept C++ style code
[15:00:53] <robinsz> but no idea where the options are to tell it to use g++
[15:47:38] <z0idb3rg> hi
[16:12:41] <Lambda_Aurigae> robinsz, try to compile the project with C++ crap in it and see if it throws a fit.
[16:39:06] <Casper> robinsz: c++ on avr is not recommended, it use more ressources, that you are very limited with...
[16:39:22] <Casper> and not everything in c++ is supported under gcc
[16:43:43] <kastein> i think i would write a kernel in c++ before an embedded app... which is to say, not a choice i would make :p
[16:45:32] <robinsz> hmm
[16:46:12] <robinsz> you may have a point, it just semeed a nice and simple way to encapsulate the data and functtions for handling a load of DSP stuff
[16:46:29] <robinsz> and, yes it did throw a fit
[16:46:49] <kastein> i mean, there bare reasons it would be a good idea. but they are rare
[16:46:49] <kastein> hmmmm
[16:47:26] <robinsz> filters in a DSP are implemented as biquads
[16:47:34] <robinsz> basically, 5 floating poitn coefficients
[16:47:52] <robinsz> so thats a neat interface on the C++ object
[16:47:57] <kastein> man, i havent done that since 2007
[16:48:06] <kastein> yeah, sounds like it
[16:48:14] <robinsz> the way those are calculated varies on the type of filter being implemented
[16:48:48] <robinsz> so, implenenting them as C++ objects, with a common interface ... yet having varying methods in the back end seemed like a plan
[16:49:33] <robinsz> but, I suppose I can do it as an array of structs too
[16:49:54] <robinsz> and just include a "filter type" enum
[16:52:58] <kastein> i would consider rolling your own using structs and unions and function pointers, if they are supported on avr, i forget if they are.
[16:54:45] <kastein> somewhat clunkier, but much lighter weight
[16:57:47] <robinsz> function pointers ...
[16:59:41] <robinsz> I was think more of a switch statement based on filter type, not sure Ive ever used function pointers .. so I'd grab a pointer to the struct, then call the function stored in the function pointer within the struct, passing the struct as an argument?
[17:03:22] <robinsz> ok, a little reading makes that all clear, yep, I'll go with structs and function pointers
[17:05:26] <twnqx> woah, emulating C++ the hardcore way
[17:10:31] <ub|k> has anyone got any experience with 1620B matrix lcds?
[17:10:41] <ub|k> hd44780 clones
[17:11:51] <robinsz> mmm
[17:13:18] <robinsz> plenty of generic 44780 stuff, but not htat clone in particular
[17:14:28] <robinsz> Peter Fleury's LCD library is pretty good, try that
[17:14:36] <robinsz> http://jump.to/fleury
[17:17:39] <ub|k> robinsz: thx
[17:17:50] <ub|k> i am trying to implement the protocol myself, as it's pretty simple
[17:18:08] <ub|k> i did it once with an rpi and an i2c port expander
[17:18:12] <robinsz> yes, but timings can be a pain
[17:18:15] <ub|k> but can't make it work with an atmega32
[17:18:27] <robinsz> peters library just works and is easy
[17:18:29] <ub|k> site not responding :/
[17:18:35] <robinsz> :(
[17:19:51] <robinsz> http://home.roboticlab.eu/_media/software/lcd.c
[17:19:55] <robinsz> http://home.roboticlab.eu/_media/software/lcd.h
[17:24:56] <ub|k> yeah, found them
[17:24:58] <ub|k> thanks :)
[17:26:47] <ub|k> not working :/
[17:26:54] <ub|k> maybe i'm not connection things right
[17:27:03] <ub|k> weird... i've double checked it
[17:40:22] <ub|k> no luck
[18:25:35] <ub|k> anyway, here's my code, in case someone wants to have a look
[18:26:33] <ub|k> i sincerely don't get what i'm doing wrong
[18:26:46] <ub|k> i've checked 3 different datasheets for the same device already
[18:28:16] <myself> ub|k: do you have someone else's example code that you could compare to, perhaps?
[18:28:38] <myself> implementing your own seems like fun but it's easier if you have a working reference ;)
[18:28:54] <ub|k> myself: i do
[18:29:29] <myself> next question, do you have a logic analyzer where it would be easy to compare their actual outputs? or are you stuck running simulation to see what they do?
[18:30:04] <ub|k> myself: i have my own implementation from some time ago, using an rpi and an i2c port extender
[18:30:06] <ub|k> 4-bit, though
[18:30:29] <ub|k> myself: no logic analyzer :/
[18:31:39] <ub|k> https://gist.github.com/pferreir/dcb134eeaee309c281de
[18:31:45] <ub|k> (had forgotten to paste the code link)
[18:32:55] <ub|k> gotta go now
[18:33:33] <myself> oh wait, the working implementation is yours too?
[18:34:00] <myself> I'm sorry I have so much sympathy for your plight, I really do, but it's only coming out as laughter. We've ALL been there.
[18:41:56] <robinsz> save your energy fot the hard stuff, use the library, be happy
[19:57:47] <thekindlyone> Using avrdude with atmega 328-PU is throwing this:
[19:57:48] <thekindlyone> http://pastie.org/9244893
[19:57:58] <thekindlyone> help?
[20:12:28] <Lambda_Aurigae> thekindlyone, well, something is wrong...no power, something not connected, wrong programmer selected.
[20:12:54] <Lambda_Aurigae> using usbasp with a usb port that isn't compatible.
[20:23:46] <thekindlyone> But I have used this same programmer before. works fine. And it looks like 328 and 328p are different things. don't I need to change the avrdude conf ?
[20:25:30] <thekindlyone> and it says initialized and ready. Then the signature is coming as wrong
[20:25:46] <Lambda_Aurigae> of course they are different.
[20:26:05] <Lambda_Aurigae> and,,initialized and ready is before it tries communicating with the chip.
[20:26:25] <thekindlyone> ah.
[20:26:45] <thekindlyone> but 328 is not in the avrdude devices list
[20:27:08] <Lambda_Aurigae> that looks like much deeper issue
[20:27:21] <Lambda_Aurigae> giving the 0x0000 sig means it's not talking.
[20:29:13] <Lambda_Aurigae> does your usbasp have status LEDs?
[20:34:39] <thekindlyone> yes
[20:35:53] <thekindlyone> power and a green one
[20:36:05] <thekindlyone> the power lights up as soon as I connect it to usb
[20:36:14] <thekindlyone> and green lights up when i run the avrdude command
[20:37:05] <Lambda_Aurigae> so the usbasp is live.
[20:37:16] <Lambda_Aurigae> you sure you have everything connected correctly?
[20:38:21] <thekindlyone> I am currently checking continuity
[20:38:33] <Lambda_Aurigae> it is easy to reverse mosi and miso
[20:38:45] <Lambda_Aurigae> also, anything else connected to the programming pins?
[20:39:51] <thekindlyone> nope
[20:49:03] <thekindlyone> okay
[20:49:04] <thekindlyone> http://pastie.org/9245095
[20:49:45] <thekindlyone> something was wrong with the isp interface I made. I bet some solder is connecting some pin
[20:51:06] <Lambda_Aurigae> so now you need to add an entry for your chip.
[20:51:26] <Lambda_Aurigae> only difference programming wise is the signature as far as I know.
[20:51:31] <thekindlyone> hmm
[20:51:38] <Lambda_Aurigae> the p means picopower
[20:51:45] <thekindlyone> tell me what to change in conf
[20:51:47] <thekindlyone> ?
[20:52:51] <Lambda_Aurigae> the signature
[20:53:32] <Lambda_Aurigae> duplicate the 328p and make an entry for the 328...and change the signature.
[20:53:38] <thekindlyone> can't I add a new one? m328 say.. so that I can use the 328Ps too
[20:54:36] <Lambda_Aurigae> that's what I just said.
[20:54:50] <thekindlyone> oh I missed that. sorry
[20:59:00] <thekindlyone> signature = 0x1e 0x95 0x0F; to signature = 0x1e 0x95 0x14;
[20:59:45] <thekindlyone> yipee!. Thank you so much :)
[20:59:54] <thekindlyone> irc is the best :)
[21:01:04] <Lambda_Aurigae> wish there were an avr channel when I started with AVRs way back when.
[21:08:00] <thekindlyone> why are the pins needed for ISP not in the same row consecutive? Like they are on the atmega 32A? For this I have to connect each wire to the programmer looking at the datasheet each time I need to program it. Or am I doing this in the wrong way?
[21:11:00] <Lambda_Aurigae> they are where the engineers put them.
[21:11:10] <Lambda_Aurigae> you would have to ask atmel engineers
[21:13:01] <thekindlyone> mm, I thought maybe there is a better way to connect it to the usbasp than the way I am doing it.
[21:15:49] <Lambda_Aurigae> make an adapter board that straddles the chip and puts the pins where they belong.
[21:15:59] <Lambda_Aurigae> granted, you would need a different adapter for each chip type.
[21:27:48] <thekindlyone> what I need to do now is, recover my locked out atmega32A(wrong fuse bits) using the 328 as external clock. The question is can I run both mcus with the power from USBASP?
[21:29:42] <Lambda_Aurigae> no clue.
[21:30:14] <Lambda_Aurigae> not knowing how that particular usbasp is made,,,
[21:30:22] <Lambda_Aurigae> I would say, as a rough guess, yes.
[21:31:02] <Lambda_Aurigae> but why not externally powered?
[21:32:15] <thekindlyone> I will have to tie the grounds in case I want to power the 328 with a DC adapter?
[21:33:28] <Tom_itx> of course
[21:33:46] <Lambda_Aurigae> gotta have a reference...GND is your reference.
[21:45:45] <thekindlyone> Hey, i think it worked :) it is giving me all fuses okay. Now what to do to get it to work without the external clock?
[21:46:17] <Tom_itx> set the proper fuses
[21:46:46] <Tom_itx> http://www.engbedded.com/fusecalc/
[21:46:54] <thekindlyone> see last time I tried to do that I locked the chip out. This time I would like to be a little more careful.
[21:47:14] <Tom_itx> ahh.. so you wanna learn from your mistakes?
[21:47:40] <thekindlyone> yes, I would like that.
[21:48:00] <Tom_itx> use the fuse calculator then
[21:48:05] <Tom_itx> it'll help
[21:49:41] <thekindlyone> it says ext clock in features. I don't want to use it. there are internal oc options too. I am reall lost.
[21:49:45] <thekindlyone> *really
[21:58:30] <thekindlyone> DONE
[21:58:47] <thekindlyone> thanks again.
[23:03:33] <Tom_itx> there's a difference between external clock and external crystal
[23:36:34] <rue_shop3> the datasheet for the tiny13 SEEMS to imply you can get 20Mhz out of them