Monthly Archives: May 2017

Grundlagen der Regelungstechnik (GRT)

Wie Regelungstechnik die Welt erklären kann (Science Slam Finale 2011)

tudyHelpTV

Blockschaltbild – elektrisches System (1)
Blockschaltbild – elektrisches System (2)
Blockschaltbilder vereinfachen (1)
Blockschaltbilder vereinfachen (2)
Blockschaltbilder vereinfachen – Summationsstellen verschieben (1)
Blockschaltbilder vereinfachen – Summationsstellen verschieben (2)

Ortskurve Einstieg – PT1 Glied – Regelungstechnik

Elektrotechnik in 5 Minuten by Alexander Stöger

PT1 – Glied – Übertragungsglieder – Regelungstechnik

Arduino DUE

Arduino Due
Hacking with the Arduino Due

Programming: ATMEGA16U2<

Upgrading the firmware of the Arduino Due Programming port 16U2

Upload

Ich hatte vor etwas längerem (April) in das Forum hier geschrieben, weil mein Arduino Due (SDuino) nicht flashen wollte und immer wieder der Fehler “No device found on COM3” kam.

Den Fehler habe ich nun behoben und es lässt sich einwandfrei flashen.

Gelöst wurde der Fehler, indem ich an den Widerstand R23 (bin mir nicht ganz sicher, aber ich denke das war der. muss später nochmal nachsehen.), welches 10k Ohm hat, einen 1k Ohm Widerstand Parallel angelötet habe. Dies ergibt einen Gesamtwiderstand von ca. 900 Ohm.

Ich habe einen Tip gelesen, dass der Widerstand mit 10k Ohm falsch dimensioniert ist und 1k Ohm eher passen. Der Widerstand ist aber so klein, dass ich einfach einen 1k Ohm parallel gelötet habe, sodass es ca. 1k Ohm hat (900Ohm)

Auch der Fehler, dass mein Native USB Port nicht erkannt wurde, ist nach dem Einbau des Widerstands nicht mehr vorhanden.

Sollte jemand in Zukunft mal ähnliche Fehler haben, dann weiß er ja bescheid

Fehler beim flashen – Arduino Due
Errors in Due board/schematic files
Due appears as COM6 port but gives error “No device found on COM6” on upload

$ lsusb
Bus 002 Device 006: ID 2341:003d Arduino SA 
Bus 002 Device 004: ID 046d:c063 Logitech, Inc. DELL Laser Mouse
Bus 002 Device 003: ID 413c:2005 Dell Computer Corp. RT7D50 Keyboard
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

$ stty -F /dev/ttyACM1 speed 1200 cs8 -cstopb -parenb
115200

$ stty -F /dev/ttyACM1 speed 1200 cs8 -cstopb -parenb
1200

$ setserial -G /dev/ttyACM1
/dev/ttyACM1 uart unknown port 0x0000 irq 0 baud_base 115200 spd_normal low_latency

$ echo -n ^R^B > /dev/ttyACM1

SAMD21: Arduino Zero / Feather M0

Shop / Projects

Minifigure SAM
Sam DEV
HACK-HackAday Cortex Kit
Developed on Hackaday : HaDge update – it’s a HACK
LEMSv2
MakerNet

Aliexpress

SAMD21 M0. 32-bit ARM Cortex M0 core. kompatibel mit Arduino Null, Arduino M0. Form R3.
SAMD21 M0-Mini. 32-bit ARM Cortex M0 core. Pins Abgelötet. kompatibel mit Arduino Null, Arduino M0. Form Mini.
Arduino Zero for dummies

Library

github.com/adafruit/Adafruit_ASFcore: ASF core files for Zero

Debugging

Proper Debugging of ATSAMD21 Processors

I2C

Adding more Serial Interfaces to SAMD microcontrollers (SERCOM) (VERX USEFUL!)
Wire lib hangs when scanning i2c in Wire.endTransmission()

Timer

AMD21 Timer library for the SAM15x15 and Arduino Zero
Arduino ZERO timer interrupts
happy wrappers for TC modules 3,4,5 on SAMD21
github.com/nebs/arduino-zero-timer-demo: A simple demo of the Arduino Zero timer frequency being smoothly changed in real time.
github.com/maxbader/arduino_tools: Arduino libraries and samples

Code

/c/Users/bachman0/AppData/Local/Arduino15
/c/Users/bachman0/Documents/Arduino/libraries/
C:\Users\bachman0\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.12\cores\arduino\main.cpp
/c/Users/bachman0/AppData/Local/Arduino15/packages/arduino/hardware/samd/1.6.12/cores/arduino/main.cpp

/*
 * \brief Main entry point of Arduino application
 */
int main( void )
{
  init();

  __libc_init_array();

  initVariant();

  delay(1);
#if defined(USBCON)
  USBDevice.init();
  USBDevice.attach();
#endif

  setup();

  for (;;)
  {
    loop();
    if (serialEventRun) serialEventRun();
  }

  return 0;
}
C:\Users\bachman0\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.12
cores\arduino\cortex_handlers.c

/* Exception Table */
__attribute__ ((section(".isr_vector"))) const DeviceVectors exception_table =
{
  /* Configure Initial Stack Pointer, using linker-generated symbols */
  (void*) (&__StackTop),

  (void*) Reset_Handler,
  (void*) NMI_Handler,
  (void*) HardFault_Handler,
  (void*) (0UL), /* Reserved */
  (void*) (0UL), /* Reserved */
  (void*) (0UL), /* Reserved */
  (void*) (0UL), /* Reserved */
  (void*) (0UL), /* Reserved */
  (void*) (0UL), /* Reserved */
  (void*) (0UL), /* Reserved */
  (void*) SVC_Handler,
  (void*) (0UL), /* Reserved */
  (void*) (0UL), /* Reserved */
  (void*) PendSV_Handler,
  (void*) SysTick_Handler,

  /* Configurable interrupts */
  (void*) PM_Handler,             /*  0 Power Manager */
  (void*) SYSCTRL_Handler,        /*  1 System Control */
  (void*) WDT_Handler,            /*  2 Watchdog Timer */
  (void*) RTC_Handler,            /*  3 Real-Time Counter */
  (void*) EIC_Handler,            /*  4 External Interrupt Controller */
  (void*) NVMCTRL_Handler,        /*  5 Non-Volatile Memory Controller */
  (void*) DMAC_Handler,           /*  6 Direct Memory Access Controller */
  (void*) USB_Handler,            /*  7 Universal Serial Bus */
  (void*) EVSYS_Handler,          /*  8 Event System Interface */
  (void*) SERCOM0_Handler,        /*  9 Serial Communication Interface 0 */
  (void*) SERCOM1_Handler,        /* 10 Serial Communication Interface 1 */
  (void*) SERCOM2_Handler,        /* 11 Serial Communication Interface 2 */
  (void*) SERCOM3_Handler,        /* 12 Serial Communication Interface 3 */
  (void*) SERCOM4_Handler,        /* 13 Serial Communication Interface 4 */
  (void*) SERCOM5_Handler,        /* 14 Serial Communication Interface 5 */
  (void*) TCC0_Handler,           /* 15 Timer Counter Control 0 */
  (void*) TCC1_Handler,           /* 16 Timer Counter Control 1 */
  (void*) TCC2_Handler,           /* 17 Timer Counter Control 2 */
  (void*) TC3_Handler,            /* 18 Basic Timer Counter 0 */
  (void*) TC4_Handler,            /* 19 Basic Timer Counter 1 */
  (void*) TC5_Handler,            /* 20 Basic Timer Counter 2 */
  (void*) TC6_Handler,            /* 21 Basic Timer Counter 3 */
  (void*) TC7_Handler,            /* 22 Basic Timer Counter 4 */
  (void*) ADC_Handler,            /* 23 Analog Digital Converter */
  (void*) AC_Handler,             /* 24 Analog Comparators */
  (void*) DAC_Handler,            /* 25 Digital Analog Converter */
  (void*) PTC_Handler,            /* 26 Peripheral Touch Controller */
  (void*) I2S_Handler,            /* 27 Inter-IC Sound Interface */
  (void*) (0UL),                  /* Reserved */
};
digitalRead()
Arduino15/packages/arduino/hardware/samd/1.6.12/cores/arduino/wiring_digital.c:int digitalRead( uint32_t ulPin )
Arduino15/packages/arduino/hardware/samd/1.6.12/cores/arduino/wiring_digital.h:extern int digitalRead( uint32_t ulPin ) ;

millis()
Arduino15/packages/arduino/hardware/samd/1.6.12/cores/arduino/delay.c:uint32_t millis( void )
Arduino15/packages/arduino/hardware/samd/1.6.12/cores/arduino/delay.h:extern uint32_t millis( void ) ;

yield()
Arduino15/packages/arduino/hardware/samd/1.6.12/cores/arduino/Arduino.h:void yield( void ) ;
Arduino15/packages/arduino/hardware/samd/1.6.12/cores/arduino/hooks.c:void yield(void) __attribute__ ((weak, alias("__empty")));

dtostrf()
Arduino15/packages/arduino/hardware/samd/1.6.12/cores/arduino/avr/dtostrf.c:char *dtostrf (double val, signed char width, unsigned char prec, char *sout) {
Arduino15/packages/arduino/hardware/samd/1.6.12/cores/arduino/avr/dtostrf.h:char *dtostrf(double val, signed char width, unsigned char prec, char *sout);

String / StringObject
Arduino15/packages/arduino/hardware/samd/1.6.12/cores/arduino/WString.cpp:String::String(const char *cstr)
Arduino15/packages/arduino/hardware/samd/1.6.12/cores/arduino/WString.h:class String

Stream::readStringUntil()
Arduino15/packages/arduino/hardware/samd/1.6.12/cores/arduino/Stream.cpp:String Stream::readStringUntil(char terminator)
Arduino15/packages/arduino/hardware/samd/1.6.12/cores/arduino/Stream.h:  String readStringUntil(char terminator);
C:\Users\bachman0\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.12
cores\arduino\SERCOM.h

/c/Users/bachman0/AppData/Local/Arduino15/packages/arduino/hardware/samd/1.6.12/libraries/Wire

TwoWire::TwoWire(SERCOM * s, uint8_t pinSDA, uint8_t pinSCL)
{
  this->sercom = s;
  this->_uc_pinSDA=pinSDA;
  this->_uc_pinSCL=pinSCL;
  transmissionBegun = false;
}

void TwoWire::begin(void) {
  //Master Mode
  sercom->initMasterWIRE(TWI_CLOCK);
  sercom->enableWIRE();

  pinPeripheral(_uc_pinSDA, g_APinDescription[_uc_pinSDA].ulPinType);
  pinPeripheral(_uc_pinSCL, g_APinDescription[_uc_pinSCL].ulPinType);
}

void TwoWire::begin(uint8_t address) {
  //Slave mode
  sercom->initSlaveWIRE(address);
  sercom->enableWIRE();

  pinPeripheral(_uc_pinSDA, g_APinDescription[_uc_pinSDA].ulPinType);
  pinPeripheral(_uc_pinSCL, g_APinDescription[_uc_pinSCL].ulPinType);
}


void (*onReceiveCallback)(int);
void TwoWire::onService(void)
void SERCOM3_Handler(void); // Interrupt Handler

#if WIRE_INTERFACES_COUNT > 0
  /* In case new variant doesn't define these macros,
   * we put here the ones for Arduino Zero.
   *
   * These values should be different on some variants!
   */
  #ifndef PERIPH_WIRE
    #define PERIPH_WIRE          sercom3
    #define WIRE_IT_HANDLER      SERCOM3_Handler
  #endif // PERIPH_WIRE
  TwoWire Wire(&PERIPH_WIRE, PIN_WIRE_SDA, PIN_WIRE_SCL);

  void WIRE_IT_HANDLER(void) {
    Wire.onService();
  }
#endif
/c/Program\ Files\ \(x86\)/Arduino/libraries/SD

File
Arduino/libraries/SD/src/File.cpp:File::File(SdFile f, const char *n)
Arduino/libraries/SD/src/SD.h:class File : public Stream

File::openNextFile
Arduino/libraries/SD/src/SD.cpp:File File::openNextFile(uint8_t mode)

SdFile
Arduino/libraries/SD/src/utility/SdFat.h:class SdFile : public Print {
Arduino/libraries/SD/src/utility/SdFat.h:  uint8_t open(SdFile& dirFile, const char* fileName) {  // NOLINT
Arduino/libraries/SD/src/utility/SdFile.cpp:uint8_t SdFile::open(SdFile* dirFile, const char* fileName, uint8_t oflag) {

SdFile::openRoot
Arduino/libraries/SD/src/utility/SdFile.cpp:uint8_t SdFile::openRoot(SdVolume* vol) {
Arduino/libraries/SD/src/utility/SdFile.cpp:uint8_t SdFile::openRoot(SdVolume* vol, Stream* stream) {

/c/Users/bachman0/AppData/Local/Arduino15
packages/SparkFun/hardware/samd/1.3.2/variants/SparkFun_9DoF_M0/variant.cpp

[...]

// Multi-serial objects instantiation
SERCOM sercom0( SERCOM0 ) ;
SERCOM sercom1( SERCOM1 ) ;
SERCOM sercom2( SERCOM2 ) ;
SERCOM sercom3( SERCOM3 ) ;
SERCOM sercom4( SERCOM4 ) ;
SERCOM sercom5( SERCOM5 ) ;

Uart Serial1( &sercom0, PIN_SERIAL1_RX, PIN_SERIAL1_TX, PAD_SERIAL1_RX, PAD_SERIAL1_TX ) ;
Uart Serial( &sercom5, PIN_SERIAL_RX, PIN_SERIAL_TX, PAD_SERIAL_RX, PAD_SERIAL_TX ) ;

/**
 * SERCOM0_Handler is mapped to Serial1
 * How can I remap it to I2C??
 */
void SERCOM0_Handler()
{
  Serial1.IrqHandler();
}

void SERCOM5_Handler()
{
  Serial.IrqHandler();
}