Switching from MEGA to NANO - code doesn't work anymore

I've prototyped a project involving reading a chain of sensor modules with an Arduino MEGA (atmega1280). I use 3 digital pins for a standard serial communication protocol (CS - Chip Select, CLK - Clock, DIO - Read only data stream).

Now i want to switch the Mega for an Arduino Nano, to make everything more compact for the final installation. Yet, when loading the exact same code onto the Nano, the serial communication doesn't work anymore. All the outgoing signals (CLK, CS) look perfectly fine on the oscilloscope. There is no obvious change between the serial-communication signals of the Mega and Nano. Yet for some reason the sensor module (AS5030 Magnetic Sensor IC Adapter Board) doesn't respond the way it should: The incoming sensor values are changing yet not in a way they should, and the sensor does not activate it's DX output anymore (in order to read the other sensors in the daisy-chain setup). Obviously the communication between the Nano and the sensor board doesn't work anymore, even though the signals from the Nano appear to be correct.

My question is - what are the differences between the Arduino Mega and Arduino Nano that could cause this error? Digital Pin Behavior? Storage of Values? Clock Behavior? Boot Loader? etc. ... Both Microcontrollers run on 16MHz. I've tried different clock frequencies for the serial communication, yet without positive results. I've used the latest Arduino IDE, so the drivers/bootloaders for the chips should be up to date.

Anyone had similar problems before, when switching between microcontrollers? Any tips would be much appreciated!

Eva

I use [u]3 digital pins[/u] for a standard serial communication protocol ...

Which digital pins?

Don

int CLKpin = 8; // clock int CSpin = 3; // chip select int DIOpin = 9; // data

I use 3 digital pins for a standard serial communication protocol (CS - Chip Select, CLK - Clock, DIO - Read only data stream).

int CLKpin = 8; // clock int CSpin = 3; // chip select int DIOpin = 9; // data

That is not very clear. Those are not pins used for standard serial communications on a mega or a nano. There is also no clock used for 'standard' serial communications. I think you must be using some other kind of comm method?

http://arduino.cc/en/Reference/Serial

You may have to post your code for use to figure out what you are using and what changes are required to port it to a nano.

ah, sorry, i probably should have said 'Software Serial Protocol' i am doing something like that: http://www.arduino.cc/en/Tutorial/SoftwareSerial

i turn CS (Chip Select) on, and then do my own clock signal while reading in the incoming bits. then CS goes off.

Have you tried the newsoftserial?

http://arduiniana.org/libraries/newsoftserial/

The reference you provided may be too old. It was referring to arduino IDE 0007. It's 0022 now.

Had a look at the SoftwareSerial Library (2 pins: receivePin, transmitPin), but it won't work in my case, as i am doing a 3-wire serial communication with the sensors (CS, CLK, DIO).

The sensor only sends data when i tell it to (therefore the CS 'chip select' pin), and not all the time.

Tried the whole thing now with an Arduino Duemilanove (atmega328) and it also works.

Still wondering, why it doesn't work with the Nano ...