embedded programming

individual assignment part 1

read a microcontroller data sheet

ATmega328P

Datasheet

It is a 8-bit AVR Microcontroller created by Atmel. I decided to use this datasheet because it is the chip I used in the electronics design week. There is a lot more information in the data plate than the ones I have described in the pictures below but these are some of the most important ones at the moment.

Operating voltage 2.7V to 5.5V
ISP Flash memory 32K bytes
EEPROM memory 1Kbyte
SRAM memory 2Kbytes

individual assignment part 2

program your board to do something, with as many different programming languages and programming environments as possible

C/C++ with Arduino IDE

First, I used the Arduino IDE for programming as I did in week 06.

Arduino

link

The Arduino IDE is an Open-Sorce development environment for writing code and uploading it to the board.



The created program switches an LED which lights up when connected to pin 13 -> digitalWrite(led, HIGH); then wait 1 second ->delay(1000); and then switches them off -> digitalWrite(led, LOW); and then waits 0.5 seconds -> delay(500);
Parallel to this it shows on the serial screen of the computer how many times the LED has been switched on. As long as the microcontroller is connected via a serial interface.

                  
      //set variables for a better overview
      int led = 13;
      int count = 1;

      //here is the setup code it is executed once at the beginning
      void setup() {
        // initialize serial communications at 9600 bps:
        Serial.begin(9600);
        //pin 13 is declared as output
        pinMode(13, OUTPUT);

      }

      //This program part is infinitely fetched again
      void loop() {
        //turn LED on
        digitalWrite(led, HIGH);

        //write text on the serial monitor
        Serial.print("LED on NR:");
        Serial.println(count);

        //wait 1 second
        delay(1000);

        //turn the LED Off
        digitalWrite(led, LOW);
        //write text again
        Serial.println("LED off again");
        //wait 1/2 seccond
        delay(500);
        count++;
      }

      
      

Example with c


Blocks and C/C++ with Tinkercad Circuit

Next I thought about who the user group of my final project is. I want to address children especially. A simple block based programming is a good way to get started. In Circuit you can see the text based code while putting the blocks together which makes it easier for futher work.

Tinkercad Circuit

link

Tinkercad Circuits is a website where you can build and test circuits. There you can program an Arduino microcontroller of a blockprogram error or with C.

Python

To try a different but still very popular programming language I'm testing python.

Python

link

Python is an interpreted higher programming language. It is written without brackets and is therefore easier to read.


As in the program code above I switch on the LED at pin 13 ->board.digital[13].write(1) then wait 1 second -> time.sleep(1) and switch off the LEd -> board.digital[13].write(0) and wait 0.5 seconds.
In principle the program works the same way as the others in C/C++, only different commands are used and you create the infinite while loop yourself.

                                
            #import libarys
            import pyfirmata
            import time

            #set usb Port
            board = pyfirmata.Arduino('com3')

            #infinite loop
            while True:
                #turn LED on
                board.digital[13].write(1)

                #wait 1 second
                time.sleep(1)

                #turn LED off
                board.digital[13].write(0)
                #wait 1/2 second
                time.sleep(0.5)


                                
                              

It works good with all of this. Here is just one on video, since all the programsm do the same. -?????????? (I'm not sure what my cat want to say but I think she still has some questions)


group assignment

compare the performance and development workflows for other architectures

ARM Microcontroller Architecture

Advanced Risc Maschine is a microprocessor design which was developed in 1983 by the British computer company Acorn. The company ARM itself does not manufacture microcontrollers but issues licenses. This architecture is used in mobile devices, stand PCs, servers and also in the rasbery pi.
There are different versions of the architecture as ARMv1, ARMv2 etc and each one has its own advantage and disadvantages.

ARM Coretex-M3 Microcontroller Architecture

The ARM Coretex-M3 Mikrocontroller is a 32-Bit-processor, which provides separate data and command busses for communication with the ROM and RAM memory.

Features
PIC Peripherical Interface Controller

PIC Microcontrollers were developed in 1993. They are very fast and it is quite easy to execute a progrom, compared with other microcontrollers. the architecture is based on on the Harvard architecture.

Bild einfügen
Features
Cpmparison

Regarding the architectures, we compare a von Neumann with Harvard, which leads to the commen discussion which of them is better. The von-Neumann is way cheaper than its counterpart, since no redundant parts have to be installed. But this structure, leads to its biggest problem, the von-Neumann bottle neck. An data-traffic-jam is inevitable, since a command has to run through each bus and others have to wait for the bus to be free again. The Harvard arichtecture seperates programs and data in different storage locations, which creates a higher material cost, but allows higher speeds while perfoming, since commands and data can be managed parallel.


Downlowds