Follow along with the video below to see how to install our site as a web app on your home screen.
Nota: This feature currently requires accessing the site using the built-in Safari browser.
habria que ver cual es el error que te indica ... seria bueno para que te ayuden .... una captura de pantalla ....Cuando estoy simulando en el simulator de Atmel studio 6.2, me falla la simulacion, creo que es un bug del AStudio, podria alguien decirme como resolver dicha falla por favor...? ...
#define F_CPU 16000000UL
#include <avr/interrupt.h>
#include <util/delay.h>
#include "vgafont.h"
char *text[20] =
{
"## ## #### #### ",
"## ## ## ## ##",
"## ## ## ## ######",
" ### ## ## ## ##",
" # #### ## ##",
" ",
"******************",
"* *",
"* 18 by 19 chars *",
"* video textmode *",
"* for Atmel AVRs *",
"* *",
"* Licensed under *"
"* the GNU GPL *",
"* *",
"* Updates+info: *",
"* jmp.no/vgavr/ *",
"* *",
"* VGA rules! :-D *",
"******************",
};
#define COLUMN(r) SPDR=pgm_read_byte(&font[rowoftext[r]][fontline]);
#define SCANLINES 525
static uint8_t *rowoftext;
static uint8_t fontline=0;
#define VSYNC_LOW_HSYNC_LOW PORTB=0b00000000;
#define VSYNC_HIGH_HSYNC_LOW PORTB=0b00010000;
#define VSYNC_LOW_HSYNC_HIGH PORTB=0b00100000;
#define VSYNC_HIGH_HSYNC_HIGH PORTB=0b00110000;
ISR (TIMER1_COMPA_vect) {
static uint16_t rasterline=0;
static uint8_t textrow=0;
uint8_t lineadd = rasterline&1;
//TCNT0 = 0xC3;
TCNT1 = 0xC3;
if(rasterline <= 2 ) {
VSYNC_LOW_HSYNC_HIGH;
} else {
VSYNC_HIGH_HSYNC_HIGH;
}
rasterline++;
if( rasterline > 48 ) {
COLUMN(0);
COLUMN(1);
COLUMN(2);
COLUMN(3);
COLUMN(4);
COLUMN(5);
COLUMN(6);
COLUMN(7);
COLUMN(8);
COLUMN(9);
COLUMN(10);
COLUMN(11);
COLUMN(12);
COLUMN(13);
COLUMN(14);
COLUMN(15);
COLUMN(16);
COLUMN(17);
COLUMN(18);
fontline += lineadd;
if( fontline >= FONTHEIGHT ) {
fontline=0;
rowoftext = (uint8_t *)text[textrow++];
_delay_us(1);
} else {
_delay_us(2);
}
} else {
_delay_us(24);
}
if(rasterline <= 2 ) {
VSYNC_LOW_HSYNC_LOW;
fontline=0;
textrow=0;
rowoftext = (uint8_t *)text[textrow++];
} else {
VSYNC_HIGH_HSYNC_LOW;
if( rasterline > SCANLINES )
rasterline = textrow = fontline = 0;
}
}
void init_timer() {
TCCR1B |= (1<<WGM12);
TIMSK |= (1<<OCIE1A)|(1<<TOV0);
OCR1A = 510;
TCCR1B |= (1<<CS10);
}
void init_spi() {
SPSR = (1<<SPI2X);
SPCR = (1<<SPE)|(1<<MSTR)|(1<<CPOL)|(1<<CPHA);
}
int main() {
// On the ATmega128:
// PB2: Graphics (via voltage divider to obtain 0.7v max)
// PB4: HSYNC
// PB5: VSYNC
DDRB = 0b00110100;
init_spi();
init_timer();
sei();
//SREG |= 0x80; // set the high-order bit in the status register
// Loop forever
for( ;; ) {}
}
SREG |= 0x80;
Gracias Joaquin Ferrero......intenté poner en la sigiente linea de sei(); un sleep();, y si siguen la simulacion de AStudio6, solo que en ésta nueva linea el simulador falla y NO avanza. Lo que he estado encontrando en internet es que creo que es un bug del AStudio6.
Alguien de ustedes podria darme alguna(s) sugerencias para simular código en C para un AVR, en éste caso para ATMEGA128 Y EL ATMEGA168, por favor......
Necesito simular mi código para corregir las posibles fallas, y por ende programar los AVR's, please......tengo muchos días sin poder avanzar, de antemano les agradezco muchisimo su apoyo, en verdad buena....llevo dias sin poder avanzar...
Ricardo, saludos desde Guadalajara Jalisco México
hola amigo .... yo habri el proyecto original con el atmega 128 ... y la complilacion funcino perfecto ... solo los puntos rojos esos ... la funcion SEI() funciono bien .... no esta el problema alli.... tal vez al cambiar el micro por el 168 ..tendria que publicar su librerias ..... alli esta el errorPor favor, publica un enlace a los comentarios que dices que hablan del error del simulador del Atmel Studio 6.
En cuanto al fallo en tu programa. ¿Si quitas sei(), funciona? Quiero decir que ya sé que las interrupciones no estarán habilitadas, pero entonces entrará en el bucle sin fin. ¿Hace eso: se mete en el bucle y sigue bien?