You need to log in to create posts and topics.

Error en registro TIFR del attiny2313. rev 2278

¿El registro TIFR debería de estar inicialmente en ceros?

Cuando subo el programa al attiny2313, el osiloscopio no produce una señal PWM. Tampoco el led alterna de encendido  a apagado.

Pero al subir este mismo programa "físicamente" al attiny2313APU el led sí alterna de encendido a apagado.

Yo utilizo linux y avrdude 6.3

Hi, thanks for reporting.
Can you share your code and circuit?

And please use english in this forum.

 

Lazlo_lozla has reacted to this post.
Lazlo_lozla
#include <avr/io.h>

int main(void)
{
    char toggle = 0;

    DDRD |= (1 << PD6); // LED on PD6
    
    TCCR0A = 0x02;      // Clear Timer on Compare Match (CTC) mode
    OCR0A  = 0xFF;      // number to count up to
    TCCR0B = 0x05;      // clock source CLK/1024, start timer

    while(1)
    {
        if (TIFR & 0x01) {      // timer timed out?
            TIFR |= 0x01;       // reset timer flag
            // toggle LED each time the timer times out
            if (toggle) {
                toggle = 0;
                PORTD &= ~(1 << PD6);
            }
            else {
                toggle = 1;
                PORTD |=  (1 << PD6);
            }
        }
    }
}
#makefile attiny2313

AVR         = attiny2313
COMPILE    = avr-gcc -Wall -O3 -mmcu=$(AVR)

SOURCES     = main.c 
OUTPUT_HEX  = main.hex
OBJETCS     = $(patsubst %.c, %.o, $(SOURCES))
OUTPUT_ELF  = $(patsubst %.hex, %.elf, $(OUTPUT_HEX))

all: $(OUTPUT_HEX)

%.o: %.c
	$(COMPILE) -c $<

$(OUTPUT_HEX): $(OBJETCS)
	$(COMPILE) $^ -o $(OUTPUT_ELF)
	avr-objcopy -O ihex $(OUTPUT_ELF) $@

clean:
	rm -f *.o *.elf *.hex

 

When I load the program  C into the attiny2313APU. LED toggle.
I don't have an osiloscope. But doing the math with an OC0RA of 255 the result is 1.92 Hz

Thanks for all the information.

Seems that this issue is alredy solved in development version.
This fix will be included in next "tester builds" for 1.1.0.
Have a look here for an update in next days:
https://simulide.com/p/testers/

Lazlo_lozla has reacted to this post.
Lazlo_lozla