Atmega8 Software I2c

2020. 3. 3. 12:50카테고리 없음

Yes, John it is derived from AVR302. It says 'Beginner Utilities' and I would assume that it is bit-banging. But why do people remove indentation??I have a basic problem with requests for ASM. Either they are from people who think that ASM is easy or from people who just like ASM. IMHO the first category is never going to get past Blinky.

Atmega8 Software I2c

The second category can surely read an algorithm from C or any other language, or even from a civilised processor like 68xx.Writing a design in pseudo-code, and then translating the steps into the target language is the same for everyone. This applies to ASM as much as any HLL.David. Quote: I have a basic problem with requests for ASM. Either they are from people who think that ASM is easy or from people who just like ASM. IMHO the first category is never going to get past Blinky.

Atmega8 Software I2c Code

The second category can surely read an algorithm from C or any other language, or even from a civilised processor like 68xx.This seem to be both unfair and untrue IMHO.Why not just skip ASM threads to avoid having that basic problem?Or do you suggest that no ASM threads should be allowed in this forum? Quote: This seem to be both unfair and untrue IMHO.Why not just skip ASM threads to avoid having that basic problem?Or do you suggest that no ASM threads should be allowed in this forum?No. I like ASM code, and get great satisfaction from writing a piece of elegant code. I have written large programs in ASM ( although not AVR ).My point was really that the absence of many language rules makes it appear to be easy to learn. However with a largish program, you have to invent your own rules.

And more skill is involved with sticking to your own self-imposed rules.To Lennart:The AVR302 code is universal but obviously does not use the TWI module.The AVR311 code is in C but should translate easily into ASM.Once you see the algorithm, the coding part is pretty straightforward.David. Quote: or from people who just like ASM.or from people that cannot think in C or cannot come to grips with C.Surely you would not think that just because something is written in asm one cannot ask if someone else has done it before just like people that use C do.:)If I had used any AVRs in TWI slave mode I would have the code to share, but I haven't.I have used the bit banged TWI master code with the T2313 as I did't want to learn and use the USI, AVR300 just worked pretty much as it was.just like a C library. Quote: So any 'one liners' you think may help me on my quest would be appreciated!Not exactly a one-liner but the specs from Philips that own the rights to I2C-bus might lead to some insight.The only code I have for hardware TWI is for a Slave Receiver.As usual it's twisted and bent to suit my purposes of that app. So it's not really a good tutorial.If you have a scope that REALLY would help.Much easier to figure out what's going on if you're able to look at SCL and SDA lines.If you don't have one maybe this is interesting.Oh, and you do need external resistors on SCL and SDA lines.

Anything between 3k and 10k should work.You can not have slave and Master separated by a long cable. Somewhere around 0.5 meters is the limit for a slow speed like 100kbps. At higher speeds cable need to be even shorter.

There are devices though that can help extend the length of wire to appx 50 meters. Declanwilliams wrote: But I have a project I want to attempt, that uses I2C,Can we find out a bit more about the project? Why does your end need to be a TWI slave? Do you know and understand what the master's protocol is?The fact that it uses TWI is only half, or a lot less, of the story.I wish interface a device to the expansion port at the base of the Nintendo Wii remote.I know that i will have to do alot of research myself, but i figured, understanding the I2C protocol would be a good place to start.