Pages: [1]   Go Down
Author Topic: Arduino IDE 1.5.3 doesn't work like 1.5.2  (Read 370 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

#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);
}

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Forum Administrator
Milano, Italy
Offline Offline
Sr. Member
*****
Karma: 23
Posts: 292
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@goan

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

Logged

C.

Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ..
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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..
Logged

Forum Administrator
Milano, Italy
Offline Offline
Sr. Member
*****
Karma: 23
Posts: 292
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@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! smiley-wink
Logged

C.

Pages: [1]   Go Up
Jump to: