+ All Categories
Home > Documents > proudly present(s) From Arduino Uno to Beagle Bone Black (and … · 2014. 4. 17. · From Arduino...

proudly present(s) From Arduino Uno to Beagle Bone Black (and … · 2014. 4. 17. · From Arduino...

Date post: 07-Feb-2021
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
30
SYSTEMS Consulting Training Engineering ELIABLEEMBEDDED R Robert Berger Embedded Software Specialist email: [email protected] phone: + () web: http://ReliableEmbeddedSystems.com Building world class world wide win/win cooperations by helping you to create better embedded software! proudly present(s) From Arduino Uno to Beagle Bone Black (and back)! April 17, 2014 cbna
Transcript
  • SYSTEMS Consulting Training Engineering ELIABLEEMBEDDEDR

    Robert BergerEmbedded Software Specialist

    email:[email protected]

    phone:+43 (0) 699 17 69 07 19

    web:http://ReliableEmbeddedSystems.com

    Buildingworld class worldwidewin/win cooperations by helping you to create better embedded software!

    proudly present(s)

    From Arduino Uno to BeagleBone Black (and back)!

    April 17, 2014

    cbna

  • Introduction

    Table of Contents - Section

    Introduction

    cbna

  • Introduction

    Let me introduce myself

    SYSTEMS Consulting Training Engineering ELIABLEEMBEDDEDR

    Robert BergerEmbedded Software Specialist

    email:[email protected]

    phone:+43 (0) 699 17 69 07 19

    web:http://ReliableEmbeddedSystems.com

    Buildingworld class worldwidewin/win cooperations by helping you to create better embedded software!

    Robert Berger is a highly respected and experienced embed-ded real-time expert and CEO of Reliable Embedded Systems,a leading embedded training consultancy. Robert consults andtrains people all over the globe on a mission to help them createbetter embedded software. He specializes in training and con-sulting for embedded systems, from small real-time systems tomulti-core embedded Linux.

    Trainer for Elektor

    • FreeRTOS in Theory andPractice (3 days)

    • Introduction to EmbeddedLinux in Theory and Practice- a Crash Course (3 days)

    • public, on-site

    • remote with instructor

    • in German or English

    • Germany, Switzerland,Netherlands,...

    cbna

    http://www.reliableembeddedsystems.com/products-and-services/training-overview/embedded-training-overview/85-embedded-training/86-freertos-in-theory-and-practice.htmlhttp://www.reliableembeddedsystems.com/products-and-services/training-overview/embedded-training-overview/85-embedded-training/86-freertos-in-theory-and-practice.htmlhttp://www.reliableembeddedsystems.com/products-and-services/training-overview/embedded-training-overview/85-embedded-training/85-embedded-linux-intro.htmlhttp://www.reliableembeddedsystems.com/products-and-services/training-overview/embedded-training-overview/85-embedded-training/85-embedded-linux-intro.htmlhttp://www.reliableembeddedsystems.com/products-and-services/training-overview/embedded-training-overview/85-embedded-training/85-embedded-linux-intro.html

  • Introduction

    Table of Contents - Session

    IntroductionBBB Arduino Board

    Problem to solveFirst public announcementTechnologyWhat can you do with the board?

    CodeArduino SketchLinux Code

    ContactReferences

    cbna

  • BBB Arduino Board

    Table of Contents - Section

    BBB Arduino BoardProblem to solveFirst public announcementTechnologyWhat can you do with the board?

    cbna

  • BBB Arduino Board Problem to solve

    Software vs. Hardware

    Figure: I am one of those Figure: I am not one of those... but into Embedded Software many years, so I need custom hardware

    cbna

  • BBB Arduino Board Problem to solve

    Creating Hardware is usually

    Figure: exhausting!

    • lengthy

    • expensive• so I need something to

    • quickly create HW• quickly check that is works

    cbna

  • BBB Arduino Board First public announcement

    BBB Arduino board

    Figure: Gotta get on of these

    • On Google+• bearded guy?• orange lanyard?• the other guy has a

    ponytail• can we combine them?

    • Open Hardware• Schematic/PCB in Eagle• License: cba

    cbna

    http://creativecommons.org/licenses/by-sa/4.0/

  • BBB Arduino Board Technology

    Choice of technology

    Figure: Google Trends

    • Arduino• , popular• , easy to use (single loop)• for artists (non engineers)• / professional products

    • (Embedded) Linux• , popular• , professional products• / complex

    • multi-core/process• kernel/user

    • key to success is hwselection + mainline sw

    • make the most painless(longterm) choice

    cbna

  • BBB Arduino Board What can you do with the board?

    Arduino + Shield/Proto

    Proto Shield

    13121110

    98

    76543210

    +5V

    GND

    .

    REV3

    DIGITAL

    GND

    5V G

    nd 9

    V0

    1 2

    3 4

    5

    AREF

    3V3

    RES

    MADE INITALY

    SDASCL

    178

    14

    ANALOG

    ICSP

    POWER

    RESE

    T

    13121110

    98

    765432

    L

    5V

    A0

    ANAL

    OG

    IN

    AREF

    1

    GND

    TX RX

    RESET

    3V3

    A1

    A2

    A3

    A4

    A5

    VIN

    GND

    GND

    DIG

    ITAL

    (PW

    M=

    )

    Ardu

    ino

    TM

    IOREF

    ICSP

    ICSP

    2

    ON

    POW

    ER

    01 TX0

    RX0

    RESE

    T

    11

    55

    1010

    1515

    2020

    2525

    3030

    3535

    4040

    4545

    5050

    5555

    6060

    A A

    B B

    C C

    D D

    E E

    F F

    G G

    H H

    I I

    J J

    cbna

  • BBB Arduino Board What can you do with the board?

    Arduino + Level adj. + Shield/Proto

    Proto Shield

    13121110

    98

    76543210

    +5V

    GND

    .

    REV3

    DIGITAL

    GND

    5V G

    nd 9

    V0

    1 2

    3 4

    5

    AREF

    3V3

    RES

    MADE INITALY

    SDASCL

    178

    14

    ANALOG

    ICSP

    POWER

    RESE

    T

    13121110

    98

    765432

    L

    5V

    A0

    ANAL

    OG

    IN

    AREF

    1

    GND

    TX RX

    RESET

    3V3

    A1

    A2

    A3

    A4

    A5

    VIN

    GND

    GND

    DIG

    ITAL

    (PW

    M=

    )

    Ardu

    ino

    TM

    IOREF

    ICSP

    ICSP

    2

    ON

    POW

    ER

    01 TX0

    RX0

    RESE

    T

    11

    55

    1010

    1515

    2020

    2525

    3030

    3535

    4040

    4545

    5050

    5555

    6060

    A A

    B B

    C C

    D D

    E E

    F F

    G G

    H H

    I I

    J J

    cbna

  • BBB Arduino Board What can you do with the board?

    Configuration

    Figure: Jumper field

    • Digital (unidirectional)• 3.3V ↔ 5V shield/Arduino

    to cape/BBB• 5V ↔ 5V shield over level

    adj. to Arduino• 3.3V ↔ 3.3V (don’t use)

    • Analog (unidirectional)• 1.8V ↔ 5V shield/Arduino

    to cape/BBB• 5V ↔ 5V shield over level

    adj. to Arduino• 1.8V ↔ 1.8 V (don’t use)

    • I2C 3.3V ↔ 5V birectional

    cbna

  • BBB Arduino Board What can you do with the board?

    BBB + Level adj. + Shield/Proto

    Proto Shield

    13121110

    98

    76543210

    +5V

    GND

    .

    REV3

    DIGITAL

    GND

    5V G

    nd 9

    V0

    1 2

    3 4

    5

    AREF

    3V3

    RES

    MADE INITALY

    SDASCL

    178

    14

    ANALOG

    ICSP

    POWER

    RESE

    T

    11

    55

    1010

    1515

    2020

    2525

    3030

    3535

    4040

    4545

    5050

    5555

    6060

    A A

    B B

    C C

    D D

    E E

    F F

    G G

    H H

    I I

    J JGND

    VDD_3V3EXPVDD_5VSYS_5V

    SYS_RESETn

    GNDVDD_3V3EXPVDD_5VSYS_5VPWR_BUT

    12

    910

    1920

    2930

    3940

    GPIO1_28EHRPWM1AEHRPWM1BI2C1_SDAI2C2_SDA

    UART2_RXDUART1_TXDUART1_RXD

    SPI1_CS0SPI1_D1

    VDD_ADCGNDA_ADC

    AIN5AIN3AIN1

    GPIO1_7GNDGND

    UART4_RXDUART4_TXDGPIO1_16I2C1_SCLI2C2_SCLUART2_TXDGPIO1_17GPIO3_21GPIO3_19SPI1_D0SPI1_CLKAIN4AIN6AIN2AIN0CLKOUT2GNDGND

    GNDGPIO1_7GPIO1_3TIMER7TIMER6

    GNDGPIO1_6GPIO1_2TIMER4TIMER5

    12

    910

    1920

    2930

    3940

    GPIO1_12GPIO0_26GPIO1_14GPIO2_1

    GPIO1_31GPIO1_5GPIO1_1

    GPIO1_29GPIO2_24GPIO2_25

    GPIO2_13GPIO2_11GPIO2_9GPIO2_7

    GPIO1_13EHRPWM2BGPIO1_15GPIO0_27EHRPWM2AGPIO1_30GPIO1_4GPIO1_0GPIO2_22GPIO2_23UART5_CTSNUART4_RTSNUART4_CTSNUART5_TXDGPIO2_12GPIO2_10GPIO2_8GPIO2_6

    P9P8

    BBB

    UART5_RTSNUART3_RTSNUART3_CTSNUART5_RXD

    P9P8

    cbna

  • BBB Arduino Board What can you do with the board?

    BBB + Cape/Proto

    11

    55

    1010

    1515

    2020

    2525

    3030

    3535

    4040

    4545

    5050

    5555

    6060

    A A

    B B

    C C

    D D

    E E

    F F

    G G

    H H

    I I

    J JGND

    VDD_3V3EXPVDD_5VSYS_5V

    SYS_RESETn

    GNDVDD_3V3EXPVDD_5VSYS_5VPWR_BUT

    12

    910

    1920

    2930

    3940

    GPIO1_28EHRPWM1AEHRPWM1BI2C1_SDAI2C2_SDA

    UART2_RXDUART1_TXDUART1_RXD

    SPI1_CS0SPI1_D1

    VDD_ADCGNDA_ADC

    AIN5AIN3AIN1

    GPIO1_7GNDGND

    UART4_RXDUART4_TXDGPIO1_16I2C1_SCLI2C2_SCLUART2_TXDGPIO1_17GPIO3_21GPIO3_19SPI1_D0SPI1_CLKAIN4AIN6AIN2AIN0CLKOUT2GNDGND

    GNDGPIO1_7GPIO1_3TIMER7TIMER6

    GNDGPIO1_6GPIO1_2TIMER4TIMER5

    12

    910

    1920

    2930

    3940

    GPIO1_12GPIO0_26GPIO1_14GPIO2_1

    GPIO1_31GPIO1_5GPIO1_1

    GPIO1_29GPIO2_24GPIO2_25

    GPIO2_13GPIO2_11GPIO2_9GPIO2_7

    GPIO1_13EHRPWM2BGPIO1_15GPIO0_27EHRPWM2AGPIO1_30GPIO1_4GPIO1_0GPIO2_22GPIO2_23UART5_CTSNUART4_RTSNUART4_CTSNUART5_TXDGPIO2_12GPIO2_10GPIO2_8GPIO2_6

    P9P8

    BBB

    UART5_RTSNUART3_RTSNUART3_CTSNUART5_RXD

    P9P8

    GNDVDD_3V3EXP

    VDD_5VSYS_5V

    SYS_RESETn

    GNDVDD_3V3EXPVDD_5VSYS_5VPWR_BUT

    12

    910

    1920

    2930

    3940

    GPIO1_28EHRPWM1AEHRPWM1BI2C1_SDAI2C2_SDA

    UART2_RXDUART1_TXDUART1_RXD

    SPI1_CS0SPI1_D1

    VDD_ADCGNDA_ADC

    AIN5AIN3AIN1

    GPIO1_7GNDGND

    UART4_RXDUART4_TXDGPIO1_16I2C1_SCLI2C2_SCLUART2_TXDGPIO1_17GPIO3_21GPIO3_19SPI1_D0SPI1_CLKAIN4AIN6AIN2AIN0CLKOUT2GNDGND

    GNDGPIO1_7GPIO1_3TIMER7TIMER6

    GNDGPIO1_6GPIO1_2TIMER4TIMER5

    12

    910

    1920

    2930

    3940

    GPIO1_12GPIO0_26GPIO1_14GPIO2_1

    GPIO1_31GPIO1_5GPIO1_1

    GPIO1_29GPIO2_24GPIO2_25

    UART5_RTSNUART3_RTSNUART3_CTSNUART5_RXD

    GPIO2_13GPIO2_11GPIO2_9GPIO2_7

    GPIO1_13EHRPWM2BGPIO1_15GPIO0_27EHRPWM2AGPIO1_30GPIO1_4GPIO1_0GPIO2_22GPIO2_23UART5_CTSNUART4_RTSNUART4_CTSNUART5_TXDGPIO2_12GPIO2_10GPIO2_8GPIO2_6

    P9P8

    Cape

    cbna

  • BBB Arduino Board What can you do with the board?

    Arduino + Level adj. + Cape/Proto13121110

    98

    765432

    L

    5V

    A0

    ANAL

    OG

    IN

    AREF

    1

    GND

    TX RX

    RESET

    3V3

    A1

    A2

    A3

    A4

    A5

    VIN

    GND

    GND

    DIG

    ITAL

    (PW

    M=

    )

    Ardu

    ino

    TM

    IOREF

    ICSP

    ICSP

    2

    ON

    POW

    ER

    01 TX0

    RX0

    RESE

    T

    11

    55

    1010

    1515

    2020

    2525

    3030

    3535

    4040

    4545

    5050

    5555

    6060

    A A

    B B

    C C

    D D

    E E

    F F

    G G

    H H

    I I

    J J

    GNDVDD_3V3EXP

    VDD_5VSYS_5V

    SYS_RESETn

    GNDVDD_3V3EXPVDD_5VSYS_5VPWR_BUT

    12

    910

    1920

    2930

    3940

    GPIO1_28EHRPWM1AEHRPWM1BI2C1_SDAI2C2_SDA

    UART2_RXDUART1_TXDUART1_RXD

    SPI1_CS0SPI1_D1

    VDD_ADCGNDA_ADC

    AIN5AIN3AIN1

    GPIO1_7GNDGND

    UART4_RXDUART4_TXDGPIO1_16I2C1_SCLI2C2_SCLUART2_TXDGPIO1_17GPIO3_21GPIO3_19SPI1_D0SPI1_CLKAIN4AIN6AIN2AIN0CLKOUT2GNDGND

    GNDGPIO1_7GPIO1_3TIMER7TIMER6

    GNDGPIO1_6GPIO1_2TIMER4TIMER5

    12

    910

    1920

    2930

    3940

    GPIO1_12GPIO0_26GPIO1_14GPIO2_1

    GPIO1_31GPIO1_5GPIO1_1

    GPIO1_29GPIO2_24GPIO2_25

    UART5_RTSNUART3_RTSNUART3_CTSNUART5_RXD

    GPIO2_13GPIO2_11GPIO2_9GPIO2_7

    GPIO1_13EHRPWM2BGPIO1_15GPIO0_27EHRPWM2AGPIO1_30GPIO1_4GPIO1_0GPIO2_22GPIO2_23UART5_CTSNUART4_RTSNUART4_CTSNUART5_TXDGPIO2_12GPIO2_10GPIO2_8GPIO2_6

    P9P8

    Cape

    cbna

  • BBB Arduino Board What can you do with the board?

    Arduino + Level adj. + BBB13121110

    98

    765432

    L

    5V

    A0

    ANAL

    OG

    IN

    AREF

    1

    GND

    TX RX

    RESET

    3V3

    A1

    A2

    A3

    A4

    A5

    VIN

    GND

    GND

    DIG

    ITAL

    (PW

    M=

    )

    Ardu

    ino

    TM

    IOREF

    ICSP

    ICSP

    2

    ON

    POW

    ER

    01 TX0

    RX0

    RESE

    T

    11

    55

    1010

    1515

    2020

    2525

    3030

    3535

    4040

    4545

    5050

    5555

    6060

    A A

    B B

    C C

    D D

    E E

    F F

    G G

    H H

    I I

    J JGND

    VDD_3V3EXPVDD_5VSYS_5V

    SYS_RESETn

    GNDVDD_3V3EXPVDD_5VSYS_5VPWR_BUT

    12

    910

    1920

    2930

    3940

    GPIO1_28EHRPWM1AEHRPWM1BI2C1_SDAI2C2_SDA

    UART2_RXDUART1_TXDUART1_RXD

    SPI1_CS0SPI1_D1

    VDD_ADCGNDA_ADC

    AIN5AIN3AIN1

    GPIO1_7GNDGND

    UART4_RXDUART4_TXDGPIO1_16I2C1_SCLI2C2_SCLUART2_TXDGPIO1_17GPIO3_21GPIO3_19SPI1_D0SPI1_CLKAIN4AIN6AIN2AIN0CLKOUT2GNDGND

    GNDGPIO1_7GPIO1_3TIMER7TIMER6

    GNDGPIO1_6GPIO1_2TIMER4TIMER5

    12

    910

    1920

    2930

    3940

    GPIO1_12GPIO0_26GPIO1_14GPIO2_1

    GPIO1_31GPIO1_5GPIO1_1

    GPIO1_29GPIO2_24GPIO2_25

    GPIO2_13GPIO2_11GPIO2_9GPIO2_7

    GPIO1_13EHRPWM2BGPIO1_15GPIO0_27EHRPWM2AGPIO1_30GPIO1_4GPIO1_0GPIO2_22GPIO2_23UART5_CTSNUART4_RTSNUART4_CTSNUART5_TXDGPIO2_12GPIO2_10GPIO2_8GPIO2_6

    P9P8

    BBB

    UART5_RTSNUART3_RTSNUART3_CTSNUART5_RXD

    P9P8

    cbna

  • BBB Arduino Board What can you do with the board?

    All together

    Proto Shield

    13121110

    98

    76543210

    +5V

    GND

    .

    REV3

    DIGITAL

    GND

    5V G

    nd 9

    V0

    1 2

    3 4

    5

    AREF

    3V3

    RES

    MADE INITALY

    SDASCL

    178

    14

    ANALOG

    ICSP

    POWER

    RESE

    T

    13121110

    98

    765432

    L

    5V

    A0

    ANAL

    OG

    IN

    AREF

    1

    GND

    TX RX

    RESET

    3V3

    A1

    A2

    A3

    A4

    A5

    VIN

    GND

    GND

    DIG

    ITAL

    (PW

    M=

    )

    Ardu

    ino

    TM

    IOREF

    ICSP

    ICSP

    2

    ON

    POW

    ER

    01 TX0

    RX0

    RESE

    T

    11

    55

    1010

    1515

    2020

    2525

    3030

    3535

    4040

    4545

    5050

    5555

    6060

    A A

    B B

    C C

    D D

    E E

    F F

    G G

    H H

    I I

    J JGND

    VDD_3V3EXPVDD_5VSYS_5V

    SYS_RESETn

    GNDVDD_3V3EXPVDD_5VSYS_5VPWR_BUT

    12

    910

    1920

    2930

    3940

    GPIO1_28EHRPWM1AEHRPWM1BI2C1_SDAI2C2_SDA

    UART2_RXDUART1_TXDUART1_RXD

    SPI1_CS0SPI1_D1

    VDD_ADCGNDA_ADC

    AIN5AIN3AIN1

    GPIO1_7GNDGND

    UART4_RXDUART4_TXDGPIO1_16I2C1_SCLI2C2_SCLUART2_TXDGPIO1_17GPIO3_21GPIO3_19SPI1_D0SPI1_CLKAIN4AIN6AIN2AIN0CLKOUT2GNDGND

    GNDGPIO1_7GPIO1_3TIMER7TIMER6

    GNDGPIO1_6GPIO1_2TIMER4TIMER5

    12

    910

    1920

    2930

    3940

    GPIO1_12GPIO0_26GPIO1_14GPIO2_1

    GPIO1_31GPIO1_5GPIO1_1

    GPIO1_29GPIO2_24GPIO2_25

    GPIO2_13GPIO2_11GPIO2_9GPIO2_7

    GPIO1_13EHRPWM2BGPIO1_15GPIO0_27EHRPWM2AGPIO1_30GPIO1_4GPIO1_0GPIO2_22GPIO2_23UART5_CTSNUART4_RTSNUART4_CTSNUART5_TXDGPIO2_12GPIO2_10GPIO2_8GPIO2_6

    P9P8

    BBB

    UART5_RTSNUART3_RTSNUART3_CTSNUART5_RXD

    P9P8

    GNDVDD_3V3EXP

    VDD_5VSYS_5V

    SYS_RESETn

    GNDVDD_3V3EXPVDD_5VSYS_5VPWR_BUT

    12

    910

    1920

    2930

    3940

    GPIO1_28EHRPWM1AEHRPWM1BI2C1_SDAI2C2_SDA

    UART2_RXDUART1_TXDUART1_RXD

    SPI1_CS0SPI1_D1

    VDD_ADCGNDA_ADC

    AIN5AIN3AIN1

    GPIO1_7GNDGND

    UART4_RXDUART4_TXDGPIO1_16I2C1_SCLI2C2_SCLUART2_TXDGPIO1_17GPIO3_21GPIO3_19SPI1_D0SPI1_CLKAIN4AIN6AIN2AIN0CLKOUT2GNDGND

    GNDGPIO1_7GPIO1_3TIMER7TIMER6

    GNDGPIO1_6GPIO1_2TIMER4TIMER5

    12

    910

    1920

    2930

    3940

    GPIO1_12GPIO0_26GPIO1_14GPIO2_1

    GPIO1_31GPIO1_5GPIO1_1

    GPIO1_29GPIO2_24GPIO2_25

    UART5_RTSNUART3_RTSNUART3_CTSNUART5_RXD

    GPIO2_13GPIO2_11GPIO2_9GPIO2_7

    GPIO1_13EHRPWM2BGPIO1_15GPIO0_27EHRPWM2AGPIO1_30GPIO1_4GPIO1_0GPIO2_22GPIO2_23UART5_CTSNUART4_RTSNUART4_CTSNUART5_TXDGPIO2_12GPIO2_10GPIO2_8GPIO2_6

    P9P8

    Cape

    cbna

  • Code

    Table of Contents - Section

    CodeArduino SketchLinux Code

    cbna

  • Code Arduino Sketch

    Arduino Digital Output

    Proto Shield

    13121110

    98

    76543210

    +5V

    GND

    .

    REV3

    DIGITAL

    GND

    5V G

    nd 9

    V0

    1 2

    3 4

    5

    AREF

    3V3

    RES

    MADE INITALY

    SDASCL

    178

    14

    ANALOG

    ICSP

    POWER

    RESE

    T

    13121110

    98

    765432

    L

    5V

    A0

    ANAL

    OG

    IN

    AREF

    1

    GND

    TX RX

    RESET

    3V3

    A1

    A2

    A3

    A4

    A5

    VIN

    GND

    GND

    DIG

    ITAL

    (PW

    M=

    )

    Ardu

    ino

    TM

    IOREF

    ICSP

    ICSP

    2

    ON

    POW

    ER

    01 TX0

    RX0

    RESE

    T

    11

    55

    1010

    1515

    2020

    2525

    3030

    3535

    4040

    4545

    5050

    5555

    6060

    A A

    B B

    C C

    D D

    E E

    F F

    G G

    H H

    I I

    J J

    cbna

  • Code Arduino Sketch

    Arduino Sketch

    Listing 1: BlinkWithoutDelay.ino

    26 const int ledPin = 13; // the number of the LED pin27 // Variables will change:28 int ledState = LOW; // ledState used to set the LED29 long previousMillis = 0; // will store last time LED was updated30 // the following variable is a long because the time, measured in milliseconds ,31 // will quickly become a bigger number than can be stored in an int.32 long interval = 1000; // interval at which to blink (milliseconds)33 void setup() {34 // set the digital pin as output:35 pinMode(ledPin, OUTPUT); }

    line 26 declares ledPin (where LED is connected to Arduino)setup() [1] line 33 called once, when the sketch startspinMode() [2] line 35 configures a digital pin as input or output

    cbna

  • Code Arduino Sketch

    Arduino Sketch

    Listing 2: BlinkWithoutDelay.ino

    38 void loop() {39 unsigned long currentMillis = millis();40 if(currentMillis - previousMillis > interval) {41 // save the last time you blinked the LED42 previousMillis = currentMillis;43 // if the LED is off turn it on and vice-versa:44 if (ledState == LOW)45 ledState = HIGH;46 else47 ledState = LOW;48 // set the LED with the ledState of the variable:49 digitalWrite(ledPin, ledState); }}

    loop() [3] line 38 is called over and over setup() and loop() need to beincluded in your sketchdigitalWrite() [4] line 49 makes output change state

    cbna

  • Code Linux Code

    Linux Digital Output

    Proto Shield

    13121110

    98

    76543210

    +5V

    GND

    .

    REV3

    DIGITAL

    GND

    5V G

    nd 9

    V0

    1 2

    3 4

    5

    AREF

    3V3

    RES

    MADE INITALY

    SDASCL

    178

    14

    ANALOG

    ICSP

    POWER

    RESE

    T

    11

    55

    1010

    1515

    2020

    2525

    3030

    3535

    4040

    4545

    5050

    5555

    6060

    A A

    B B

    C C

    D D

    E E

    F F

    G G

    H H

    I I

    J J

    GNDVDD_3V3EXP

    VDD_5VSYS_5V

    SYS_RESETn

    GNDVDD_3V3EXPVDD_5VSYS_5VPWR_BUT

    12

    910

    1920

    2930

    3940

    GPIO1_28EHRPWM1AEHRPWM1BI2C1_SDAI2C2_SDA

    UART2_RXDUART1_TXDUART1_RXD

    SPI1_CS0SPI1_D1

    VDD_ADCGNDA_ADC

    AIN5AIN3AIN1

    GPIO1_7GNDGND

    UART4_RXDUART4_TXDGPIO1_16I2C1_SCLI2C2_SCLUART2_TXDGPIO1_17GPIO3_21GPIO3_19SPI1_D0SPI1_CLKAIN4AIN6AIN2AIN0CLKOUT2GNDGND

    GNDGPIO1_7GPIO1_3TIMER7TIMER6

    GNDGPIO1_6GPIO1_2TIMER4TIMER5

    12

    910

    1920

    2930

    3940

    GPIO1_12GPIO0_26GPIO1_14GPIO2_1

    GPIO1_31GPIO1_5GPIO1_1

    GPIO1_29GPIO2_24GPIO2_25

    GPIO2_13GPIO2_11GPIO2_9GPIO2_7

    GPIO1_13EHRPWM2BGPIO1_15GPIO0_27EHRPWM2AGPIO1_30GPIO1_4GPIO1_0GPIO2_22GPIO2_23UART5_CTSNUART4_RTSNUART4_CTSNUART5_TXDGPIO2_12GPIO2_10GPIO2_8GPIO2_6

    P9P8

    BBB

    UART5_RTSNUART3_RTSNUART3_CTSNUART5_RXD

    P9P8

    cbna

  • Code Linux Code

    Flat Device Tree

    Listing 3: am335x-boneblack-res-1.dts: pinmux

    13 /* --> define custom leds pinmux */14 &am33xx_pinmux {15 traffic_leds_s0: traffic_leds_s0 {16 pinctrl-single,pins = <17 /* .gpio1_28 , P9_12 60 $PIN: 30 OUTPUT MODE7 - traffic -1 LED */18 0x78 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)>;19 };20 };21 /*

  • Code Linux Code

    Flat Device Tree

    Listing 4: am335x-boneblack-res-1.dts: assign driver

    141 /* --> define custom leds */142 pio_leds {143 pinctrl-names = "default";144 pinctrl -0 = ;145 compatible = "gpio-leds";146 led@1 {147 label = "trfcl1:red";148 gpios = ;149 linux,default-trigger = "none";150 default-state = "off";151 };152 };153 /*

  • Code Linux Code

    Let it blink

    Listing 5: am335x-boneblack-res-1.dts: assign driver

    1 ...2 Poky (Yocto Project Reference Distro) 1.5.1 beagle-bone-black-ml /dev/ttyO034 beagle-bone-black-ml login: root5 $ cat /proc/version6 Linux version 3.14.0-custom-student4+ (student4@bh4) (gcc version 4.8.1 (GCC) ) #1 SMP ←↩Mon Apr 7 18:44:33 EEST 2014

    7 $ cd /sys/class/leds/trfcl1:red8 $ echo timer > trigger9 $ echo 1000 > delay_on

    10 $ echo 1000 > delay_off

    cbna

  • Contact

    Table of Contents - Section

    Contact

    cbna

  • Contact

    Contact

    • BBB/Arduino UNO Board requests:http://www.reliableembeddedsystems.com/contact-us.html

    • Training requests (Physical computing with Arduino/BBBcoming soon):http://www.reliableembeddedsystems.com/contact-us.html

    • subscribe to Linux trainings list:http://www.reliableembeddedsystems.com/linux-list.html

    • subscribe to FreeRTOS trainings list:http://www.reliableembeddedsystems.com/freertos-list.html

    • subscribe to Reliable Embedded Systems mailing list:http://www.reliableembeddedsystems.com/mailing-list.html

    cbna

    http://www.reliableembeddedsystems.com/contact-us.htmlhttp://www.reliableembeddedsystems.com/contact-us.htmlhttp://www.reliableembeddedsystems.com/linux-list.htmlhttp://www.reliableembeddedsystems.com/freertos-list.htmlhttp://www.reliableembeddedsystems.com/mailing-list.html

  • Contact

    Thank you!

    SYSTEMS Consulting Training Engineering ELIABLEEMBEDDEDR

    Robert BergerEmbedded Software Specialist

    email:[email protected]

    phone:+43 (0) 699 17 69 07 19

    web:http://ReliableEmbeddedSystems.com

    Buildingworld class worldwidewin/win cooperations by helping you to create better embedded software!

    cbna

  • References

    Table of Contents - Section

    References

    cbna

  • References

    References I

    I ”setup()”http://arduino.cc/en/Reference/Setup

    I ”pinMode()”http://arduino.cc/en/Reference/pinMode

    I ”loop()”http://arduino.cc/en/Reference/loop

    I ”digitalWrite()”http://arduino.cc/en/Reference/digitalWrite

    cbna

    http://arduino.cc/en/Reference/Setuphttp://arduino.cc/en/Reference/pinModehttp://arduino.cc/en/Reference/loophttp://arduino.cc/en/Reference/digitalWrite

    IntroductionBBB Arduino BoardProblem to solveFirst public announcementTechnologyWhat can you do with the board?

    CodeArduino SketchLinux Code

    ContactReferences


Recommended