[avr-gcc-list] Blink period shorter than expected

2013-12-01 Thread dfx
I made ​​a very simple circuit for LED to blink. The code is as follows: # include # define F_CPU 2000UL # include int main (void) { DDRB | = _BV (DDB0); while (1) { PORTB ^ = _BV (PB0); _delay_ms (1); } } The processor is an ATMEGA324PA with clock = 20 MHz. The fuses are: lfuse = 0

[avr-gcc-list] different behavior on port A and port C

2013-12-07 Thread dfx
I have a simple program for ATmega324PA: #include #define F_CPU 2000UL #include int main (void) { DDRA = 0xFF; while (1) { _delay_ms (1); PORTA = 0X00; _delay_ms (1); PORTA = 0XFF; } that on Port A works perfectly and generates a square wave on all pins. The sam

[avr-gcc-list] My program doesn't recognize MCUCR

2013-12-12 Thread dfx
Hi, My program does'n recognize MCUCR and JTD. #include #include #include #include #include "lcd_lib.h" MCUCR = (1 << JTD); // ERROR on MCUCR and JTD What is missed? Thank you. Domenico --- Questa e-mail è priva di virus e malware perché è attiva la protezione avast! Antivirus.

[avr-gcc-list] Some people use Netbeans to develop AVR-GCC?

2013-12-12 Thread dfx
I would like to use Netbeans to develop AVR-GCC but I had just started a small problem. I created a new Netbeans project using source code for atmega324pa already successfully developed previously. The editor of Netbeans correctly recognize all symbols except two: MCUCR and JTD. Has anyone encou

[avr-gcc-list] How to initialize an array of struct?

2013-12-14 Thread dfx
Hi, After spending more than one day to create an array of struct I have come to this code: struct Lamp { uint8_t highAddress [9] ; uint8_t lowAddress [9] ; uint8_t onoff ; uint8_t active ; uint8_t power; uint8_t brightness ; uint8_t temperatures ; uint8_t faultCount ; } ; stru

[avr-gcc-list] How to initialize an array of struct?

2013-12-14 Thread dfx
Hi, After spending more than one day to create an array of struct I have come to this code: struct Lamp { uint8_t highAddress [9] ; uint8_t lowAddress [9] ; uint8_t onoff ; uint8_t active ; uint8_t power; uint8_t brightness ; uint8_t temperatures ; uint8_t faultCount ;

[avr-gcc-list] Problem with handling interrupts

2014-01-14 Thread dfx
Hello, my problem is the following: suppose we have 8 keys all connected to the same port (for. eg. D) of an AVR processor (eg. ATmega324) and that all pins have the interrupt enabled. If I understand correctly, when I press any key is called the same ISR (PCINT3_vect) and a single flag is set

[avr-gcc-list] Simple but wrong code

2014-01-14 Thread dfx
Please consider this code: #define KEY_PORT PORTD #define KEY_DDR DDRD #define KEY_FUNC_SEL PIND4 // --> first key (Port D pin 4) #define LED_PORT PORTB // Test led, to see action on keypress #define FUNC_SEL_KEY 0x10 // First function --> first key (Port D pin 4) int main() {

Re: [avr-gcc-list] Simple but wrong code

2014-01-14 Thread dfx
x todd.batz...@millerwelds.com www.millerwelds.com Please consider the environment before printing this email. -Original Message- From: avr-gcc-list-bounces+tbatzl=millerwelds@nongnu.org [mailto:avr-gcc-list-bounces+tbatzl=millerwelds@nongnu.org] On Behalf Of dfx Sent: Tuesday, January

Re: [avr-gcc-list] Simple but wrong code

2014-01-15 Thread dfx
7075929 Il 15/01/2014 02:18, Pink Boy ha scritto: dfx see notes below. // #define KEY_FUNC_SEL PIND4 // --> first key (Port D pin 4) // in WinAvr PIND4 is a bit position and is equal to 4 #define KEY_FUNC_SEL (1< // PORTD is the output register for PORTD. To read the port pin state you n

[avr-gcc-list] Location of symbol definition

2014-01-26 Thread dfx
Hi, often in code written by 'gurus' I find expressions of the type # if defined (__AVR_ATmega168__), but looking at the code I can not find the definition anywhere. The question is: where these symbols (with double underscore) are defined? thank you very much -- Domenico --- Questa e-mail

[avr-gcc-list] Editor for binary files

2014-02-02 Thread dfx
Hi, I need an editor that allows to create / edit binary files. Basically I need an editor that by typing 0 and 3 shall not enter two characters 0x30 and 0x33 but only one byte 0x03. Could I have some suggestions? Thank you very much. -- Domenico --- Questa e-mail è priva di virus e malwar