Go Down

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


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
        digitalWrite(9,HIGH); // Conversion pin high
        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

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(9,LOW); // Start ADC conversion
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


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



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



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


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



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! ;)

Go Up