#avr | Logs for 2012-12-17

Back
[01:17:57] <slidercrank> I want to initialise some constants and compilation time. They are quite computable. But the compiler complains: error: initializer element is not constant. Is it possible to do anyhow? I should I fall back to calling a function for assigning initial values to variables?
[01:17:58] <slidercrank> const float pi=3.1415926;
[01:17:58] <slidercrank> const float grad2rad=pi/180;
[01:18:16] <slidercrank> the compiler doesn't like the second line in this example
[01:18:26] <slidercrank> *at compilation time
[01:32:34] <slidercrank> oh, it's a C language limitation.
[01:55:23] <Mr_Sheesh> hmmm is it griping about the 180 not being 180.0, or about using another const in the expression?
[01:57:54] <Mr_Sheesh> Could do #define PI_VALUE 3.14159265 then const float pi = (PI_VALUE); and const float grad2rad = (PI_VALUE/180.0);
[02:03:25] <Richard_Cavell> there shouldn't be anything wrong with that
[02:03:51] <Richard_Cavell> and yeah change it to 180.0 just for anal retentiveness
[02:26:01] <slidercrank> Mr_Sheesh, Richard_Cavell: it's just a C language limitation. It's explicitly stated in the C language standard. C++ allows it
[02:27:47] <slidercrank> $ gcc test.c
[02:27:48] <slidercrank> test.c:2:1: error: initializer element is not constant
[02:27:48] <slidercrank> $ g++ test.c
[02:27:53] <slidercrank> g++ compiles
[02:28:58] <slidercrank> that's because pi is not considered a constant expression (it's a constant variable).
[02:29:42] <slidercrank> and yes, #defines work. But I wanted to use consts.
[02:30:19] <Casper> slidercrank: why don't you use #define instead
[02:30:20] <Casper> ?
[02:30:59] <slidercrank> well, now I have to use them. I have no choice.
[02:31:51] <slidercrank> with consts it would look nicer
[02:32:10] <tld> "We ship to the Norway."… Well allrigh then! ;)
[02:32:35] <Richard_Cavell> slidercrank: so remove the const from the second line
[02:34:43] <Richard_Cavell> slidercrank: I'm discussing your case in ##c, if you want to join
[02:35:09] <slidercrank> well, I've figured out what's wrong and how to workaround it.
[02:35:23] <Richard_Cavell> for one thing, don't use const if you don't need to
[04:04:41] <slidercrank> heh. I'm offered a few Intel 8051 uCs for free
[04:07:45] <OndraSter_> slidercrank, chip wall? :D
[04:13:04] <slidercrank> OndraSter_, why not?:)
[04:13:42] <OndraSter_> hehe
[04:13:48] <OndraSter_> I have got here one 87C51 from Intel
[04:13:55] <OndraSter_> then one or two 80C31s from AMD
[04:14:05] <OndraSter_> and whooooole bunch of EPROMs
[04:14:14] <OndraSter_> including one 1Mbit with 16bit data bus!
[04:14:51] <slidercrank> you're rich:)
[04:15:30] <OndraSter_> heh
[04:15:34] <OndraSter_> I took apart a lot of stuff
[04:15:35] <OndraSter_> old stuff
[04:34:08] <antto> hey
[04:34:55] <antto> does this sentence make sense? "you may have to re-boot the firmware with avrdude"
[04:39:54] <antto> at least i know what the bootloader is this time, it has .c code ;P~
[04:40:10] <antto> slightly modified stk500
[04:52:57] <mitsakos> hello, i'm trying to program lock bits on Atmega168 in order someone not to be able to read the program using isp. i have tried different lock bit configurations but every time i can read the program. Has anybody tried to lock Atmega168 to share the lock bits configuration?
[06:31:14] <OndraSter_> damnit SD card
[06:31:16] <OndraSter_> y u no work
[06:33:10] <OndraSter_> I even checked soldering, it is all ok :(
[06:33:25] <OndraSter_> and that junk yesterday was because I was overrunning my buffer lol
[06:36:53] <inflex> oh choices, choices
[06:37:02] <inflex> monolithic board... or micro boards
[06:42:57] <inflex> SSRs or latching relays... so many choices
[06:46:48] <ok9swl> OndraSter_: Buffer overrun problem was a nice one :)
[06:49:14] <inflex> anyone make sanely priced 2~3W 240V -> 5V converters yet? Cheaper for me to buy a brick and install it within the enclosure
[06:49:51] <inflex> ( yes, I could use a transformer but they have dreadful idle losses )
[06:51:02] <inflex> Ah, Myrra makes some good ones
[06:56:07] <OndraSter_> ok9swl, well
[06:56:12] <OndraSter_> I have now switched to software SPI
[06:56:18] <OndraSter_> thinking I have accidentaly switched DI and DO on the board
[06:56:39] <OndraSter_> and it seems that I did
[06:56:41] <OndraSter_> how awesome
[06:56:49] <OndraSter_> just the one SPI where I can not change it by setting bit :(
[06:57:02] <OndraSter_> > 40 00 00 00 00 95 ff
[06:57:03] <OndraSter_> < 00 00 00 00 00 00 7F
[06:57:03] <OndraSter_> > 40 00 00 00 00 95 ff
[06:57:03] <OndraSter_> < 01 FF FF FF FF FF FF
[07:14:07] <OndraSter_> it seems that I have swapped DI and DO
[07:14:08] <OndraSter_> ffs
[07:15:52] <OndraSter_> hmm
[07:15:54] <OndraSter_> no
[07:16:28] <OndraSter_> unless the DI/DO are written from "microcontroller's" view
[07:19:10] <soul-d> yeah had to tink on that to
[07:19:11] <soul-d> http://www.tayloredge.com/reference/Interface/SDPINOUT.pdf
[07:19:25] <soul-d> made some more sense
[07:20:24] <OndraSter_> hmm
[07:20:27] <OndraSter_> I have got it wired up correctly
[07:20:29] <darknite> that's why miso/mosi are much better terms ;p
[07:20:37] <OndraSter_> yep
[07:20:43] <OndraSter_> or i2c.. :D
[07:21:28] <Tom_itx> do to do di to di
[07:21:37] <Tom_itx> mosi to di
[07:21:43] <soul-d> what stage you want to have from sd init ?
[07:21:44] <Tom_itx> miso to do
[07:23:01] <OndraSter_> chmpf I have got it wired up correctly but with hardware SPI I get no results
[07:23:06] <OndraSter_> well, UART in SPI mode
[07:23:11] <OndraSter_> I must have overlooked something damnit
[07:23:43] <Tom_itx> sd can be a real bugger
[07:31:10] <soul-d> im trying to capture the init sequence to where you either give a read/write pulse :P but syhthezing takes a while and setting up triggers :P
[07:47:42] <soul-d> http://imgur.com/a/uqUzk
[07:48:18] <OndraSter_> I don't have logic analyzer :/
[07:49:49] <yunta> OndraSter_: should be less than one day to write/build simple one....
[07:50:03] <soul-d> me neither fpga stuff
[07:50:25] <soul-d> did build a level converter so i can abuse that software you see with an fpga board
[07:50:44] <OndraSter_> I have got cyclone II board here
[07:51:59] <soul-d> if it's a dev kit with gpio it's as simple as putting few wires to what you want to mesure assuming it's 3,3v level
[07:52:10] <soul-d> the instantiate a signal tap add the nodes
[07:52:19] <OndraSter_> yes it is 3.3V level
[07:52:21] <OndraSter_> hmm
[07:52:22] <OndraSter_> signal tap?
[07:52:26] <OndraSter_> is that part of Quartus?
[07:52:28] <soul-d> yes
[07:52:35] <OndraSter_> sounds nice
[07:52:36] <soul-d> you do need to have talkback turned on
[07:52:38] <OndraSter_> and quite simple
[07:52:55] <soul-d> wich means they send some usage date back
[07:53:30] <soul-d> it is as simple as few wires
[07:53:42] <OndraSter_> nice
[07:53:44] <OndraSter_> will try tomorrow
[07:54:54] <soul-d> :) you will like it since it's as fast fpga can go no trouble watching 50mhz + signals
[07:55:24] <OndraSter_> :)
[07:55:25] <OndraSter_> nice
[07:55:34] <OndraSter_> aren't the GPIOs on the FPGA like... 600MHz?
[07:56:36] <soul-d> i meant general output pins on a dev board they aren't quite that fast since have some protection stuff also wired to idc pinout so i assumed max data rate ide cable can handle
[07:57:39] <OndraSter_> this is the cheapest board I found on ebay :
[07:57:39] <OndraSter_> :D
[07:57:54] <soul-d> de1 ?
[07:58:35] <OndraSter_> http://www.ebay.com/itm/Altera-CycloneII-EP2C5T144-FPGA-Mini-Development-Board-/250935949913?pt=LH_DefaultDomain_0&hash=item3a6cf2ba59
[08:00:26] <soul-d> oh be a bit more carefull there don't see any protection also depending on wich voltage level is given make sure the pins you asign to your wires are 3,3v etc
[08:03:30] <soul-d> you always can put a buffer in between
[08:05:10] <darknite> 4050 <3
[08:08:48] <soul-d> http://i.imgur.com/36H4z.jpg?1
[08:08:54] <soul-d> what i made once for 5v
[08:12:15] <darknite> ah nice, the lvx chip, is that equivalent to 74xx245?
[08:12:25] <yunta> http://mikoton.com/images/osc.png
[08:12:43] <yunta> what I made once for ..... whatever, it's oscilloscope not a state analyzer
[08:12:51] <soul-d> level converter though 5v side 3,3 side
[08:14:33] <soul-d> but i do think rest was same as 245 made that years ago so forgive me forgetting the datasheet :)
[08:17:11] <darknite> ;D as long as you forgive me for asking rather than looking up the datasheets we're cool
[08:18:47] * soul-d makes some cursed voodoo dolls
[08:19:03] <darknite> it's ok, me and baron samedi har homeboys
[08:19:05] <darknite> are*
[08:21:25] <soul-d> :) bbl here need some stuff done
[08:23:14] <darknite> \o
[09:52:44] <ok9swl> bye o/
[11:17:40] <amee2dead> http://www.ebay.de/itm/8-Kanal-5V-Relay-Relais-Module-Modul-fur-Arduino-DSP-ARM-/390457480482 << are these cheap arduino relay boards suitable for switching 250Vac mains? the relays are rated for it on the photo, but i'm wondering about the whole board assembly
[11:20:00] <amee2dead> http://www.sainsonic.com/zen/albums/ebay/sainsmart/20-018-102%208c-relay/8c.jpg << also, why do they have an optocoupler in addition to the relay for isolation? o.O
[12:43:37] <RikusW> !seen abcminiuser
[12:43:38] <tobbor> abcminiuser was last seen in #avr on Dec 16 06:06 2012
[13:04:51] <Tom_itx> http://www2.electronicproducts.com/Major_TV_manufacturers_hit_with_1_92bn_fine_for_price_fixing-article-fajb_price_fixing_CRT_dec2012-html.aspx
[13:04:52] <Tom_itx> woops
[15:08:31] <nn7> so eeprom_write_type takes an 8-bit address but eeprom_write_word takes a 16-bit address
[15:08:36] <nn7> I don't understand how that works
[15:09:15] <nn7> can I only access the lower portion of the eeprom when r/w bytes?
[15:15:40] <Casper> nn7: you sure that you don't need to send it in 2 parts for the eeprom address? like addl and addh?
[15:16:35] <nn7> the avr-libc documentation gives no indication
[15:19:59] <nn7> and... I seem entirely unable to write to eeprom: http://pastebin.com/bGCAY7KR
[15:20:14] <nn7> I'm getting "2a" as a response
[15:33:10] <iSaleK> What's the average price of the cheapest ultrasonic/laser range finder sensors?
[15:33:32] <iSaleK> Or is it cheaper to make separate ultrasonic transmitter + reciever and do calculations with mcu ?
[15:38:38] <nn7> I'm stuck here. I can't simplify this code any further and can't figure out why I can't write to eeprom.
[15:40:35] <nn7> wait, 2a is 42
[15:40:37] <nn7> ug
[15:42:15] <OndraSter_> 42 is the proper answer
[15:42:17] <OndraSter_> to the life
[15:42:18] <OndraSter_> to the universe
[15:42:20] <OndraSter_> to everything!
[15:42:28] <nn7> clearly
[15:42:36] <nn7> when I download the hex dump I don't see the data
[15:46:13] <nn7> So my code seems to work now, but when I use AVR Studio to dump the eeprom, I don't see the data I wrote.
[19:13:53] <hugeone> hello, people
[19:14:59] <hugeone> i've got VERY dumb question about lqfp - how do i detect pin 1? for stm32. i know this channel is about avr, but i donno where to ask else
[19:16:03] <Casper> ##electronics would be the proper place but
[19:16:09] <Casper> there should be a dot near pin 1
[19:16:26] <hugeone> there is two of them <_<
[19:16:31] <Casper> or in one of the corners, or on one side... the datasheet will tell you how to identify it
[19:17:00] <hugeone> Casper: the problem is - dot is not displayed in datasheet.
[19:17:15] <hugeone> this is weird, but this is how it is
[19:17:43] <hugeone> and there is two dots - one with raw edges and one with soft
[19:18:04] <hugeone> Casper: thanks anyway
[19:18:33] <Casper> send them an email... they should answer shortly
[19:18:40] <Casper> or "shortly"
[19:22:12] <xata> Casper: maybe, maybe
[19:55:28] <SethHope> hello!
[20:23:34] <jadew> have you guys ever stumbled upon tripple deck angled pin headers?
[21:14:41] <CapnKernel> ode. ThatMorning
[21:35:19] <Tom_itx> jadew how many positions?
[21:35:28] <jadew> Tom_itx, found some on e-bay
[21:35:50] <jadew> http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=170842981586
[21:35:58] <jadew> I only needed 7 tho
[21:36:35] <Tom_itx> so find me some female headers with long solder leads for pin thru plugin
[21:36:42] <Tom_itx> like pc104
[21:37:01] <Tom_itx> wtf you need those for anyway?
[21:37:19] <Casper> http://youtu.be/13ZFGtNmsUg :D
[21:37:25] <Tom_itx> looks more like a chinese torture device
[21:37:30] <jadew> a header output, vcc gnd and data line
[21:37:33] <jadew> for different sensors
[21:37:51] <Tom_itx> like one of my experimenter boards
[21:38:12] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/boards/atmega32_exp1.jpg
[21:38:39] <jadew> nice, pretty much
[21:39:50] <Tom_itx> i hate that digikey no longer gives you the catalog page a part is found on
[21:40:10] <jadew> do they keep this kind of headers?
[21:40:15] <jadew> I couldn't find them at my local supplier
[21:40:16] <Tom_itx> probably
[21:40:29] <Tom_itx> jameco is cheaper on those snap headers
[21:40:42] <Tom_itx> i dunno about 3 row though
[21:41:20] <Tom_itx> 68574 and 68339
[21:41:27] <Tom_itx> for single and double
[21:41:32] <Tom_itx> straight
[21:41:47] <jadew> $1/ one for 3x40 doesn't sound bad
[21:42:10] <Tom_itx> no
[21:42:34] <jadew> I don't know why they're not more popular
[21:42:50] <Tom_itx> everything is going smaller
[21:42:54] <Tom_itx> they take up space
[21:43:12] <jadew> I guess that's true
[21:43:29] <Tom_itx> smt is even worse on those
[21:43:39] <Tom_itx> i'd rather use thru hole than smt on headers
[21:43:45] <jadew> why?
[21:43:49] <Tom_itx> less space
[21:43:59] <jadew> I see
[21:44:03] <Tom_itx> the leads are bent over and take more space to solder
[21:44:13] <Tom_itx> and i personally think they're not as strong
[21:46:22] <jadew> you can bet on that
[21:47:01] <Tom_itx> one part for stackthrough headers :(
[21:47:06] <Tom_itx> bastards
[21:47:31] <Tom_itx> nonstock
[21:48:40] <Tom_itx> don't arduino thingies use stack thru headers?
[21:48:55] <Tom_itx> i know they're out there, just don't know what they're called
[21:49:40] <jadew> male pin headers
[21:49:40] <Tom_itx> i got an idea
[21:49:44] <jadew> *female
[21:49:49] <Tom_itx> wirewrap
[21:49:51] <Tom_itx> :)
[21:50:20] <Tom_itx> no records match your search criteria
[21:50:23] <Tom_itx> bastards!
[21:56:02] <Tom_itx> apparently they're not that popular anymore
[21:58:26] <Tom_itx> haha mouser has some
[21:59:00] <Tom_itx> it says Manufacturer: arduino :)
[22:01:53] <Tom_itx> mouser just started selling all the arduino line
[22:02:41] <jadew> I'm still amazed by the success of this arduino stuff
[22:03:08] <Tom_itx> they came up with a complete solution is all
[22:06:25] <Tom_itx> i'll find em. i know they're out there
[22:06:49] <Tom_itx> i had some years before arduino was a dream
[22:09:32] <jadew> you're not looking for this, right? http://static.tme.eu/katalog_pics/9/7/e/97e2af9727e6c5553378ee5d0e84af35/bl2.72z.jpg
[22:10:06] <Tom_itx> sorta but with longer leads
[22:10:35] <Tom_L> http://www.mouser.com/ProductDetail/Arduino/A000086/?qs=%2fha2pyFaduhhLEZeAUy%252bojddqGJ6IcunQXDBEpyP8UVqtlqHcynLqg%3d%3d
[22:12:06] <jadew> got it
[22:14:08] <Tom_itx> those are c-grid but with long leads
[22:18:46] <Tom_itx> you are also looking for c-grid but i don't think they make 3 row
[22:28:31] <Essobi> Figures, first thing I try to do ever with the arduino framework... makes no f'ing sense.
[22:33:21] <Tom_itx> why?
[22:43:08] <Essobi> Ah, there.
[22:43:14] <Essobi> Silly me. Flags were wrong.
[22:43:28] <Essobi> Tom_itx: never touched arduino framework. Just bare AVRs.
[22:52:13] <andresjk> hi
[22:52:14] <tobbor> hi andresjk.
[22:52:52] <andresjk> today I had a problem which for me was kinda wierd
[22:53:11] <andresjk> basically i have a program in an ATmega which uses the ADC
[22:53:36] <andresjk> It works ok, the conversion are given from 0 to 5v
[22:54:04] <andresjk> my friend made a circuit which was the sensor signal acconditoner and also works
[22:54:37] <andresjk> but when we connected both circuits (ATmega ) and the sensor's circuit
[22:55:10] <andresjk> the voltage goes to 2.xx and I doesn't change
[22:56:04] <andresjk> am I missing something
[22:56:29] <andresjk> Im assuming that the ADC input has a very large impedance
[22:58:13] <andresjk> so I should mess up the signal coming from the sensor conditioner
[22:58:23] <andresjk> any ideas?
[22:59:15] <andresjk> I will try to buffer the signal before connecting it with the atmega ADC
[23:11:17] <soul-d> wan't there somthing that if vref isn't connected it used the internal 2,5 v ref ?
[23:12:48] <soul-d> srry misred you mean the circuit voltage dips ?
[23:13:55] <soul-d> sepperatly powerd same power supply ?
[23:17:13] <andresjk> thanks soul-d
[23:17:21] <andresjk> actually vref is at 5v
[23:17:35] <andresjk> and avcc is also at 5v
[23:18:04] <andresjk> both circuits are powered with the same gnd and power supply
[23:19:17] <soul-d> so what is problem cirtcuit voltage dips to 2,5 v or reading a static value on the adc ?
[23:20:14] <andresjk> i did some troubleshooting with a voltage divider and I get almost the whole dynamic range of the adc 0 to 1023 something like that (Im using only 8 bits)
[23:20:30] <andresjk> reading a static value on the adc
[23:21:23] <andresjk> when its connected to the sensor circuit, which basically amplifies the sensor's output to the whole dynamic range of the adc ( 0 to 5v=