Gast
#726815
Hallo Zusammen
Ich möchte mit einem Atmel EVA-Board einen Kabeltest realisieren. Dazu
setze ich einen Ausganh auf high und überprüfe ob es auf dem richtigen
Eingang rauskommt. Wollte dafür das STK500 nehmen. Zur Überprüfung der
SW habe ich das ganze mit enem ATmega 128 und dem STK501 laufen lassen.
Ohne Probleme.Jetzt will ich das ganze auf einem Atmega 8515 laufen
lassen um kein 501 verwenden zu müssen. Nur leider läuft es nicht. Dabei
ist das Einzige was ich geändert habe die Initialisierung.
Von
#include "Kabeltest.h"
#include <stdio.h>
#include <iom128v.h>
#include <macros.h>
#include <math.h>
void port_init(void)
{
PORTA = 0x00;
DDRA = 0xFF;
PORTB = 0x00;
DDRB = 0x00;
PORTC = 0x00; //m103 output only
DDRC = 0x00;
PORTD = 0x00;
DDRD = 0x00;
PORTE = 0x00;
DDRE = 0xFF;
PORTF = 0x00;
DDRF = 0x00;
PORTG = 0x00;
DDRG = 0x00;
}
//call this routine to initialize all peripherals
void init_devices(void)
{
//stop errant interrupts until set up
CLI(); //disable all interrupts
XDIV = 0x00; //xtal divider
XMCRA = 0x00; //external memory
port_init();
MCUCR = 0x00;
EICRA = 0x00; //extended ext ints
EICRB = 0x00; //extended ext ints
EIMSK = 0x00;
TIMSK = 0x00; //timer interrupt sources
ETIMSK = 0x00; //extended timer interrupt sources
SEI(); //re-enable interrupts
//all peripherals are now initialized
}
auf
#include "Kabeltest.h"
#include <stdio.h>
#include <iom8515v.h>
#include <macros.h>
#include <math.h>
void port_init(void)
{
PORTA = 0x00;
DDRA = 0xFF;
PORTB = 0x00;
DDRB = 0x00;
PORTC = 0x00;
DDRC = 0x00;
PORTD = 0x00;
DDRD = 0x00;
PORTE = 0x00;
DDRE = 0x03;
}
//call this routine to initialize all peripherals
void init_devices(void)
{
//stop errant interrupts until set up
CLI(); //disable all interrupts
port_init();
MCUCR = 0x00;
EMCUCR = 0x00;
GICR = 0x00;
TIMSK = 0x00;
SEI(); //re-enable interrupts
//all peripherals are now initialized
}
Habe schon überprüft ob die Include 8515 falsche Adressen für die Ports
gespeichert hat. Dies war aber nicht der Fall.
Hat jemand ne Ahnung was ich noch falsch gemacht haben könnte?
Gruß Mike