#avr | Logs for 2014-10-12

Back
[04:50:49] <anton02> is this valid code? im just wanting to invert the bit on portb7, PORTB7 = ~PORTB7
[04:52:45] <Jartza> that will invert all the bits
[04:53:17] <Jartza> oh, sorry, PORTB7
[04:53:39] <Jartza> no, that's not valid code :)
[04:53:42] <malinus> ^
[04:54:29] <anton02> what do i do then?
[04:54:54] <malinus> anton02: I *could* give you the answer, but I think it's a better idea if you use the next 15min to read this article http://playground.arduino.cc/Code/BitMath and actually learn something about bitmath. After those 15min this task will seem very simple :)
[04:55:16] <anton02> i already know bit math, brain just isnt working atm
[04:57:38] <anton02> is it PORTB7 ^= 1
[04:58:47] <Jartza> PINB |= (1 << PB7)
[04:58:56] <Jartza> or, if you want, PORTB7
[04:59:08] <malinus> anton02: you don't have direct acess to the pin. You only have access to the port
[04:59:17] <malinus> anton02: you can't just PORTBN = X
[04:59:24] <Jartza> oh
[04:59:28] <anton02> so my math was right just not PORTB7 bit
[04:59:29] <malinus> you have to change the whole port every time
[04:59:32] <Jartza> misread. you want to invert it
[04:59:34] <anton02> no pun intended
[05:00:51] <malinus> Jartza: PINn is for input
[05:00:58] <anton02> PORTB ^= (1 << PB7)
[05:03:32] <anton02> amiright?
[05:04:25] <malinus> anton02: yes
[05:04:31] <anton02> yay
[05:09:35] <malinus> anton02: how would you clear a bit :)?
[05:10:18] <anton02> PORTB &= ~(1 << PB7)
[05:10:50] <anton02> i think
[05:11:16] <malinus> yes
[05:11:21] <anton02> cool
[05:19:06] <anton02> is it valid to check PB7 directly?
[05:19:22] <anton02> eg if(PB7){ do stuff;}
[05:22:51] <anton02> if not, is there an alternative to doing if(PORTB & 0b10000000)
[05:23:55] <anton02> how about if(PORTB & PB7)
[07:01:15] <Kre10s> anton02, if(PORTB & (1<<PB7))
[07:19:53] <LeoNerd> Wow.. these two chips' timers are /way/ off. 500msec loop on my ATmega328 vs. 500msec on my tiny84.. nothing like it
[07:20:04] <LeoNerd> This may require some calibration
[07:26:12] <Lambda_Aurigae> sure they are both running at the same frequency?
[07:41:14] <LeoNerd> Oh; not at all... they're two different boards on two different ends of a radio link.
[07:41:39] <LeoNerd> I was just hoping they'd be "close enough" for a beacon ping to fine-tune
[08:02:15] <Lambda_Aurigae> what are you using for the 500ms delay?
[08:21:35] <Dominykas> Hell guys, so i have connected 3 74hc595 in series, wired them up, but when i try to turn on a lot of leds at the same time, i get this problem: https://www.youtube.com/watch?v=wwhUf9VH1Jo&feature=youtu.be
[08:22:15] <Dominykas> i am touching the 74hc595, then not touching them and then touching them again, and for some reason, the leds change brightness
[08:23:32] <Dominykas> im sure 100% that i am touching the 74hc595 and not the wires around them, so im stumped, how do i make them all one brightness(voltage) ?
[08:26:38] <Dominykas> also i just noticed, i wanted to say hello, not hell..
[08:27:26] <Lambda_Aurigae> turning them all on at once?
[08:27:51] <Lambda_Aurigae> how much current do you have available for that?
[08:27:58] <Dominykas> i mean the whole line on
[08:28:04] <Lambda_Aurigae> and,
[08:28:10] <Lambda_Aurigae> how much current do you have available?
[08:28:51] <Dominykas> 20A
[08:29:00] <Lambda_Aurigae> how are you powering it? how much current is being drawn by each LED?
[08:29:02] <Lambda_Aurigae> 20A?
[08:29:02] <Dominykas> ofcourse mostly about 2A usable
[08:29:14] <Lambda_Aurigae> you have a 20A bench supply there?
[08:29:18] <Dominykas> i have converted a atx power supply
[08:29:25] <Dominykas> and it says on the 5v line
[08:30:15] <Lambda_Aurigae> how much current is each LED drawing? and how much does the entire line draw at once?
[08:31:24] <Dominykas> one moment
[08:31:38] <Lambda_Aurigae> and are you cycling through the LEDs or are they all just turned on together?
[08:31:52] <Lambda_Aurigae> from the video it looks like they are cycling.
[08:33:26] <Lambda_Aurigae> you could have a grounding issue or a capacitive issue causing the oscillator to change speed...cant tell squat from that video really.
[08:33:26] <Dominykas> yes they are cycling
[08:35:00] <Lambda_Aurigae> maybe you need to kick up your cycling speed some.
[08:40:25] <Dominykas> Hmm, when i change the rate of cycle, it cycles, but its still very dark.. but now the fire line (the first 74hc595) is always on
[08:40:55] <Dominykas> so i will try to fix that first, and then see if i can check the current
[08:41:35] <Lambda_Aurigae> well, the 74hc595 will, in theory, run at 76Mhz, give or take.
[08:41:44] <Lambda_Aurigae> what is your update frequency?
[08:42:32] <Lambda_Aurigae> what resistors do you have on the LEDs?
[08:42:47] <Dominykas> leds are 5mm, using 330ohm
[08:43:00] <Dominykas> im not realy that knowledgable with the update frequency
[08:43:45] <Lambda_Aurigae> what is your pulse width percentage?
[08:43:51] <Lambda_Aurigae> on/off time.
[08:44:00] <Lambda_Aurigae> on and off 50% of the time each?
[08:44:49] <Lambda_Aurigae> you might drop the resistor down to 220ohm or maybe even 100ohm and test. With them not on all the time they need more current to kick up the brightness.
[08:46:05] <Lambda_Aurigae> would help to know what your update frequency is.
[08:46:09] <Dominykas> Well, i looks like im not supplying enough current, because when i make it that 3 leds are on at the same time, the leds are all the same brightness
[08:47:16] <Lambda_Aurigae> put a voltmeter on the input power and watch to see that it doesn't drop when you turn on lots of LEDs...if it does drop then your supply can't provide enough current to drive them all.
[08:48:43] <Lambda_Aurigae> http://www.calctool.org/CALC/other/converters/freq for those who might need to convert frequency to pulsewidth or versa-visa
[08:55:03] <Dominykas> okay looks like, when i used a delay of 1 microsend (probably larger, because the atmega8 cant get that delay) and it works
[08:57:27] <Dominykas> so thanks!
[09:57:51] <ColdKeyboard> I'm trying to use Nokia 5110 display. I write data a 0xFF but it seems that every 2nd row is going black. Any hints to what I might be doing wrong?
[10:03:31] <Lambda_Aurigae> no clue ColdKeyboard
[10:03:35] <Lambda_Aurigae> never used one before.
[10:08:34] <ColdKeyboard> :\
[10:13:47] <Lambda_Aurigae> guessing one should read the datasheet.
[10:38:29] <ColdKeyboard> I red it... I'm doing everything alright. I opened the LCD and it seems that contacts didn't align perfectly or something
[10:38:37] <ColdKeyboard> After realigning it works like a charm :)
[13:24:13] <RevoShavik> Does anyone know of a dev board for the ATMega1284p? I've seen the Xplained board but it seems to have a very small number of headers. Maybe I'm just missing something. If not, does anyone know of any alternatives?
[13:25:31] <Lambda_Aurigae> RevoShavik, any solderless breadboard, 5V power supply, a few passive components, and a programmer.
[13:25:50] <Lambda_Aurigae> atmega1284p comes in a 40pin dip package so it is easy enough to work with.
[13:26:34] <Shavik|Mobile> I was just looking for something a bit more permanent than a breadboard but I don't want to go to the extreme of making a PCB for this project just yet
[13:26:49] <Shavik|Mobile> Thanks I'll look into the 40 pin DIP
[13:27:17] <Lambda_Aurigae> I've been using that chip for several years now.
[13:37:15] <Casper> RevoShavik: also, look up for another pin compatible board
[13:37:30] <Casper> so you can put it in it instead
[13:38:33] <Lambda_Aurigae> atmega32 has the same pinout.
[13:38:48] <Lambda_Aurigae> mostly...a few extra things on some pins...
[13:39:16] <Lambda_Aurigae> but I have dropped them into boards that came with atmega32 chips in them.
[14:57:14] <Tom_itx> PORTB &= (1<<7);
[15:10:04] <Jartza> malinus: not exactly true. "However, writing a logic one to a bit in the PINx Reg- ister, will result in a toggle in the corresponding bit in the Data Register."
[15:10:10] <Jartza> check your friendly datasheet ;)
[15:11:29] <RevoShavik> I'm pretty much to the point of giving up on trying to get a custom IMU working. Does anyone know of a IMU module that is all inclusive in it's filtering and will simply output yaw pitch roll via say I2C.. maybe spi?
[16:16:03] <cmtptr> I just added the first interrupt vector to my program, and avr-gcc sticks it at address 0 with no initialization code to jump over it to my main function. what's the dealio?
[16:32:21] <Tom_itx> RevoShavik yeah but it's about $800
[16:35:16] <pingo> ATMEGA328P-AUR
[16:35:26] <pingo> what does the "AUR" mean ?
[16:36:06] <Lambda_Aurigae> did you look in the datasheet?
[16:37:24] <Lambda_Aurigae> aur means 44-lead, Thin (1.0mm) Plastic Gull Wing Quad Flat Package (TQFP) tape and reel
[16:37:43] <Lambda_Aurigae> well, for the atmega1284p it does..
[16:37:58] <Lambda_Aurigae> fewer pins for the 328P but same packaging.
[16:43:25] <cmtptr> discovered my problem; I needed to specify the -mmcu= option on the linking call to avr-gcc
[16:43:38] <Lambda_Aurigae> oops.
[16:43:47] <Lambda_Aurigae> yeah, you gotta specify what processor you are linking for.
[16:43:56] <cmtptr> yeah, that seems like it'd be important
[16:47:53] <pingo> Lambda_Aurigae where can I look up what these different codes mean like AUR AU AN etc. I cant find this in the atmega328p datasheet
[16:48:11] <Lambda_Aurigae> in the datasheet...look in the ordering information section.
[16:48:19] <Lambda_Aurigae> toward the end of the datasheet.
[16:49:28] <Lambda_Aurigae> page 619.
[16:49:31] <Lambda_Aurigae> section 38
[16:49:42] <Lambda_Aurigae> 38.1 is the table that shows the codes.
[16:52:46] <Lambda_Aurigae> so few people actually read the datasheets these days. Just skim through for the sections that they want and then they miss so much.
[16:53:04] <pingo> Thats exactly what I did
[16:53:12] <pingo> Thanks for pointing it out
[16:53:25] <Lambda_Aurigae> before I ever got my first avr I read the datasheet start to finish.
[16:53:38] <Lambda_Aurigae> same with the pic when I started with those before avr too.
[16:53:56] <pingo> :)
[16:54:11] <Lambda_Aurigae> and I still have piles of 74xx series datasheets, in hardcopy, from when I was much much younger,,,like 30 years ago.
[16:55:09] <pingo> Well kudos to you
[16:55:53] <Lambda_Aurigae> rtfm is something I learned long long ago...long before I ever touched a computer even.
[16:56:28] <Lambda_Aurigae> the TTL cookbook was light reading for me as a kid...every 74xx chip ever made was listed in there...or so I thought at the time.
[16:56:34] <Lambda_Aurigae> and/or so it seemed at the time.
[16:58:28] <pingo> well in these days... its hard to devote 100% of one's focust to just one topic
[22:37:12] <alex20032> Hi guy