Community
cancel
Showing results for 
Search instead for 
Did you mean: 
SRasa
Valued Contributor I
2,426 Views

Programming the quark mcu from arduino IDE (for external interrupts)

So is there a data sheet for the Quark MCU inside the edison? Can we program it from the Arduino IDE (especially for external interrupts)? Are there sample codes for the quark from Arduino IDE? Also another angle from which I am thinking is, if we can capture data on the Quarks ADC and share the same data with the Atom then we can process it at high speeds. Data some from quark but computation is not limited to quark and we can use the full power of atom.

11 Replies
Diego_V_Intel
Employee
69 Views

Hello Sriranjan,

The only way to program the Quark MCU is through the MCU SDK which is available here: https://software.intel.com/en-us/iot/hardware/edison/downloads IoT - Intel® Edison Board Download | Intel® Developer Zone. On the other hand, the documentation available for the MCU can be found here: https://software.intel.com/en-us/creating-applications-with-mcu-sdk-for-intel-edison-board Creating applications with the MCU SDK for the Intel® Edison board | Intel® Developer Zone. You will also find some sample scripts for the MCU SDK.

Currently the MCU supports GPIO, UART and I2C features. The ADC feature is not supported yet so there is no way to read the ADC using the MCU.

Regards,

Diego.

SRasa
Valued Contributor I
69 Views

Not supported meaning? I think there should be sample c code or assembly code to program the controller.I can work on it and add the code to the SDK.Please let me know more about the Quark programming. For example if I buy a chip from atmel say atmega8 it s datasheet has sample code to handle the peripherals and I think quark should also have a proper datasheet and example code either in C or Assembly to handle its peripherals.I was expecting that intel would do a finished job when releasing the board.

SRasa
Valued Contributor I
69 Views

I found this in the MCU API:

"Register an interrupt handler for one GPIO port.

int gpio_register_interrupt(int gpio, int mode, irq_handler_t isr);"

So can I use the above code in my IDE (i.e can I use MCU specific code in the arduino IDE.) I hoping the data variables are shared between the MCU and Atom processor. That is when I get to use the real power of Edison.

SRasa
Valued Contributor I
69 Views

I want access to the bare metal code for the Quark MCU.I want to do fast SPI transfers and handle interrupts better. Also I want to write the bare metal code in Arduino IDE. Will this be possible?

Diego_V_Intel
Employee
69 Views

Hello Sriranjan,

As I explained before, the MCU supports GPIO, UART and I2C features. Hopefully the SPI feature will be supported in future releases. The MCU can only be programmed through the MCU SDK. All the information available for the MCU is in the link I posted above. The MCU API used in the MCU SDK can't be used in the Arduino IDE.

Regards,

Diego.

SRasa
Valued Contributor I
69 Views

But right now how is the SPI happening. Is the SPI from the Atom processor?

Diego_V_Intel
Employee
69 Views

That's correct. Currently the SPI is controlled by the Atom processor.

Regards,

Diego.

SRasa
Valued Contributor I
69 Views

So now I want add some code at the SPI transfer level which would turn the Chip select appropriately as I need. So how do I get access to SPI code. Is it there in the poky linux SDK?, that I can modify and compile? SPI transfer also does not tell if it is SPI transmit or receive.I need to read and write using the SPI. Please advice.

Diego_V_Intel
Employee
69 Views

That SDK is for develop native applications. Basically you will set the same environment (Yocto) that runs on Edison in your PC so you could write code and develop applications like if you were doing them directly in the Edison module, but using the resources of the PC. I recommend you to check the following guide to get more details: http://www.intel.com/support/edison/sb/CS-035382.htm Intel® Edison Boards — Native Applications Guide.

You could use the Arduino IDE to set the SPI. Alternatively you could use Python or C++ by using the MRAA library. You can find examples in the Arduino IDE. Also you can find more examples using MRAA in the following sites:

I guess you are talking about the SPI.transfer() method used in the Arduino IDE. In the SPI protocol there are not transmissions or receptions. There are only transfers. That's why the SPI.transfer() method doesn't make any difference between transmission or reception. In each transfer there are data sent and received. If the device only wants to send data, it will ignore the data received. If the device only wants to receive data, it will send dummy data because it is not important for that particular transfer. So, if you want to transmit data using SPI.transfer() you should use a syntax like this:

  • SPI.transfer(0x33);

This way you will transmit the byte 0x33. In case you want to read data using SPI.tranfer() you should use a syntax like this:

  • byte data = SPI.transfer(0xFF);

The byte 0xFF is a dummy data. Depending on the application and the SPI device you will need the send some other value. The important thing here is that you will receive data in that transfer so you can store it in a variable. That is the way to read using the SPI.transfer() method.

I noticed that you already have an open thread about the SPI so please keep the support about that topic there to avoid mixing the questions:

Regards,

Diego.

MRebi
Beginner
69 Views

Hi Diego,

I came to that post because we are currently trying to use the Quark MCU through the EDISON board. Key things we need to have access to are:

- SPI

- DAC

Aflter going through the various posts it seems that the Quark MCU offers those possibilities but that we cannot currently access them through the EDISON board.

So my questions are:

- is there any updates available for the Intel EDISON regarding SPI and DAC since August 2015?

- if no do you plan to provide soon any updates regarding SPI and DAC, and when?

We really need to know that if possible before engaging efforts using the Intel EDISON. Otherwise we would have to migrate to another platform like the BBB.

Thanks in advance for your reply.

Marc Rébillat

Diego_V_Intel
Employee
69 Views

Hi rebillat,

So far, there aren't updates about the SPI and the ADC, so they are not supported yet. Unfortunately, there isn't an ETA on when this features will be supported by the MCU.

Regards,

Diego

Reply