« SE4Binome2024-7 » : différence entre les versions
Aller à la navigation
Aller à la recherche
Ligne 11 : | Ligne 11 : | ||
==== COMMUNICATION SPI ==== | ==== COMMUNICATION SPI ==== | ||
{| class="wikitable" | |||
|+ | |||
![[Fichier:Minicom .mp4|vignette|Minicom démontrant le bon fonctionnement du code à gauche]] | |||
! | |||
|} | |||
==== FONCTION SLEEP ==== | ==== FONCTION SLEEP ==== | ||
Ligne 69 : | Ligne 74 : | ||
=== Communication Série === | === Communication Série === | ||
=<div class="mcwiki-header" style="border-radius: 40px; padding: 15px; font-weight: bold; color: #FFFFFF; text-align: center; font-size: 80%; background: #ED254E; vertical-align: top; width: 98%;">Schéma, PCB & KiCAD</div>= | =<div class="mcwiki-header" style="border-radius: 40px; padding: 15px; font-weight: bold; color: #FFFFFF; text-align: center; font-size: 80%; background: #ED254E; vertical-align: top; width: 98%;">Schéma, PCB & KiCAD</div>= |
Version du 13 novembre 2024 à 10:09
Code Source et autre programmes
Ordonnanceur
SQUELETTE BASIQUE DE L'ORDONNANCEUR
STRUCTURE DES TÂCHES
CLIGNOTEMENT DES LEDs
COMMUNICATION SERIE
COMMUNICATION SPI
FONCTION SLEEP
Makefile
export CC = avr-gcc
export MCU = atmega328p
export TARGET_ARCH = -mmcu=$(MCU)
export CFLAGS = -Wall -I. -DF_CPU=16000000 -Os #-g
export LDFLAGS = -g $(TARGET_ARCH) -lm -Wl,--gc-sections # -Os
TARGET = ordonnanceur1
#TERM = /dev/ttyUSB0
TERM = /dev/ttyACM0
CPPFLAGS = -mmcu=$(MCU)
PGMER = -c arduino -b 115200 -P $(TERM)
PGMERISP = -c arduino -b 115200 -P $(TERM)
ARVDUDECONF= -C /usr/local/arduino/arduino-0021/hardware/tools/avrdude.conf
export DUDE = /usr/bin/avrdude -F -v -p $(MCU) $(AVRDUDECONF)
C_SRC = $(wildcard *.c)
OBJS = $(C_SRC:.c=.o)
all: $(TARGET).hex
ass:$(C_SRC)
$(CC) -S $(CPPFLAGS) $(CFLAGS) $< -o $@
clean:
rm -f *.o
%.o:%.c
$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
$(TARGET).elf: $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS)
$(TARGET).hex: $(TARGET).elf
avr-objcopy -j .text -j .data -O ihex $(TARGET).elf $(TARGET).hex
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 -O ihex $(TARGET).elf eeprom.hex
upload: $(TARGET).hex
stty -F $(TERM) hupcl # reset
$(DUDE) $(PGMER) -U flash:w:$(TARGET).hex
# $(DUDE) $(PGMERISP) -U flash:w:$(TARGET).hex
size: $(TARGET).elf
avr-size --format=avr --mcu=$(MCU) $(TARGET).elf
Communication Série
Schéma, PCB & KiCAD
Shield
Photos et vidéos | description |
---|---|
La carte-mère soudée mais pas encore programmée | |
Carte RNDIS
NOTES
deux ports USB pour la carte fille : un pour la connexion en ISP/Réseau à l'ordinateur et un pour la programmation. Possibilité de faire une connexion SPI avec un câble RJ45