Can't go Nunchuck until the NRF and ATTINY play nice.
Our current NRF and Arduino Nano-based remote works well, but is big and clunky.
Before we can make a nice one inside a wiimote, we'll need to get the smaller and lower power ATTINY85 (or the larger ATTINY84 with more IO pins) working.
ATTINY / NRF is not working for us. We're trying everything we found online, including...
- Using the same NRF libraries and code that work for others
- Everything wired up correctly
- Using nice wires with good terminals, no jumper wires, no shorts or opens.
- Good power supply to both the Tiny and NRF
- Using plenty of power caps, 100uF, 10uF .1 uF. Not seeing any power droop, see good signal transistions.
- Attend is supposed to be running at 8mHz
How do you know the Attiny's 8 mHz clock is working?
Run a simple blink sketch with a 1000ms delay using "Tools->Clock->8mHz" If the LED blinks every second, then the Tiny Clock is working at 8Mhz. If on the other hand, the LED blinks for 8 second and off for 8 seconds, then it is still running at 1mHz.
void loop() {
// put your main code here, to run repeatedly:
delay(1000);
digitalWrite(3,HIGH);
delay(1000);
digitalWrite(3,LOW);
}
To fix this...Burn Bootloader?
From Arduino IDE simply selecting "Tools->Clock->8mHz" tells the chip what the clock frequency is supposed to be so that things like timers still work. For example calling delay(1000) actually takes 1 second. But selecting 8mHz from the menu doesn't actually change the clock frequency! Turns out that to actually change the ATTINY clock frequency you have to use an Arduino as an ISP and select: "Tools->Burn Bootloader". This sets the ATTINY fuses to actually speed up the clock. Running the above blink program should yield 1-second blinks.
Confirmed @8Mhz...but still not working.
We're seeing a difference on the SPI Logic Analyzer between the Attiny and Arduino implementation. The numbers being passed are completely different and the SCK frequency is 4x slower with the ATTINY. The SPI protocol has the "master" control the SCK so that shouldn't be a problem...interesting though.
The following logic analyzer output (top row digital and again on the bottom row in analog) is showing a 1 mHz SCK frequency for the ATTINY and NRF combination.
Serial Print on ATTINY
We're not taking advantage of this...mainly because all the pins are taken up by the NRF. Not sure, but maybe we can get software Serial.Print working on the ATTINY84 (which has many more IO pins)
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.