Commit a230f87e authored by Martin Enriquez's avatar Martin Enriquez

Acknoliy de prueba funciono correctamente.

parent a7a9e839
*** SESSION nov. 30, 2015 11:22:04.27 ------------------------------------------
*** SESSION nov. 30, 2015 11:43:54.78 ------------------------------------------
*** SESSION nov. 30, 2015 15:59:02.12 ------------------------------------------
*** SESSION dic. 01, 2015 17:12:51.31 ------------------------------------------
16:46:04 **** Incremental Build of configuration Release for project Remoto-con-8 ****
17:41:35 **** Incremental Build of configuration Release for project Remoto-con-8 ****
make all
Building file: ../main.c
Invoking: AVR Compiler
......@@ -28,7 +28,7 @@ AVR Memory Usage
----------------
Device: atmega8
Program: 1514 bytes (18.5% Full)
Program: 1530 bytes (18.7% Full)
(.text + .data + .bootloader)
Data: 14 bytes (1.4% Full)
......@@ -38,5 +38,5 @@ Data: 14 bytes (1.4% Full)
Finished building: sizedummy
16:46:05 Build Finished (took 143ms)
17:41:36 Build Finished (took 161ms)
16:48:22 **** Incremental Build of configuration Release for project modulo_on_off ****
17:43:41 **** Incremental Build of configuration Release for project modulo_luces ****
make all
Building file: ../main.c
Invoking: AVR Compiler
avr-gcc -Wall -Os -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -std=gnu99 -funsigned-char -funsigned-bitfields -mmcu=atmega8 -DF_CPU=8000000UL -MMD -MP -MF"main.d" -MT"main.o" -c -o "main.o" "../main.c"
Finished building: ../main.c
Building target: modulo_on_off.elf
Invoking: AVR C Linker
avr-gcc -Wl,-Map,modulo_on_off.map -mmcu=atmega8 -o "modulo_on_off.elf" ./main.o ./mcu.o ./nrf24l01.o
Finished building target: modulo_on_off.elf
Invoking: AVR Create Extended Listing
avr-objdump -h -S modulo_on_off.elf >"modulo_on_off.lss"
Finished building: modulo_on_off.lss
Create Flash image (ihex format)
avr-objcopy -R .eeprom -R .fuse -R .lock -R .signature -O ihex modulo_on_off.elf "modulo_on_off.hex"
Finished building: modulo_on_off.hex
Create eeprom image (ihex format)
avr-objcopy -j .eeprom --no-change-warnings --change-section-lma .eeprom=0 -O ihex modulo_on_off.elf "modulo_on_off.eep"
Finished building: modulo_on_off.eep
Invoking: Print Size
avr-size --format=avr --mcu=atmega8 modulo_on_off.elf
avr-size --format=avr --mcu=atmega8 modulo_luces.elf
AVR Memory Usage
----------------
Device: atmega8
Program: 1348 bytes (16.5% Full)
Program: 1484 bytes (18.1% Full)
(.text + .data + .bootloader)
Data: 15 bytes (1.5% Full)
Data: 19 bytes (1.9% Full)
(.data + .bss + .noinit)
......
11:56:24 **** Incremental Build of configuration Release for project modulo_luces ****
17:43:41 **** Incremental Build of configuration Release for project modulo_luces ****
make all
Invoking: Print Size
avr-size --format=avr --mcu=atmega8 modulo_luces.elf
......@@ -6,15 +6,15 @@ AVR Memory Usage
----------------
Device: atmega8
Program: 1374 bytes (16.8% Full)
Program: 1484 bytes (18.1% Full)
(.text + .data + .bootloader)
Data: 18 bytes (1.8% Full)
Data: 19 bytes (1.9% Full)
(.data + .bss + .noinit)
Finished building: sizedummy
11:56:25 Build Finished (took 163ms)
17:43:41 Build Finished (took 121ms)
/*
* main.c
*
* Created on: 5/2/2015
* Author: Mart�n
*/
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include "nrf24l01.h"
#include "mcu.h"
#include "hardware.h"
#include "comunicacion.h"
volatile unsigned char luces = 0, duty = 255, duty_ant = 250, cambiar_duty = 0, reportar = 0;
volatile unsigned char tmr0_ovf = 0;
uint8_t *data;
int main(void)
{
init_megazord();
while(1)
{
if (demora_tx >= 20)
{
reset();
Modo_RX();
CE = 1;
demora_tx = 0;
}
if(reportar)
{
Modo_TX();
data[1] = luces? LUCES_ON : LUCES_OFF;
transmit_payload(data);
reportar = 0;
Modo_RX();
}
}
return 0;
}
ISR(INT0_vect)
{
cli();
CE = 0; // CE bajo
data = WriteToNrf(R, R_RX_PAYLOAD, data, dataLen); //Leo el mensaje
switch(data[1])
{
case LUCES_TOGGLE:
if(luces)
{
LED = 1;
duty_ant = duty;
duty = 255;
luces = 0;
}
else
{
LED = 0;
duty = duty_ant;
luces = 1;
}
// Probando solo con el led onboard
LED ^= 1; //Toggle
reportar = 1;
break;
case LUCES_AUMENTAR:
if(duty <= 230)
duty = duty + 25;
duty_ant = duty;
break;
case LUCES_DISMINUIR:
if(duty >= 25)
duty = duty - 25;
duty_ant = duty;
break;
default:
break;
}
data[1] = 0;
sei();
CE = 1; // CE alto
}
ISR (TIMER0_OVF_vect)
{
TCNT0 = 55; // Desborda cada 200us
tmr0_ovf++;
if(tmr0_ovf == 5)
{
//Pas� 1ms
tmr0_ovf = 0;
demora_tx++;
tiempo_tx++;
}
}
ISR (TIMER1_OVF_vect)
{
OCR1A = duty;
}
/*
* main.c
*
* Created on: 5/2/2015
* Author: Mart�n
*/
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include "nrf24l01.h"
#include "mcu.h"
#include "hardware.h"
#include "comunicacion.h"
volatile unsigned char luces = 0, duty = 255, duty_ant = 250, cambiar_duty = 0, reportar = 0;
volatile unsigned char tmr0_ovf = 0;
uint8_t *data;
int main(void)
{
init_megazord();
while(1)
{
if (demora_tx >= 20)
{
reset();
Modo_RX();
CE = 1;
demora_tx = 0;
}
if(reportar)
{
Modo_TX();
data[1] = luces? LUCES_ON : LUCES_OFF;
transmit_payload(data);
reportar = 0;
Modo_RX();
}
}
return 0;
}
ISR(INT0_vect)
{
cli();
CE = 0; // CE bajo
data = WriteToNrf(R, R_RX_PAYLOAD, data, dataLen); //Leo el mensaje
switch(data[1])
{
case LUCES_TOGGLE:
if(luces)
{
LED = 1;
duty_ant = duty;
duty = 255;
luces = 0;
}
else
{
LED = 0;
duty = duty_ant;
luces = 1;
}
// Probando solo con el led onboard
LED ^= 1; //Toggle
reportar = 1;
break;
case LUCES_AUMENTAR:
if(duty <= 230)
duty = duty + 25;
duty_ant = duty;
break;
case LUCES_DISMINUIR:
if(duty >= 25)
duty = duty - 25;
duty_ant = duty;
break;
default:
break;
}
data[1] = 0;
sei();
CE = 1; // CE alto
}
ISR (TIMER0_OVF_vect)
{
TCNT0 = 55; // Desborda cada 200us
tmr0_ovf++;
if(tmr0_ovf == 5)
{
//Pas� 1ms
tmr0_ovf = 0;
demora_tx++;
tiempo_tx++;
}
}
ISR (TIMER1_OVF_vect)
{
OCR1A = duty;
}
/*
* main.c
*
* Created on: 5/2/2015
* Author: Mart�n
*/
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include "nrf24l01.h"
#include "mcu.h"
#include "hardware.h"
#include "comunicacion.h"
volatile unsigned char luces = 0, duty = 255, duty_ant = 250, cambiar_duty = 0;
volatile unsigned char tmr0_ovf = 0;
uint8_t *data;
int main(void)
{
init_megazord();
while(1)
{
if (demora_tx >= 20)
{
reset();
Modo_RX();
CE = 1;
demora_tx = 0;
}
}
return 0;
}
ISR(INT0_vect)
{
cli();
CE = 0; // CE bajo
data = WriteToNrf(R, R_RX_PAYLOAD, data, dataLen); //Leo el mensaje
switch(data[1])
{
case LUCES_TOGGLE:
if(luces)
{
LED = 1;
duty_ant = duty;
duty = 255;
luces = 0;
}
else
{
LED = 0;
duty = duty_ant;
luces = 1;
}
// Probando solo con el led onboard
LED ^= 1; //Toggle
break;
case LUCES_AUMENTAR:
if(duty <= 230)
duty = duty + 25;
duty_ant = duty;
break;
case LUCES_DISMINUIR:
if(duty >= 25)
duty = duty - 25;
duty_ant = duty;
break;
default:
break;
}
data[1] = 0;
sei();
CE = 1; // CE alto
}
ISR (TIMER0_OVF_vect)
{
TCNT0 = 55; // Desborda cada 200us
tmr0_ovf++;
if(tmr0_ovf == 5)
{
//Pas� 1ms
tmr0_ovf = 0;
demora_tx++;
tiempo_tx++;
}
}
ISR (TIMER1_OVF_vect)
{
OCR1A = duty;
}
/*
* main.c
*
* Created on: 5/2/2015
* Author: Mart�n
*/
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include "nrf24l01.h"
#include "mcu.h"
#include "hardware.h"
#include "comunicacion.h"
volatile unsigned char luces = 0, duty = 255, duty_ant = 250, cambiar_duty = 0, reportar = 0;
volatile unsigned char tmr0_ovf = 0;
uint8_t *data;
int main(void)
{
init_megazord();
while(1)
{
if (demora_tx >= 20)
{
reset();
Modo_RX();
CE = 1;
demora_tx = 0;
}
if(reportar)
{
Modo_TX();
data[1] = luces? LUCES_ON : LUCES_OFF;
transmit_payload(data);
reportar = 0;
Modo_RX();
}
}
return 0;
}
ISR(INT0_vect)
{
cli();
CE = 0; // CE bajo
data = WriteToNrf(R, R_RX_PAYLOAD, data, dataLen); //Leo el mensaje
switch(data[1])
{
case LUCES_TOGGLE:
if(luces)
{
LED = 1;
duty_ant = duty;
duty = 255;
luces = 0;
}
else
{
LED = 0;
duty = duty_ant;
luces = 1;
}
}i
// Probando solo con el led onboard
LED ^= 1; //Toggle
reportar = 1;
break;
case LUCES_AUMENTAR:
if(duty <= 230)
duty = duty + 25;
duty_ant = duty;
break;
case LUCES_DISMINUIR:
if(duty >= 25)
duty = duty - 25;
duty_ant = duty;
break;
default:
break;
}
data[1] = 0;
sei();
CE = 1; // CE alto
}
ISR (TIMER0_OVF_vect)
{
TCNT0 = 55; // Desborda cada 200us
tmr0_ovf++;
if(tmr0_ovf == 5)
{
//Pas� 1ms
tmr0_ovf = 0;
demora_tx++;
tiempo_tx++;
}
}
ISR (TIMER1_OVF_vect)
{
OCR1A = duty;
}
/*
* main.c
*
* Created on: 25/1/2015
* Author: Enr�quez Mart�n | Leandro Lanzieri
*/
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <stdio.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include "nrf24l01.h"
#include "mcu.h"
#include "hardware.h"
#include "comunicacion.h"
uint8_t *data;
volatile boton_t boton;
int main(void)
{
init_megazord();
LED = 1;
int i;
// El mirco est� vivo... EST� VIVOOO! (?)
for(i = 0; i < 6; i++)
{
LED ^= 1; // Toggle LED
_delay_ms(200);
}
Set_frec(FREC_LUCES);
while(1)
{
if (demora_tim1 >= 20)
{
reset();
Modo_RX();
CE = 1;
demora_tim1 = 0;
}
// Como prueba, envio un toggle al rele cada medio segundo
// Para esto elimine la lectura de los botones.
_delay_ms(500);
data[0] = LUCES_TOGGLE;
data[1] = LUCES_TOGGLE;
data[2] = LUCES_TOGGLE;
data[3] = LUCES_TOGGLE;
data[4] = LUCES_TOGGLE;
Modo_TX();
transmit_payload(data);
reset();
demora_tx = 0;
/*
leer_botones();
switch(boton)
{
case LUZ:
Set_frec(FREC_LUCES);
_delay_ms(20);
data[0] = LUCES_TOGGLE;
Modo_TX();
transmit_payload(data);
reset();
demora_tx = 0;
break;
case ENCHUFE:
Set_frec(FREC_ON_OFF);
_delay_ms(20);
data[0] = RELE_TOGGLE;
Modo_TX();
transmit_payload(data);
reset();
demora_tx = 0;
break;
case INCREMENTAR:
LED ^= 1;
Set_frec(FREC_LUCES);
_delay_ms(20);
data[0] = LUCES_AUMENTAR;
Modo_TX();
transmit_payload(data);
reset();
demora_tx = 0;
break;
case DECREMENTAR:
Set_frec(FREC_LUCES);
_delay_ms(20);
data[0] = LUCES_DISMINUIR;
Modo_TX();
transmit_payload(data);
reset();
demora_tx = 0;
break;
case NINGUNO:
default:
break;
}*/
}
return 0;
}
ISR(INT0_vect)
{
cli();
CE = 0; // CE bajo
data = WriteToNrf(R, R_RX_PAYLOAD, data, dataLen); //Leo el mensaje
if(data[1] == LUCES_ON) LED = 1;
if(data[1] == LUCES_OFF) LED = 0;
data[0] = 0;
sei();
CE = 1; // CE alto
}