#avr | Logs for 2015-02-21

Back
[03:44:09] <cart_man> Could someone PLEASE help me with this Atmega TWI problem im facing?
[03:57:36] <cart_man> ?
[03:57:45] <cart_man> Ill link my link if someone is keen
[03:57:50] <cart_man> really need the help
[04:00:35] <cart_man> http://www.avrfreaks.net/forum/problems-implementing-twi-24aa32-eeprom-0
[05:38:06] <[1]cart_man> Hey I dont know if anyone replied to my please of help my I got a blue screen and everything went away...couldnt read the replies
[08:41:52] <d-rock> I got my differential ADC code working for my Arduino board (ATMega2560) but the reads seem a bit noisy. I'm reading the delta between two half-bridge pressure sensors (https://www.sparkfun.com/products/10245). I was reading on AVRFreaks about someone adding a low pass filter to sensors for noise reduction; would that help for this situation?
[08:51:50] <Casper> d-rock: differential on avr appear to suck, you lose 1 bit resolution right from the start
[08:52:01] <Casper> so 0-511 instead of 0-1023
[08:52:09] <Casper> just that tell alot
[08:54:24] <d-rock> Yeah, I have pretty low resolution requirements
[08:55:23] <d-rock> These are 50kg load cells and basically I need to know when something is at/near 35kg (full beer keg), 20kg (half full beer keg) and < 10kg (time to order more!)
[08:55:43] <d-rock> My test values seem to be differentiated enough for that to work
[08:55:46] <vsync> i think you need 200 bits
[08:55:58] <d-rock> vsync: What???
[08:56:24] <d-rock> Typo?
[08:57:05] <d-rock> 200 bits seems like it would let me not only measure the keg, but seismic activity several states away ;)
[08:57:38] <vsync> that'd be just swell
[08:58:01] <d-rock> Right now I'm reading the full 10 bit value. I should be able to just right shift it, correct?
[09:13:30] <cart_man> Hey Is there anyone here who worked with TWI before?
[09:16:16] <cart_man> I cant seem to figure out why the hell my TWI does not want to work ... No matter what I do I keep on getting NACK
[09:17:35] <cart_man> I will send a link to a post I made if anybody can please try and help me withit
[09:22:47] <cart_man> http://www.avrfreaks.net/forum/problems-implementing-twi-24aa32-eeprom-0 <-- This is my issue that I cant seem to resolve
[09:30:54] <vsync> the last guy might be right
[09:30:59] <vsync> if that does not work, trace the signal
[09:31:04] <vsync> if that does not work, rewrite your own code
[09:53:15] <cart_man> vsync, Yea I tried ...thing is ive been sitting with this for 2 days now straight trying and testing everything... Ive even tried replacing the EEPROM IC.
[09:53:29] <cart_man> I have done I2C before and it worked fine but it was on a DSL RTC
[11:41:41] <rue_more> working on getting an i2c eeprom to work iwth an avr?
[11:42:00] <rue_more> cart_man, did you remember the pullup resistors?
[11:42:36] <rue_more> I think I have some working eeprom code I can try to dig up if you want
[11:51:08] <cart_man> rue_more, That would be amazing man! Yes please
[11:51:28] <cart_man> Yes I have the resistors on 10K
[11:51:39] <cart_man> They worked fine with the RTC
[12:11:53] <cart_man> rue_more, Sorry I dced cause our power tripped :/
[12:11:55] <cart_man> Load shedding
[12:12:02] <cart_man> did you manage to get any of that code?
[12:12:49] <DKordic`> cart_man: What is the EEPROM IC?
[12:16:52] <cart_man> Microchip 24AA64
[12:16:58] <cart_man> DKordic`, ^^
[12:20:44] <cart_man> DKordic`, I believe the IC DevID is 10100000 so in the code it must be right
[12:33:01] <RikusW> hi cart_man
[12:33:41] <cart_man> RikusW, Hi Rikus just wanted to Personal chat with you to say hi
[12:34:01] <RikusW> long time no see
[12:34:05] <cart_man> Havent seen you around for a while
[12:34:17] * RikusW has been somewhat busy
[12:34:26] <cart_man> Yea my system does not start IRC anymore so I forget to log in : /
[12:34:33] <cart_man> well thats good
[12:34:35] <RikusW> I'm back on the farm now
[12:34:46] <cart_man> where is the farm located?
[12:35:03] <RikusW> Near Warden, NE Freestate
[12:35:54] <RikusW> We have load shedding 12:00 to 14:00 here.... no electricy for 2 hours :/
[12:36:07] <cart_man> Ohh ok. You where close to hatfield before right?
[12:36:19] <RikusW> Sinoville
[12:36:25] <RikusW> only for 3 months
[12:36:53] <RikusW> that was more than a year ago..
[12:37:16] <cart_man> shit that long? Ohh whow! ...
[12:37:50] <RikusW> I moved here 11/2013
[12:38:02] <RikusW> so it is that long indeed
[12:38:15] <RikusW> time flies...
[12:38:15] <cart_man> Allot happened in the last year dam! Anyway im back to I2C again and I ran into some problems that I can't find apparently ... EPPROMs usually want to talk but not this one : /
[12:38:27] <cart_man> So that was the last time I spoke to you
[12:38:40] <RikusW> about
[12:38:55] <RikusW> get the particular eeprom's datasheet ?
[12:39:12] <RikusW> some do have address pins on them, check those maybe ?
[12:39:26] * RikusW haven't used i2c yet.. only read a bit about it
[12:39:41] <cart_man> Yea I did.. Its the 24AA64 Microchip ... The data pins are grounded for 000 soo
[12:39:57] <RikusW> broken chip ?
[12:40:14] <cart_man> Yea it works ok if it works...but I always have trouble setting it up though and its like the 3rd time
[12:40:29] <cart_man> always something new.... people at work dont like it though.
[12:40:52] <cart_man> Maybe... Im thinking that my TWI module in the AVR got some static
[12:41:09] <DKordic`> cart_man: I would limit SCL to for example 1KHz during debugging.
[12:41:42] <cart_man> How do I limit it though ? with TWBR register?
[12:41:52] <DKordic`> Yes.
[12:42:14] <cart_man> Because my Atmega is running at 8Mhz internal ... So I have my TWBR at 32
[12:42:20] <cart_man> believe that will be 100Khz
[12:42:31] <cart_man> Didnt actually know I can divide it even more
[12:42:45] <ferdna> if my sensor gives me <200ma do i need to step that to 5v for my analog pin to read that?
[12:43:05] <cart_man> Thing is... my EEPROM needs 100KHZ ... is there a mimum for I2C or EEPROM SCL?
[12:43:09] <Lambda_Aurigae> ferdna, all depends on what your reference voltage is.
[12:44:10] <ferdna> Lambda_Aurigae, yes it is 5v.
[12:44:27] <RikusW> Its always a good idea to lower the clock for debugging
[12:44:36] <DKordic`> cart_man: I2C is asynchronous, so no lower limit. What do You mean "need 100KHZ"?
[12:44:51] <Lambda_Aurigae> ferdna, then it's gonna be a minimal change on the ADC if your reference is that much higher than the voltage you are reading.
[12:45:33] <cart_man> DKordic`, No I was under the impression that SCL has a minimum ...but I understand now !
[12:45:36] <cart_man> ok thats awesome
[12:45:51] <Lambda_Aurigae> cart_man, I've done TWI/I2C at like 10Hz
[12:46:23] <Lambda_Aurigae> with LEDs on the lines so I could watch the blinky lights.
[12:46:35] <ferdna> Lambda_Aurigae, cool thanks.
[12:46:36] <cart_man> Im thinking of taking it down allot mire and just spilling the TWSR registers content on a seriel so I can see if theres any errors
[12:47:13] <Lambda_Aurigae> ferdna, look at your minimum voltage levels on the datasheet...but you might set your reference voltage to like 0.5V if it will work.
[12:47:27] <cart_man> Lambda_Aurigae,Could you actually make anything of the blinking light though? 10Khz seems a bit fast still
[12:47:39] <Lambda_Aurigae> not 10KHz
[12:47:41] <cart_man> Ohhh 10Hz
[12:47:41] <Lambda_Aurigae> 10Hz
[12:47:42] <cart_man> lol
[12:48:03] <cart_man> yea ...sorry I havent slept much... the I2C has kept me awake all night
[12:48:38] <Lambda_Aurigae> haven't done i2c manually yet but I have done SPI manually with debounced switches.
[12:48:41] <Lambda_Aurigae> and LEDs
[12:49:16] <Lambda_Aurigae> also programmed an atmega8 once with debounced switches and LEDs.
[12:50:11] <Lambda_Aurigae> thinking of doing an HVPP/HVSP manual programmer for the fun of it.
[12:51:59] <RikusW> Lambda_Aurigae: like bootloading the old computers using switches ?..
[12:52:04] <Lambda_Aurigae> yup.
[12:52:09] <Lambda_Aurigae> it's fun!
[12:52:25] <RikusW> how many bytes did you put into the mega8 ?>
[12:52:49] <Lambda_Aurigae> used to bootload an old TI-980B processor once or twice a week that way...unstable as hell with the old core memory we had on it.
[12:53:18] <Lambda_Aurigae> I changed one fuse and loaded 8 bytes into flash...it was mostly a learning experience.
[12:53:45] <RikusW> I'm sure glad I don't have to bootload using switches...
[12:53:53] <Lambda_Aurigae> hehe.
[12:54:10] <RikusW> Imagine connecting an avr to one of those old computers to bootload it :-P
[12:54:30] <RikusW> the avr will have more computing power than the computer.
[12:54:30] <Lambda_Aurigae> the avr would be more powerful than the whole computer.
[12:55:23] <Lambda_Aurigae> a C-64 was more powerful than the TI-980b
[12:55:27] <cart_man> DKordic`, can I use any value for TWBR? Say TWBR at 32 and my WTPS at something like 6
[12:55:34] <cart_man> that would give me a SCL of 30.5
[12:55:36] <cart_man> Hz
[12:56:34] <Lambda_Aurigae> http://homepage.hispeed.ch/peterfleury/avr-software.html
[12:56:38] <Lambda_Aurigae> there cart_man
[12:56:43] <Lambda_Aurigae> i2c master interface..
[12:56:50] <Lambda_Aurigae> although, what chip are you using for your i2c master?
[12:58:39] <DKordic`> Lambda_Aurigae: "Atmega328".
[12:58:56] <Lambda_Aurigae> DKordic`, time to read ye olde datasheet.
[12:59:17] <cart_man> Lambda_Aurigae, :(
[12:59:24] <DKordic`> Lambda_Aurigae: I don't understand.
[12:59:37] <cart_man> Yea im using a Atmega328 and 24AA64 EEPROM from Microchip
[12:59:39] <Lambda_Aurigae> DKordic`, that question was for cart_man actually.
[12:59:43] <Lambda_Aurigae> ok.
[12:59:49] <Lambda_Aurigae> so that software should work for you cart_man
[13:00:12] <Lambda_Aurigae> might have some warnings with a newer version of gcc though..that software is old but it's worked for me for years.
[13:01:02] <cart_man> Lambda_Aurigae, Yea but I think sleep is in order first... the is I tried that earlier but Im soo depleted of trying 2 days straight...
[13:01:28] <cart_man> think is my code is suppose to be working... The error is probably staring me right in the face
[13:01:45] <Lambda_Aurigae> I use that software for talking to pcf8574 chips.
[13:01:52] <Lambda_Aurigae> should work for your eeprom.
[13:04:25] <cart_man> Lambda_Aurigae, Yea I thought the setup was a bit harsh just now though... Meh I just need to take a break
[13:04:29] <Lambda_Aurigae> ferdna, for your ADC issue,,,minimum reference voltage is 1.0V....you should have an internal reference of 1.1V you can use though.
[13:04:49] <ferdna> i was reading just that
[13:05:01] <ferdna> what are my options?
[13:05:12] <Lambda_Aurigae> 1.0 external or 1.1 internal reference.
[13:05:32] <cart_man> Lambda_Aurigae, DOes the Atmega's VRef only go down to 1V?
[13:05:46] <Lambda_Aurigae> you are looking at 0.2V out of 1.1V
[13:05:57] <Lambda_Aurigae> cart_man, on the atmega328 series it does.
[13:06:48] <cart_man> So then your resolution is limited to 4V if you have a 5V as reference?
[13:06:55] <Lambda_Aurigae> no.
[13:06:57] <cart_man> other words 0 on the ADC will = 1V?
[13:07:01] <Lambda_Aurigae> 5V with a 5V reference.
[13:07:06] <Lambda_Aurigae> 1V with a 1V reference.
[13:07:16] <cart_man> Ohh righ right
[13:07:17] <cart_man> ok my bad
[13:07:22] <Lambda_Aurigae> ferdna is trying to read something under .2V
[13:07:58] <Lambda_Aurigae> ferdna, you might be better off running it through an amplifier.
[13:08:07] <Lambda_Aurigae> but you CAN read it like it is.
[13:08:14] <ferdna> is that the better choice?
[13:08:15] <Lambda_Aurigae> gonna be noisy as hell though I bet.
[13:08:30] <Lambda_Aurigae> if you want better resolution then I would go with the amp method.
[13:08:58] <ferdna> coool thnanks
[14:00:32] <smurfa> Hi. In order to program AVR MCUs, do I get an Atmel-ICE?
[14:00:48] <smurfa> the 32-bit MCUs seems quite expensive. Is it just my retailer?
[14:01:22] <vsync> what's the application?
[14:01:51] <RikusW> 8 bit is easier to use
[14:02:06] <vsync> highly doubt you'll need the 32s
[14:02:11] <smurfa> programming the chips (and programming/reading eeprom despite manufacturer would be cool)
[14:02:17] <smurfa> what are the 32s for?
[14:02:23] <vsync> for nothing
[14:02:26] <smurfa> 8bit can simulate 32, so
[14:02:43] <smurfa> not really doing any high-performance-super-stuff atm
[14:02:54] <cart_man> smurfa, Are you starting out now?
[14:02:58] <cart_man> Ohhright
[14:03:20] <vsync> then get the tiny or mega series
[14:03:32] <vsync> and the avrisp mk II, about $40 on digikey iirc
[14:03:57] <vsync> or, if you plan to stick, get the atmel ice which can do the arms aswell
[14:03:59] <smurfa> Starting out now. But I don't deal with too easy stuff, such as audrino and boards for babies and what not. Getting to the bare metal directly
[14:04:21] <smurfa> avrisp mk II getting obsolete?
[14:04:26] <vsync> no
[14:04:30] <smurfa> for about the same price I can get an Atmel-ICE?
[14:04:38] <vsync> if you get the barebones version
[14:04:40] <vsync> without the case
[14:04:49] <vsync> i think they don't include cables either
[14:05:10] <vsync> http://www.digikey.com/product-detail/en/ATATMEL-ICE-PCBA/ATATMEL-ICE-PCBA-ND/4753383
[14:05:16] <smurfa> if I add 20$ I can get an Atmel-ICE instead with jtag support
[14:05:36] <vsync> if you can get it with $60 go for it
[14:06:10] <vsync> the ice can do swd and jtag, and act as a debugger
[14:06:22] <vsync> i don't think the avrisp mk2 does any of that
[14:06:52] <smurfa> that's what I've understood. Potentially it programs a bit faster, but not that that'd matter.
[14:07:04] <smurfa> but it can also read/write eeprom it seems, which is a plus
[14:07:56] <RikusW> vsync: you should have a look at the Atmel-ICE
[14:08:09] <vsync> RikusW: what
[14:08:23] <smurfa> Do you know whether it has the same linux support as the mk II? What do you guys use (for linux, if)?
[14:08:26] * RikusW still reading scrollback...
[14:08:30] <vsync> i mean, on top of isp tpi and pdi
[14:08:38] <vsync> it can do swd and jtag, also debugging
[14:08:46] <vsync> it's all you need, really
[14:08:55] <RikusW> I'm not sure about linux support on the new ICE....
[14:09:10] <vsync> RikusW: it's not me who was asking about programmers
[14:09:39] <vsync> the ice is just a tad expensive, but then again you don't need another programmer
[14:10:27] <RikusW> vsync: I answered before finishing reading scrollback...
[14:10:34] <vsync> happens
[14:28:23] <Lambda_Aurigae> smurfa, for 8bit avr I use either an stk200 clone or the usbtiny I bought from Tom_itx...both on linux
[14:29:35] <Lambda_Aurigae> the stk200 clone is well over 10 years old and still works fine.
[22:02:23] <wulax> I am trying to connect an AVR Butterfly board to a PC with an usb->uart cable (chinese copy of Nokia CA-42 I think), but keep getting a lot of errors. The AVR is supposed recieve a byte from PC, then echo it back http://codepad.org/4hoHdAYe. The waveform looks kind of strange however https://i.imgur.com/iChK0jT.png The yellow wave is transmit from PC, blue is sent from AVR.
[22:02:34] <wulax> Lowering baud rate doesn't seem to help
[22:03:43] <wulax> Could it be a bad cable?