6
votes
1answer
146 views

AVR timer speedup on ATmega328

When running at clock prescaler of 64 on ATmega328, one of my timers speeds up for unknown reasons at a particular time in the execution. I am using two timers on ATmega328 to generate the clocking ...
4
votes
4answers
170 views

ATtiny2313 refuses to be programmed after setting CPU clock to 500kHz

The other day I was writing a program for an ATtiny2313. Once it worked I decided to test it at the various clock speeds that are available and programmed through setting the LFUSE as described on ...
2
votes
1answer
409 views

Best way to communicate Raspberry Pi and ATTiny13

What is best way to connect two or three microcontrollers, ATTiny13 to Raspberry-Pi and get master (Raspberry Pi) communication? Are there any ready libraries for ATTiny13 for SPI or I2C? Maybe some ...
2
votes
1answer
180 views

ATMega168 SPI tranmission will not start

Scenario I have an ATMega168 using an external 10MHz crystal. The DIV/8 fuse bit is not set. The processor takes the outputs from 4 quadrature rotary encoders. Their rotation direction information is ...
8
votes
0answers
385 views

How can V-USB screw up the built-in SPI of an ATmega328p?

I'm working on a V-USB project that shows up as a Keyboard using an ATmega328p. The USB part is working great (it's not my first V-USB project), but after I start the V-USB stack with ...
0
votes
1answer
531 views

Arduino SPI Clock Speed Configuration

I am trying to communicate with a Nokia 1202 LCD with my Arduino using SPI. The LCD using the STE2007 Controller. As per the datasheet here @ page 12, you find that the min time for SCLK is 250ns => ...
3
votes
2answers
1k views

Making two Arduinos talk over SPI

I'm trying unsuccessfully to make two Arduinos talk using SPI. I found this great tutorial. The SPI Master send a constant string each second to the SPI Slave, which resends to the USART for ...
0
votes
1answer
81 views

Keep SPI/TWI master active?

I'm designing a data recorder application which uses an 8-bit AVR microcontroller. It uses the TWI and SPI interfaces with the microcontroller being the master. There is one SPI device, a microSD ...
1
vote
2answers
349 views

Communication between two AVR microcontrollers over SPI with different power supplies

I have two ATMEGA32 microcontrollers. First one has the following power supply: 220VAC-line filter-transformer-bridge rectifier-filter-voltage regulator-5VDC. Another one is powered by USB 5VDC. So ...
4
votes
1answer
310 views

Re-programming an AVR from another MCU over SPI?

Many AVRs have the capability to be ISP'd - or in system programmed over SPI. I have a project where the entire device can get firmware updates, and I'd like to also update the firmware on it's front ...
1
vote
1answer
630 views

Strange bug when Interfacing with Shift Register (CPLD) via SPI

I've implemented a 8-bit Parallel in Serial Out (PISO) Shift register in VHDL on my Max V CPLD. I'm using SPI to interface with the CPLD using my AVR. The circuit works but only partially. Suppose I ...
1
vote
2answers
2k views

SPI on ATtiny13

My understanding of the ATtiny13 datasheet is that although you can ISP the micro via "SPI" it actually doesn't have the functionality to operate on an SPI bus with other devices (at least not in ...
3
votes
2answers
926 views

How to use ATmega328 SPI with a 31 bit shift register

I'm using an Allegro 6280 PWM LED driver for a project. This is a cool little IC except for the fact that it is a 31 bit long input register. This is no problem if I simply loop through my 31 bits ...
1
vote
1answer
293 views

problems while trying to communicate between ATMEL mega169 and ATMEL flash

Hello everyone I'm writing a C program that will access a flash AT45DB041B from the controller ATmega169. I'm using a Butterfly development kit. I have succeeded to read the status register ...
20
votes
10answers
4k views

SPI or I2C… which to use for a longish bus

I'm contemplating a project that would require several AVRs talking to each other over a bus. They'd be separated by as much as 6 feet. It seems like both I2C and SPI can let a series of micros ...