Permalink
Browse files

Unterstuetzung fuer weiteren Controller

  • Loading branch information...
ingo ingo
ingo authored and ingo committed Dec 22, 2017
1 parent 6d02f59 commit 9d377d2aa88dd24e87d53530455e4889b123d192
View
@@ -18,10 +18,11 @@
## (c) 2017 by Martin Kramer and Ingo Lages, i (dot) lages (at) gmx (dot) de
##############################################################################
# Choose firmware architecture atmega32 or atmega644 (for C1612 and UI):
######################
export MCU = atmega644
######################
# Choose firmware architecture atmega328p, atmega32 or atmega644p (for C1612 and UI):
# see attribute "__AVR_ATmega644P__", ...
#######################
export MCU = atmega644p
#######################
# Choose CAN-Server-IP for load firmware (eg. 192.168.1.42)
###########################
View
@@ -31,20 +31,22 @@ clean:
make strukturen xx="sudo make clean"
make cDienste xx="sudo make clean"
make cppDienste xx="sudo make clean"
make firmware xx="sudo make clean" parm2=MCU=atmega328p
make firmware xx="sudo make clean" parm2=MCU=atmega32
make firmware xx="sudo make clean" parm2=MCU=atmega644
make firmware xx="sudo make clean" parm2=MCU=atmega644p
make firmwareOhneEds xx="sudo make clean"
make tools xx="sudo make clean"
@# wuerde "Dropbox-Pfad" erzwingen: cd hcanhab2_mqtt; make clean
@# folgendes wuerde den "Dropbox-Pfad" erzwingen: cd hcanhab2_mqtt; make clean
#
@#sudo find -type f -name ".depend" | xargs rm -f
all:
make strukturen xx="make all"
make cDienste xx="make all"
make cppDienste xx="make all"
make firmware xx="make all" parm2=MCU=atmega32
make firmware xx="sudo make clean" MCU=atmega644; make firmware xx="make all" MCU=atmega644
make firmware xx="make all" parm2=MCU=atmega328p; make firmware xx="sudo make clean_part" parm2=MCU=atmega328p
make firmware xx="make all" parm2=MCU=atmega32; make firmware xx="sudo make clean_part" parm2=MCU=atmega32
make firmware xx="make all" parm2=MCU=atmega644p; make firmware xx="sudo make clean_part" parm2=MCU=atmega644p
make firmwareOhneEds xx="sudo make clean"; make firmwareOhneEds xx="make all"
install:
@@ -91,10 +93,3 @@ firmwareOhneEds:
tools:
cd tools; $(xx)
cd tools/hcanextid; $(xx)
release:
cd firmwares/controllerboard-1612-v01; sudo make release MCU=atmega32
cd firmwares/controllerboard-1612-v01; sudo make release MCU=atmega644
cd firmwares/userpanel-v01; sudo make release MCU=atmega32
cd firmwares/userpanel-v01; sudo make release MCU=atmega644
cd firmwares/usv-modul; sudo make release
View
@@ -17,8 +17,8 @@
*
* (c) 2006 by Martin Haller, mah (at) iuse (dot) org
*
* Adapted for ATmega644:
* (c) 2010 by Martin Kramer and Ingo Lages, i (dot) lages (at) gmx (dot) de
* Adapted for ATmega328p and ATmega644p:
* (c) 2010/2017 by Martin Kramer and Ingo Lages, i (dot) lages (at) gmx (dot) de
*/
#include <avr/io.h>
#include <avr/eeprom.h>
@@ -185,10 +185,10 @@ void canix_rtc_init(void)
canix_rtc_clock.year = 0;
// Timer programmieren:
#ifdef MCU_atmega32
#if defined(__AVR_ATmega32__)
TCCR0 = (1<<CS00)|(1<<CS02); // Divider 1024
TIMSK = (1<<TOIE0); // Timer0 Interrupt einschalten
#elif MCU_atmega644
#elif defined(__AVR_ATmega328P__) || defined(__AVR_ATmega644P__)
TCCR0B = (1<<CS00)|(1<<CS02); // Divider
TIMSK0 = (1<<TOIE0); // Timer0 Interrupt einschalten
#endif
View
@@ -17,8 +17,8 @@
*
* (c) 2006 by Martin Haller, mah (at) iuse (dot) org
*
* Adapted for ATmega644:
* (c) 2010 by Martin Kramer and Ingo Lages, i (dot) lages (at) gmx (dot) de
* Adapted for ATmega328 and ATmega644:
* (c) 2010/2017 by Martin Kramer and Ingo Lages, i (dot) lages (at) gmx (dot) de
*/
#ifndef CANIX_H
@@ -30,7 +30,7 @@
* @author Martin Haller
* @date 13.3.2006
*
* @brief enth�lt Funktionen des CANIX Frameworks
* @brief enthaelt Funktionen des CANIX Frameworks
*
* CANIX ist ein Framework, das versucht, alle Gemeinsamkeiten der Firmwares
* zu umspannen. Dazu gehoeren:
View

This file was deleted.

Oops, something went wrong.
View
@@ -13,14 +13,14 @@
#define EDS_START ((uint8_t *) 32)
#define EDS_DATA_START (EDS_START + 2)
#ifdef MCU_atmega32
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega32__)
#define EDS_DATA_END 1023 //0x3ff
#elif MCU_atmega644 //mit doppelter EEPROM- und SRAM-Groesse
#elif defined(__AVR_ATmega644P__) // mit doppelter EEPROM- und SRAM-Groesse
#define EDS_DATA_END 2047 //0x7ff
#endif
#define EDS_END ((uint8_t *) EDS_DATA_END)
// Rueckgabewerte des EDS Routinen:
// Rueckgabewerte der EDS Routinen:
#define EDS_OK 0
#define EDS_NOT_FORMATED 1
#define EDS_INVALID_POINTER 2
View
@@ -63,13 +63,23 @@ void canix_SFP_HMS_handler(const canix_frame *frame)
break;
case HCAN_HMS_DEVICE_TYPE_REQUEST :
answer.data[1] = HCAN_HMS_DEVICE_TYPE_REPLAY;
#if defined (__AVR_ATmega8__)
answer.data[2] = 0;
#elif defined (__AVR_ATmega32__)
answer.data[2] = 1;
#elif defined (__AVR_ATmega644__)
answer.data[2] = 2;
if (SIGNATURE_1 == 0x95 && SIGNATURE_2 == 0x02)
answer.data[2] += 0x10; // µC-Signatur: __AVR_ATmega32__
else if (SIGNATURE_1 == 0x96 && SIGNATURE_2 == 0x0A)
answer.data[2] += 0x20; // µC-Signatur: __AVR_ATmega644P__
else if (SIGNATURE_1 == 0x95 && SIGNATURE_2 == 0x0F)
answer.data[2] += 0x30; // µC-Signatur: __AVR_ATmega328P__
#if defined (__AVR_ATmega32__)
answer.data[2] += 0x01; // compiliert fuer __AVR_ATmega32__
#elif defined (__AVR_ATmega644P__)
answer.data[2] += 0x02;
#elif defined (__AVR_ATmega328P__)
answer.data[2] += 0x03;
#endif
answer.data[3] = eeprom_read_byte((uint8_t *)EEPR_BOARD_TYPE);
answer.size = 4;
canix_frame_send(&answer);
View
@@ -54,41 +54,12 @@
////#include <avr/signal.h>
#include <avr/wdt.h>
#include "chipdef.h"
#include "mcp2515.h"
#include "mcp2515_defs.h"
#include "canix.h"
#include "tools.h"
#ifdef MCU_atmega8
#define SPI_PORT_DDR DDRB
#define SPI_PORT PORTB
#define SPI_MISO 4
#define SPI_MOSI 3
#define SPI_SCK 5
#define SPI_CS_PORT_DDR DDRD
#define SPI_CS_PORT PORTD
#define SPI_CS 3
#elif (MCU_atmega32 || MCU_atmega644)
#define SPI_PORT_DDR DDRB
#define SPI_PORT PORTB
#define SPI_MISO 6
#define SPI_MOSI 5
#define SPI_SCK 7
#define SPI_CS_PORT_DDR DDRB
#define SPI_CS_PORT PORTB
#define SPI_CS 4
#else
#error "NO MCU type defined"
#endif
#define MCP2515_OK (0)
#define MCP2515_FAIL (1)
Oops, something went wrong.

0 comments on commit 9d377d2

Please sign in to comment.