Go Down

Topic: Arduino IDE 1.5.3 doesn't work like 1.5.2 (Read 445 times) previous topic - next topic

goan

Hi guys, I'm having some troubles compiling with new IDE 1.5.3. The same code below, compiled with 1.5.2 works, but when I compile with 1.5.3 it doesn't work. It stops on first iteration receiving no byte from SPI. Do you have any idea?

Code: [Select]


#include <SPI.h>
void setup() {
  // put your setup code here, to run once:
Serial.begin(115200); // Start Serial Communication
Serial.println("Ready");
        pinMode(9,OUTPUT);
        digitalWrite(9,HIGH); // Conversion pin high
        pinMode(6,OUTPUT);
        digitalWrite(6,LOW);                                                                   // Power up
SPI.begin(10); // Start SPI Communication on CS pin 10
SPI.setBitOrder(10,MSBFIRST); // Set Bit Order MSB
SPI.setClockDivider(10,255); // Set Oscillator to SPI Clock divider
SPI.setDataMode(10,SPI_MODE0);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(9,LOW); // Start ADC conversion
        delayMicroseconds(50);
digitalWrite(9,HIGH); // Stop ADC conversion
 
byte response1 = SPI.transfer(10,0x00, SPI_CONTINUE); // Receive  first byte (1/2 16 bit)
byte response2 = SPI.transfer(10,0x00); // Receive second byte (2/2 16 bit)
   
short int value = (((uint32_t) response1) << 8 | response2); // Merge bytes
Serial.println(value);
  delay(100);
}



goan

I installed 1.5.3 five days ago but now I see a new version has been released, may be with 1.5.4 will work.. Thanx anyway

cmaglie

@goan

can you give us some updates?
are you still having issues?

C.

goan

Hi cmaglie, sorry but I've no updates. I'm working on my thesis and I can't loose my head rigth now trying different combinations of arduinoIDE and visualmicro and debugging results. I've gone back to arduinoIDE 1.5.2 and visualmicro 1308.04 that worked pretty fine.
I don't know why, but 1.5.3 is unable to have a SPI connection when specifying SS pin. If I ground CS on the ADC and I use SPI without SS pin it works. Now since I have two SPI devices and I need to manage them, I've gone back to a working configuration ..

goan

A small clarification:
..of course the problem it's not visualmicro. Once i found the problem, I extracted the code portion above and compiled directly into ArduinoIDE..

cmaglie

@goan,

thanks
I've fixed a bug in SPI library (in 1.5.3 EDIT:and released in 1.5.4) so I just wanted to know if that fixed your issue.

BTW, no problem, and good luck for your thesis! ;)
C.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy