Hot answers tagged

4

There seems to be a common problem with the Atmel ICE being very slow to program using avrdude. It's to do with the programmer seemingly defaulting to a low clock rate for programming. The problem can be resolved by instructing avrdude to run the programmer at a higher speed by adding -B1 to the command line arguments, for example: avrdude -c atmelice_isp -...


2

but I don't know what '\252' means. This is an octal value. It's equal to 2 + 5*8 + 2*8*8 = 170. Another example: '\123' is octal for 3 + 2*8 + 1*8*8 = 83. Next I changed the variable to a char instead of an unsigned char and ran the same print test_var, I got an output of $10 = -86 '\252' 170 is greater than 127, so when represented as a char (which is a ...


2

It’s my understanding that the inputs aren’t very high resistance, as FET inputs would be. With no load, they will pull up to 5 V with a very small current sourcing capability. If the microcontroller pins are set to be outputs, it’s highly likely that they won’t be pulled above 3.3 V. At reset though, the microcontroller pins will be inputs and may pull ...


2

It means that if an input is not driven high or low by an MCU output, the pin has internal structure to pull the input weakly to VCC so it will be at high logic level. This will happen when the MCU is in reset and before IO pin is configured to an output. Or a bug in the code sets the pin accidentally as input. As the datasheet says, it is safe to connect ...


1

See chapter 28.8 of the linked document: The device needs a clock. If yours is set up to use an external clock and you don't provide it, it cannot be programmed. Not even the configuration bits.


1

This design note from TI explains exactly the problem of a noisy signal and the need to add proper hysteresis. It's done of course with an external comparator as @Michael Karas recommends and also solves the multiple-firings on negative input-signal transitions i.e. "contact bounce" problem as outlined by the by @Trevor_G and @Dmitry Grigoryev in ...


1

The OUT instruction takes an address that must be constant at compile time, so if you want to dynamically write to different port addresses at runtime you have two options.... hard code all possible OUT ports and then select which one gets executed at run time use the the normal pointer registers to write to the PORT register using the PORT register's SRAM ...


1

All IO registers are also available as memory mapped. Just use ST instead of OUT, and you can simply load e.g. X register contents from a variable in memory and so X will then point to correct memory address for the port you have chosen with the variable. But do note that OUT and ST have a different base so you need to convert the IO port address to memory ...


Only top voted, non community-wiki answers of a minimum length are eligible