Trying to get Atmega4808 to work correctly with RF receiver module

I have a bunch of Atmega4808 chips that I was hoping to use for a project. This project incorporates a 433Mhz RF receiver module that is supposed to read remote codes. I can get everything working great with 328p chips, and 2560 chips. Every library I have found works with those. They don't work with the 4808 chips though. My first thought was that I could look through the code and see why the libraries don't work, but the two most common libraries, the RC-Switch library, and the Radiohead library both have different issues, and both are so complicated that my limited experience with C++ is hindering my progress. Radiohead won't compile, claiming issues with private variables in the SPI library, if I remember correctly. RC-Switch says it is incompatible. It compiles and uploads, but the code apparently freezes. So, I went looking for something else.

I found this library while looking for examples on how to read the data from these receivers, and it seems to work fine on everything despite it not having any updates to the code in about 10 years. It still doesn't work on the 4808 though. It is simple enough that I can understand it though, and I see nothing outside the capabilities of the 4808 that should be giving it problems.

Because of this, I decided that before I started asking questions, I would verify that I am getting what I should be getting at the pin on the 4808. I hooked up my oscilloscope, and first found that it was only putting out a signal of like 1.5 mV. I forgot that we are working with 3.3V with the 4808, and these boards want 5V, so I fed it 5 volts and the signal came out at 3.7V, which is within specs. I see nice clean lines with very little ringing, so I tested it again to see if it could detect the remote signal, and it doesn't.

At this point, I decided I needed to test the ability of the 4808 to recognize interrupts, so I wrote a small program to test, and it does. After that, I wanted to make sure that it saw the highs and lows from the RF module, and so I just had it send the output to the console every time through the loop, and I was seeing a field of zeros, interrupted by the occasional 1, but overall what I expected without sending a signal. Once I sent the signal from the transmitter, it showed tons of 1s in the output, telling me that it is seeing the difference.

Right now, I'm at a loss to determine what might be going wrong. I'll post my code, which is slightly modified from the example to give me some signals, but I'm pretty sure it's not my code, since the same code works on all my other devices.

#include <RemoteReceiver.h>

void setup() {
  // put your setup code here, to run once:  
  Serial.begin(9600);
  Serial.println("Hello");
  
  // start the remote receiver using interrupt 0 (pin 2)  -- interrupt 8 pin 8 (PIN_PC0) on 4808
  RemoteReceiver::start(digitalPinToInterrupt(PIN_PC0));
  pinMode(PIN_PF4, OUTPUT);
  digitalWrite(PIN_PF4, HIGH);
}

void loop() {
  if(RemoteReceiver::dataReady()){
    digitalWrite(PIN_PF4, LOW);
    Serial.print("Read: ");
    Serial.println(RemoteReceiver::getData());
  } else {
    digitalWrite(PIN_PF4, HIGH);
  }
}

If anyone has any more suggestions, I would appreciate it.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.