Прошу выложить простейший проект для Atmega128 сделанный в Embedded Workbench Kickstart 6.0 или совместимом поскольку моя атмега на новой макетной плате не заводится(
Что есть:
на ~PEN, ~RESET подаю 5В, у обоих ножек питания поставил 0,082 мкФ(.1 нету), кварц пробовал ставить - 8 МГц, 22 pF, сейчас, после долгих попыток помянть фуз биты и источник тактирования чтобы завестись, ничего не стоит(фузы настоил на внутренний кварц)
Программа простейшая для проверки на работоспособность
Цитата
/**************************************************
*
* This is a LED chaser example program for the AVR
* STK500 starter kit evaluation board. This program
* works for all AVRs.
*
* Description:
* This program will turn on the User LEDs one at
* a time and circulate this procedure in a forever
* loop.
*
* Copyright 1996-2005,2008 IAR Systems AB. All rights reserved.
*
* $Revision: 6759 $
*
**************************************************/
/* Include I/O definition file */
#include <ioavr.h>
#include <intrinsics.h>
void init()
{
// OSC
//OSCCAL = 0x00;
//XDIV = 0x00;
// ports
PORTC &= ~0x0F;
//PORTE &= ~0x04;
PORTB &= ~0x30;
PORTA &= ~0x01;
DDRC &= ~0x0F;
DDRA &= ~0x01;
DDRE |= 0x04; // PE2 output
DDRB &= ~0x30; // PB4, PB5 output
//DDRE |= 0x70;// PE4, PE5, PE6 - extenal int
// ADC
ADMUX = 0x40;
ADCSRA = 0x01;
// 16 bit timer
// clock source
/*// timer interrupts
TIMSK =
EIMSK =
*/
// external interrupts
//ADMUX
}
int main( void )
{
//init();
DDRE |= 0x04; // PE2 output
PORTE |= 0x04;
DDRC = 0xFF;
PORTC = 0xFF;
/*unsigned char led;
PORTB = 0xFF; // Give PORTB and the User LEDs an initial startvalue
led = 1; // Start with LED0
DDRB = 0xFF; // Set PORTB as output
*/
while(1) // Eternal loop
{
PORTE |= 0x04;
/* PORTB = ~led; // Invert the output since a zero means: LED on
led <<= 1; // Move to next LED by performing a rotate left
if (!led)
{
led = 1; // If overflow: start with LED0 again
}
__delay_cycles(500000); // Wait for 500 000 cycles
*/
}
}
*
* This is a LED chaser example program for the AVR
* STK500 starter kit evaluation board. This program
* works for all AVRs.
*
* Description:
* This program will turn on the User LEDs one at
* a time and circulate this procedure in a forever
* loop.
*
* Copyright 1996-2005,2008 IAR Systems AB. All rights reserved.
*
* $Revision: 6759 $
*
**************************************************/
/* Include I/O definition file */
#include <ioavr.h>
#include <intrinsics.h>
void init()
{
// OSC
//OSCCAL = 0x00;
//XDIV = 0x00;
// ports
PORTC &= ~0x0F;
//PORTE &= ~0x04;
PORTB &= ~0x30;
PORTA &= ~0x01;
DDRC &= ~0x0F;
DDRA &= ~0x01;
DDRE |= 0x04; // PE2 output
DDRB &= ~0x30; // PB4, PB5 output
//DDRE |= 0x70;// PE4, PE5, PE6 - extenal int
// ADC
ADMUX = 0x40;
ADCSRA = 0x01;
// 16 bit timer
// clock source
/*// timer interrupts
TIMSK =
EIMSK =
*/
// external interrupts
//ADMUX
}
int main( void )
{
//init();
DDRE |= 0x04; // PE2 output
PORTE |= 0x04;
DDRC = 0xFF;
PORTC = 0xFF;
/*unsigned char led;
PORTB = 0xFF; // Give PORTB and the User LEDs an initial startvalue
led = 1; // Start with LED0
DDRB = 0xFF; // Set PORTB as output
*/
while(1) // Eternal loop
{
PORTE |= 0x04;
/* PORTB = ~led; // Invert the output since a zero means: LED on
led <<= 1; // Move to next LED by performing a rotate left
if (!led)
{
led = 1; // If overflow: start with LED0 again
}
__delay_cycles(500000); // Wait for 500 000 cycles
*/
}
}
Файл линковки подтягивается по умолчанию - cfgm128.xml
На симуляторе в Иаре последовательсность испольнения и записи в регистры правильная
Но ничего не работает, а менно на обоих партах 0 на выходе....
Прошу выложить по возможность свой рабочий просейший проект с портами для того чтобы я смог проверить работоспособность моей меге
В приложении фузы.
Заранее благодарен