14 Commits

Author SHA1 Message Date
3ea528dc5f ndentation test 2020-10-13 20:45:35 +02:00
05bc5e474c tab indentation 2020-10-13 20:45:04 +02:00
162cb8d90d some more info 2020-10-13 20:44:05 +02:00
80cc6b6098 first time setup update 2020-10-13 20:41:53 +02:00
976c15c9b6 added informative comments 2020-10-13 15:48:13 +02:00
651ae6ed44 line breaks added 2020-10-13 13:45:11 +02:00
3af98f2025 readme update 2020-10-13 13:43:47 +02:00
b9f8798538 readme update 2020-10-13 13:42:17 +02:00
2bc352afb3 main tweaks 2020-10-13 13:32:54 +02:00
de9bb974c4 clarifications 2020-10-13 13:30:32 +02:00
a343c9728b trying nested indentation 2020-10-13 13:29:31 +02:00
0571eb9c89 instructions to set up libraries 2020-10-13 13:28:14 +02:00
4176037c2c pci fix 2020-10-13 13:22:33 +02:00
8442bf45f3 test 2020-10-13 13:18:16 +02:00
6 changed files with 35 additions and 13 deletions

1
.gitignore vendored
View File

@ -104,3 +104,4 @@ local.properties
.scala_dependencies
.worksheet
/Release/
/sloeber.ino.cpp

View File

@ -2,6 +2,7 @@
#define ARDUINOCONFIG_H_
static const uint8_t COMMAND_TRANSFER_SPI = 1;
static const uint8_t COMMAND_TRANSFER_I2C = 2;
// Can be set to one for additional programming information from the primary
// serial port which is usually also used to flash the Arduino
@ -9,7 +10,7 @@ static const uint8_t COMMAND_TRANSFER_SPI = 1;
// serial communication logic
#define PROGRAMMING_OUTPUT 1
#define BAUD_RATE 115200
#define BAUD_RATE 9600
#define SERIAL_RX_BUFFER_SIZE 256
#define RING_BUFFER_SIZE 100
#define MAX_PACKET_LENGTH 100

View File

@ -126,6 +126,7 @@ void transferSPI(uint8_t address, uint8_t *data, size_t datalen) {
// requires the slave select to be driven low.
CS_PORT = ~address;
SPI.transfer(data, datalen);
// some MGM stuff. This delay might not be needed for other devices.
delay(100);
// Pull the slave select high again.
CS_PORT = 0xff;

View File

@ -48,18 +48,41 @@ make clean -j
2. Install the Eclipse Sloeber plugin by going to Help → Eclipse Marketplace and searching for Sloeber V4 and installing it
3. Set up the plugin for the used board and install all required libraries.
3. First time setup:
- Create a new Arduino sketch by going to File → New → Other → Arduino Sketch.
4. Create a new Arduino sketch
- Unselect Use Default destination and pick the arduino folder inside eive\_obsw. The name does not really matter, arduino was taken for the example.
- The board specific information can changed later so its okay to take any option here and change it later.
- Take any example sketch (.cpp or .ino). An example file will be generated and should be deleted manually in the tree view on the left
- Eclipse should ask whether it should switch to the Arduino View. Confirm this with yes.
5. The Sloeber plugin build mangement system will parse the arduino folder and all contained subfolders for source files. If you want to exclude source files from the build (for example, to exclude the arduino\_core, Sloeber will take care to include the core files via its integrated board manager!), right click on that folder in the tree view on the left, go to Resource Configureation and configure Exclude from Build.
Now the top menu should have an Arduino section which can be used to install all required libraries and Arduino cores. The project properties can be accessed in the tree view on the left by right clicking on the arduino folder and selecting properties
6. It is recommended to get familiary with the interface provided by the plugin. A majority of functions is provided by top bar elements as shown in the following picture.
4. It is recommended to get familiar with the interface provided by the plugin. A majority of functions is provided by top bar elements as shown in the following picture.
<img src="./../doc/img/eclipse_top_bar.png" width="80%">
<img src="helper/eclipse_top_bar.png" width="80%"> <br>
5. The Sloeber plugin build mangement system will parse the arduino folder and all contained subfolders for source files. If you want to exclude source files from the build (for example, to exclude the arduino\_core, Sloeber will take care to include the core files via its integrated board manager!), right click on project folder (arduino) in the tree view on the left, go to Resource Configureation and configure Exclude from Build.
6. Set up the plugin for the used board and install all required libraries.
- Install all required board libraries by going to Arduino &rarr; Preferences and using the options Library Manager and Platform and Boards.
- It is necessary to install the `arduino-timer` library by searching for timer in the Library Manager.
- It is recommended to install the Arduino AVR Boards and the Arduino megaAVR Boards in the Platforms and Boards manager.
- It is also necessary to go to Arduino &rarr; Preferences &rarr; Add a library to the selected project and then adding the `arduino-timer` and `SPI` library there.
### Build and flash instructions
1. An Arduino like bar can be seen at the top, which can be used to compile the software and flash it to the board. The check symbol is used to compile while the right arrow symbol is used to flash the software. There are also symbols to open the serial monitor or the serial plot.
1. Right click on the arduino folder inside the tree view on the left and go to Preferences.
Go to the Arduino section and make sure the Arduino Board Selection tab is configured correctly.
Please note that board libraries and libaries need to be installed and added as beforehand as specified in Prerequisites.
It is recommended to go to the Compile Options tab and addding following define to `to append to C and C++`
2. The serial monitor can be opened in the Serial monitor view tab at the bottom or with the icons at the top bar. Take care to pick the correct USB port and baud rate.
```sh
-DSERIAL_RX_BUFFER_SIZE=256
```
2. An Arduino like bar can be seen at the top, which can be used to compile the software and flash it to the board. The check symbol is used to compile while the right arrow symbol is used to flash the software. There are also symbols to open the serial monitor or the serial plot.
3. The serial monitor can be opened in the Serial monitor view tab at the bottom or with the icons at the top bar. Take care to pick the correct USB port and baud rate.

BIN
helper/eclipse_top_bar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -1,10 +1,7 @@
#include <Arduino.h>
#include "IOBoard.h"
#include "ArduinoConfig.h"
// TODO: Copy this header into arduino_core, so it can be used without
// Eclipse Sloeber as well.
#include <Arduino.h>
#include <arduino-timer.h>
#include <avr/io.h>
@ -39,7 +36,6 @@ void setup() {
bool periodicHandler1(void* args) {
if(args) {};
Serial.println("Handling new data!");
IOBoard::handleNewData();
// repeat action
return true;