#avr | Logs for 2014-02-20

Back
[00:31:14] <inahandizha> http://VisitsToMoney.com/index.php?refId=386970
[05:50:43] <The_Coolest> can the atxmega's run at 32mhz without external xtal?
[09:21:45] <tlvb> anyone got anything on the tsl2561 i2c sensor that is not wrapped in five layers of high-level arduino code?
[09:26:57] <Casper> what? you don't like arduino? who the hell do not like that? it's the world best thing on earth, after ramen that's it! /s
[09:26:58] <Casper> :D
[09:30:49] <tlvb> Casper: I don't like or dislike the arduino per se, but for this sensor I thought I would finally try utilizing my launchpad (ti msp430) board, but just about /any/ documentation and or source code example available online is for the arduino and all calls end in some wire library
[09:32:24] <tlvb> Fact of the matter is that I think I have the whole thing up and running, as in I seem to be able to read the ADC register values, and they change with the light level, however the ID register and the power status reads wrong, which have me confused and looking for more documentation
[09:33:11] <madisc> tlvb: might it be a byte order issue ?
[09:33:32] <blathijs> tlvb: Can't you just the Wire library calls with whatever your platform uses for I2c? I mean, if you would find an example without any abstractions, reading and writing I2c AVR registers directly, then you'd still not have anything you can easily reuse, I guess
[09:34:26] <tlvb> madisc: i2c has MSB first specified, also, I verify the bitstreams with a logic analyzer
[09:37:09] <tlvb> blathijs: I am using the i2c stuff available for my micro, stuff seems to be working except for the stuff listed, it's just that I'm used to avr's, so I kind of know how to read avr targeted code better than XYZ targeted
[09:37:57] <johnwalkr> oh god
[09:38:06] <johnwalkr> i came in and wire library (arduino?) and i2c?
[09:38:14] <johnwalkr> it’s really limited
[09:38:27] <johnwalkr> if there was some probelm can someone paste the original thing?
[09:38:43] <johnwalkr> i have some recent experience here
[09:39:36] <tlvb> johnwalkr: the wire library is not a problem more than that a code example written for it is kind of a black box wrt what really happens
[09:40:04] <tlvb> the code I'm actually writing is msp430g2231 targeted assembler
[09:41:12] <johnwalkr> ok well still what i saw so far is familer so can you repeat the problem?
[09:48:51] <tlvb> I've recently bought an tsl2561 i2c interfaced light sensor on a BOB from sparkfun, and I think I have finally succeeded in talking to it, I can read the adc registers, and their values change with the light level. However the product ID register does not read as anything in the datasheet, and the power status which should read as 0x03, reads as 0x33, which has me wondering if there is a problem with my code,
[09:48:53] <tlvb> the sensor, the datasheet or something else
[09:48:56] <tlvb> johnwalkr: ^
[09:49:26] <johnwalkr> ok
[09:51:38] <johnwalkr> you’re writing in assembler.. shouldn’t be a timing thing.
[09:51:49] <johnwalkr> do the adc registers make sense?
[09:52:04] <johnwalkr> or seem randomly off like the power status is?
[09:52:44] <tlvb> johnwalkr: they seem to increase when light increases, and decrease when light decreases, but I have yet to be able to get them into a computer for plotting
[09:52:52] <johnwalkr> hmm
[09:53:10] <johnwalkr> are the values 8bit?
[09:53:11] <tlvb> also, the power status and id values read are consistent, it's just that they are not listed in the dataseet
[09:53:12] <johnwalkr> or 16
[09:53:49] <tlvb> adc registers are 16, everything else is 8
[09:53:54] <johnwalkr> if the values go up and down reliably i would be inclined to think that datasheet is wrong, or missing something
[09:54:27] <johnwalkr> esp if you are putting 16 bit numbers together
[09:54:59] <johnwalkr> up and down reliably is not happening in my experience if anything is wrong
[09:56:05] <tlvb> yeah, that is what I'm hoping for, maybe a new chip revision that has gotten a new part/version number but has not yet made it into the datasheets
[09:56:45] <johnwalkr> or
[09:56:53] <johnwalkr> the “everything else” is 16bit after all
[09:57:01] <johnwalkr> no that doesn’t make sense
[09:58:00] <tlvb> that would be a pretty big datasheet error in that case, since everything is written around eight bit transactions
[09:59:36] <johnwalkr> yeah and it doesn’t make sense mathwise either
[10:01:06] <tlvb> ack! adding more 0xcoffee to the CUP register resulted in an overflow!
[10:10:12] <tzanger> heh
[10:11:52] <tlvb> fortunately in this case, the value stored does not wrap around, but is clamped
[10:42:42] <tlvb> here is an annotated i2c transmission bitstream if anyone cares to check: http://imgur.com/5wLzMod
[15:27:43] <cyber37> I need help dudes ... i have install the new codeblocks on ubuntu, but then i downgrade it to the paquet version .. And now My Avr project have lots of errors .. last he worked with that version of codeblocks but afther the upgrade and downgrade, now he doesn't i have errors in pgmspace.h...
[15:27:48] <cyber37> that kind of damn errors : /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/pgmspace.h|937|error: expected ‘)’ before ‘src’
[15:28:24] <cyber37> i don't know what is that file, i don't know why i have that errors, but that i know is lots of things was uninstalled
[15:29:03] <cyber37> i have resolve other problems before .. all of my projects are broken with that .. >.>
[15:29:09] <cyber37> ubuntu sucks realy
[15:29:24] <cyber37> on google i find nothing about how to resolve that ..
[15:31:21] <Lambda_Aurigae> no clue what codeblocks is, sorry.
[15:34:31] <Lambda_Aurigae> cyber37, I would recommend removing both codeblocks and the avr toolchain and reinstalling..toolchain first, then codeblocks.
[15:34:44] <Lambda_Aurigae> just installed codeblocks here for the heck of it...looks interesting.
[15:35:05] <cyber37> :s
[15:35:30] <cyber37> i had configured in the past all of my AVR DUDE tools in codeblocks, i don't want to loose it buti have no choice
[15:35:37] <cyber37> expected declaration specifiers or ‘...’ before ‘uint_farptr_t’ IT SUCKS TOO MUCH
[15:36:41] <Lambda_Aurigae> avr dude tools?
[15:36:47] <Lambda_Aurigae> avrdude is one tool.
[15:37:24] <Lambda_Aurigae> and is not the compiler toolchain.
[15:37:27] <cyber37> i speak in codeblocks, i have configured "tools"
[15:37:39] <cyber37> when i click on a button in codeblocks
[15:37:50] <cyber37> it use avrdude for transfer the program in the AVR chip ;)
[15:38:15] <Lambda_Aurigae> it seems to me you are currently using a newer configuration file for an older version of codeblocks and things have changed between the two versions enough that it's not compatible.
[15:38:17] <cyber37> without runing avr dude in terminal
[15:38:31] <cyber37> i don't know if it's saved in the configuration file that
[15:38:33] <cyber37> but
[15:38:36] <cyber37> i can try
[15:38:43] <cyber37> i have no choice ..
[15:38:49] <Lambda_Aurigae> I suggest talking to the people who wrote codeblocks.
[15:39:15] <Lambda_Aurigae> http://www.codeblocks.org/
[15:39:20] <Lambda_Aurigae> there is a forum on there.
[15:39:35] <Lambda_Aurigae> probably the best place to ask questions about that software.
[15:40:09] <Lambda_Aurigae> not sure that many people in here would use it, or even know about it.
[15:40:10] <cyber37> it will be faster to remove all of that shit, and reinstall it, i will do it maybe :S i am starting the sudo apt-get remove :d
[15:41:24] <cyber37> that i was speaking about "the tools" is here http://stringofthoughts.wordpress.com/2009/11/06/code-blocks-ide-for-avr-gcc-and-avrdude-ubuntu/ so i would set this again afther
[15:47:13] <Lambda_Aurigae> looks like a pain in the rear end to use though.
[15:47:13] <Lambda_Aurigae> just tried making a basic avr program from the template.
[15:47:13] <Lambda_Aurigae> won't compile.
[15:47:13] <Lambda_Aurigae> it's including things that have no reason to be in an avr program by default.
[15:47:13] <Lambda_Aurigae> if it won't work for something so simple right out of the box then I won't use it.
[15:47:13] <Lambda_Aurigae> I'll just go back to vi and command line.
[19:45:40] <naquad> hi
[19:45:56] <Lambda_Aurigae> low
[19:46:53] <naquad> a noob here: i'm reading a book "Make: AVR Programming" and while connecting programmer to ATMega169P author adds capacitor on pins 7-8 (power), but doesn't say why. why is that needed?
[19:47:10] <Lambda_Aurigae> power smoothing.
[19:47:37] <Tom_itx> .1uf?
[19:47:37] <Lambda_Aurigae> in case the avr draws more current on startup or when doing something in short bursts than the power supply can supply.
[19:47:44] <naquad> Tom_itx, yes
[19:47:46] <Lambda_Aurigae> they are called decoupling capacitors.
[19:47:48] <Tom_itx> if so it's for noise
[19:48:06] <naquad> so noise or power burst? or both?
[19:48:07] <Lambda_Aurigae> or that.
[19:48:11] <Lambda_Aurigae> what do I know?
[19:48:12] <naquad> so both
[19:48:14] <naquad> thanks
[19:48:27] <Tom_itx> alot of times you will see them sprinkled all around a chip
[19:48:33] <Tom_itx> some chips have many power pins
[19:48:34] <Lambda_Aurigae> at every power input.
[19:48:41] <Lambda_Aurigae> as close to the chip as possible.
[19:49:18] <Tom_itx> and _yes_ they all need to be connected to power
[19:49:36] <naquad> i see, thank you. now i'll put it back :)
[19:50:05] <naquad> i've pulled it out and nothing changed. looks like thats related to that letter P which as i understood means lower power usage and less speed