ATTiny417 LED blinking

General discussion on mikroC PRO for AVR.
Post Reply
Author
Message
HyperUniverse
Posts: 282
Joined: 17 Jun 2009 10:42

ATTiny417 LED blinking

#1 Post by HyperUniverse » 20 Oct 2021 16:26

Hi,

How do I blink an LED on pin_11 PB_5 on attiny417 chip?

More exactly how do I blink it when I receive some command via UART?

There are absolutely no examples for this chip.

I can't figure out even how to set up the pins.

nothing - nada -

Anybody?

Thanks

HyperUniverse
Posts: 282
Joined: 17 Jun 2009 10:42

Re: ATTiny417 LED blinking

#2 Post by HyperUniverse » 21 Oct 2021 10:03

mikroe team,
are there any examples for this type of microprocessor, so I can get a starting point?
any kind of code, it won't matter.

Thanks.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: ATTiny417 LED blinking

#3 Post by filip » 22 Oct 2021 08:19

Hi,

I'm not sure if we have used this MCU before, you can check the chapter 16. PORT - I/O Pin Configuration from the datasheet :
http://ww1.microchip.com/downloads/en/D ... 01901B.pdf

Regards,
Filip.

HyperUniverse
Posts: 282
Joined: 17 Jun 2009 10:42

Re: ATTiny417 LED blinking

#4 Post by HyperUniverse » 22 Oct 2021 09:58

thanks filip, but I've already looked at the datasheet
And the datasheet says:
The I/O pins of the device are controlled by instances of the PORT peripheral registers.
This device has the following instances of the I/O Pin Configuration (PORT): PORTA, PORTB, and PORTC.
But any attempt to write a code including any
PORTA
or
PORTB
or
PORTC
comes with an error as unrecognised
PORTn

The datasheet also says:
Each of the port pins has a corresponding bit in the Data Direction (PORT.DIR) and Data Output Value
(PORT.OUT) registers to enable that pin as an output and to define the output state.
But any attempt to write a code including any
PORT.DIR
or
PORT.OUT
comes with the same kind of error

*******
So, how do I start coding this micro, if the basic blocks are not recognized by the compiler?

I am tempted to believe that this type of microprocessor is NOT supported by the AVR compiler at all.

Regards

hexreader
Posts: 1784
Joined: 27 Jun 2010 12:07
Location: England

Re: ATTiny417 LED blinking

#5 Post by hexreader » 22 Oct 2021 10:22

There is certainly no mikroE hardware support for this obscure chip.

There is no mikroE dev board or mikroE programmer support.

Here is my pathetic attempt at LED blink on all pins, for what it is worth (nothing).
Seems to work on simulator, but no idea if it would work on real hardware.

I see that UART library functions can be selected, but I have no way to test their effectiveness.

I recommend you use a different MCU, or a different tool chain.

Code: Select all

// simple pin test program for obscure, unpopular AVR ATtiny417
// totally untested - no idea what I am doing - wild guesses only

void main() {

    CTRLA = 0;                                                                  // watchdog turned off
    DIR_PORTA = 0xff;                                                           // all output
    DIR_PORTB = 0xff;                                                           // all output
    DIR_PORTC = 0xff;                                                           // all output
    OUT_PORTB = 0;                                                              // all PORTB outputs low to start with

    while(1){
        OUT_PORTA = 0x55;                                                       // LED pattern 1
        OUT_PORTB = 0x55;                                                       // LED pattern 1
        OUT_PORTC = 0x55;                                                       // LED pattern 1
        Delay_ms(500);                                                          // allow time to see LEDs change
        OUT_PORTA = 0xaa;                                                       // LED pattern 2
        OUT_PORTB = 0xaa;                                                       // LED pattern 2
        OUT_PORTC = 0xaa;                                                       // LED pattern 2
        Delay_ms(500);                                                          // allow time to see LEDs change
    }
}
Start every day with a smile...... (get it over with) :)

Post Reply

Return to “mikroC PRO for AVR General”