Autor Tema: Llegó la hora: comienzo con ARM  (Leído 34526 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado elgarbe

  • Moderador Local
  • PIC24H
  • *****
  • Mensajes: 2178
Re: Llegó la hora: comienzo con ARM
« Respuesta #75 en: 09 de Febrero de 2014, 20:54:06 »
no me anda... reinstale y nada... es como que no enviara nada por el puerto serie virtual. incluso si abro un hyperterminal tampoco veo tráfico... ya veré si a alguien mas le pasa o si prueno en otra PC...

Saludos!
-
Leonardo Garberoglio

Desconectado skormel

  • PIC12
  • **
  • Mensajes: 50
    • Chaputronia
Re: Llegó la hora: comienzo con ARM
« Respuesta #76 en: 09 de Febrero de 2014, 21:36:23 »
no me anda... reinstale y nada... es como que no enviara nada por el puerto serie virtual. incluso si abro un hyperterminal tampoco veo tráfico... ya veré si a alguien mas le pasa o si prueno en otra PC...

Saludos!

Prueba a ver si puedes ver algo con la aplicación TExaSdisplay funciona muy bien.

Desconectado elgarbe

  • Moderador Local
  • PIC24H
  • *****
  • Mensajes: 2178
Re: Llegó la hora: comienzo con ARM
« Respuesta #77 en: 13 de Febrero de 2014, 13:06:36 »
miren lo que trajo hoy el correo:



aguante texas!!!! ahora si no hat dudas, a terminar el curso cueste lo que cueste!

Saludos
-
Leonardo Garberoglio

Desconectado morelius21

  • PIC12
  • **
  • Mensajes: 55
Re: Llegó la hora: comienzo con ARM
« Respuesta #78 en: 26 de Febrero de 2014, 09:48:26 »
Hola,

Yo estoy en el lab 5 y ya he realizado el lab 5 con el simulador. Ahora no paso del real board Grade.

A ver si resuelvo unas dudas:

1.Tengo el programa de calcular el rectángulo, este es el que cargo al micro?

2.Compilo y grabo soft en micro.
Entonces pongo que el debbuger sea para el board y no simulador. Le doy a simular.
 Me sale a la derecha el texas grader v2.0 y donde pone numfromedx pongo el numero del lab que me sale en la web.
A partir de aki me quedo encallado pq le doy a run a grade y no me devuelve nada. Si lo hago por la ventanita que sale el dibujo del pin me sale que bien pero el código no es correcto

Alguien me puede indicar como hacerlo. Estoy seguro que no es complicado  :D

Saludos y muchas gracias,

Desconectado Nocturno

  • Administrador
  • DsPIC33
  • *******
  • Mensajes: 18310
    • MicroPIC
Re: Llegó la hora: comienzo con ARM
« Respuesta #79 en: 26 de Febrero de 2014, 15:46:55 »
Tienes que hacer click en el check box llamado "Grade", en la parte inferior de la ventana Texas Grader.
No hace falta que le des a RUN; ya lo hace él solito.
Y déjale trabajar, tardará un poco.

Desconectado morelius21

  • PIC12
  • **
  • Mensajes: 55
Re: Llegó la hora: comienzo con ARM
« Respuesta #80 en: 05 de Marzo de 2014, 11:03:13 »
Hola Nocturno,

Primero agradecer tu ayuda, por fin pude hacerlo.

Ahora estoy con el lab8 y no paso la prueba del simulador: Todo va bien hasta que llego al PAso 3 del Grader donde pone:

3) Switch not pressed test, LED should be on :
   Fail: LED should be on when switch is not pressed

no entiendo pq no lo paso. Adjunto mi programa a ver si alguien me puede hechar una mano.

Por ultimo, cuando simulo en el Realboard me da 100 puntos. No se, no lo entiendo.

Saludos y muchas gracias

Código: [Seleccionar]
// ***** 0. Documentation Section *****
// SwitchLEDInterface.c for Lab 8
// Runs on LM4F120/TM4C123
// Use simple programming structures in C to toggle an LED
// while a button is pressed and turn the LED on when the
// button is released.  This lab requires external hardware
// to be wired to the LaunchPad using the prototyping board.
// January 11, 2014

// Lab 8
//      Jon Valvano and Ramesh Yerraballi
//      November 21, 2013

// ***** 1. Pre-processor Directives Section *****
#include "TExaS.h"
#include "tm4c123gh6pm.h"

// ***** 2. Global Declarations Section *****

// FUNCTION PROTOTYPES: Each subroutine defined
void DisableInterrupts(void); // Disable interrupts
void EnableInterrupts(void);  // Enable interrupts
void PortE_Init(void); //PortE initaliza
void delay(unsigned long halfsecs);

// ***** 3. Subroutines Section *****

// PE0, PB0, or PA2 connected to positive logic momentary switch using 10 k ohm pull down resistor
// PE1, PB1, or PA3 connected to positive logic LED through 470 ohm current limiting resistor
// To avoid damaging your hardware, ensure that your circuits match the schematic
// shown in Lab8_artist.sch (PCB Artist schematic file) or
// Lab8_artist.pdf (compatible with many various readers like Adobe Acrobat).
//GLobal Variables

unsigned long in,out;

int main(void){
//**********************************************************************
// The following version tests input on PE0 and output on PE1
//**********************************************************************
  TExaS_Init(SW_PIN_PE0, LED_PIN_PE1);  // activate grader and set system clock to 80 MHz
  EnableInterrupts();           // enable interrupts for the grader
PortE_Init();

  while(1){


in=(GPIO_PORTE_DATA_R & 0x01);

if (in== 0x00){
GPIO_PORTE_DATA_R=0x02;

}
else{
GPIO_PORTE_DATA_R^=0x02;
delay(1);
}
  }
}


void PortE_Init(void){ unsigned long volatile delay;
  SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOE;           // Port E clock
  delay = SYSCTL_RCGC2_R;           // wait 3-5 bus cycles
  GPIO_PORTE_DIR_R |= 0x02;         // PE1 output
  GPIO_PORTE_DIR_R &= ~0x01;        // PE0 input
  GPIO_PORTE_AFSEL_R &= ~0x03;      // not alternative
  GPIO_PORTE_AMSEL_R &= ~0x03;      // no analog
  GPIO_PORTE_PCTL_R &= ~0x0000F00F; // bits for PD3, PD0
  GPIO_PORTE_DEN_R |= 0x03;         // enable PE1, PE0
  }


// Subroutine to delay in units of half seconds
// We will make a precise estimate later:
//   For now we assume it takes 1/2 sec to count down
//   from 2,000,000 down to zero
// Inputs: Number of half seconds to delay
// Outputs: None
// Notes: ...

void delay(unsigned long halfsecs){
  unsigned long count;
  
  while(halfsecs > 0 ) { // repeat while there are still halfsecs to delay
    count = 1538460; // 400000*0.5/0.13 that it takes 0.13 sec to count down to zero
    while (count > 0) {
      count--;
    } // This while loop takes approximately 3 cycles
    halfsecs--;
  }
}

« Última modificación: 05 de Marzo de 2014, 12:44:54 por morelius21 »

Desconectado skormel

  • PIC12
  • **
  • Mensajes: 50
    • Chaputronia
Re: Llegó la hora: comienzo con ARM
« Respuesta #81 en: 06 de Marzo de 2014, 18:18:44 »
Hola Nocturno,

Primero agradecer tu ayuda, por fin pude hacerlo.

Ahora estoy con el lab8 y no paso la prueba del simulador: Todo va bien hasta que llego al PAso 3 del Grader donde pone:

3) Switch not pressed test, LED should be on :
   Fail: LED should be on when switch is not pressed

no entiendo pq no lo paso. Adjunto mi programa a ver si alguien me puede hechar una mano.

Por ultimo, cuando simulo en el Realboard me da 100 puntos. No se, no lo entiendo.

Saludos y muchas gracias

Código: [Seleccionar]
// ***** 0. Documentation Section *****
// SwitchLEDInterface.c for Lab 8
// Runs on LM4F120/TM4C123
// Use simple programming structures in C to toggle an LED
// while a button is pressed and turn the LED on when the
// button is released.  This lab requires external hardware
// to be wired to the LaunchPad using the prototyping board.
// January 11, 2014

// Lab 8
//      Jon Valvano and Ramesh Yerraballi
//      November 21, 2013

// ***** 1. Pre-processor Directives Section *****
#include "TExaS.h"
#include "tm4c123gh6pm.h"

// ***** 2. Global Declarations Section *****

// FUNCTION PROTOTYPES: Each subroutine defined
void DisableInterrupts(void); // Disable interrupts
void EnableInterrupts(void);  // Enable interrupts
void PortE_Init(void); //PortE initaliza
void delay(unsigned long halfsecs);

// ***** 3. Subroutines Section *****

// PE0, PB0, or PA2 connected to positive logic momentary switch using 10 k ohm pull down resistor
// PE1, PB1, or PA3 connected to positive logic LED through 470 ohm current limiting resistor
// To avoid damaging your hardware, ensure that your circuits match the schematic
// shown in Lab8_artist.sch (PCB Artist schematic file) or
// Lab8_artist.pdf (compatible with many various readers like Adobe Acrobat).
//GLobal Variables

unsigned long in,out;

int main(void){
//**********************************************************************
// The following version tests input on PE0 and output on PE1
//**********************************************************************
  TExaS_Init(SW_PIN_PE0, LED_PIN_PE1);  // activate grader and set system clock to 80 MHz
  EnableInterrupts();           // enable interrupts for the grader
PortE_Init();

  while(1){


in=(GPIO_PORTE_DATA_R & 0x01);

if (in== 0x00){
GPIO_PORTE_DATA_R=0x02;

}
else{
GPIO_PORTE_DATA_R^=0x02;
delay(1);
}
  }
}


void PortE_Init(void){ unsigned long volatile delay;
  SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOE;           // Port E clock
  delay = SYSCTL_RCGC2_R;           // wait 3-5 bus cycles
  GPIO_PORTE_DIR_R |= 0x02;         // PE1 output
  GPIO_PORTE_DIR_R &= ~0x01;        // PE0 input
  GPIO_PORTE_AFSEL_R &= ~0x03;      // not alternative
  GPIO_PORTE_AMSEL_R &= ~0x03;      // no analog
  GPIO_PORTE_PCTL_R &= ~0x0000F00F; // bits for PD3, PD0
  GPIO_PORTE_DEN_R |= 0x03;         // enable PE1, PE0
  }


// Subroutine to delay in units of half seconds
// We will make a precise estimate later:
//   For now we assume it takes 1/2 sec to count down
//   from 2,000,000 down to zero
// Inputs: Number of half seconds to delay
// Outputs: None
// Notes: ...

void delay(unsigned long halfsecs){
  unsigned long count;
 
  while(halfsecs > 0 ) { // repeat while there are still halfsecs to delay
    count = 1538460; // 400000*0.5/0.13 that it takes 0.13 sec to count down to zero
    while (count > 0) {
      count--;
    } // This while loop takes approximately 3 cycles
    halfsecs--;
  }
}


Buenas, prueba con este delay a ver que tal.


Código: [Seleccionar]
void delay100ms(){
 unsigned long volatile time;
 time = 905452;
 while(time){
 time--;
 }
}

Desconectado morelius21

  • PIC12
  • **
  • Mensajes: 55
Re: Llegó la hora: comienzo con ARM
« Respuesta #82 en: 06 de Marzo de 2014, 18:29:46 »
Hola Skormel,

Cambie la función de delay como me dijiste y al hacer el grade de simulador otra vez lo mismo. Lo curioso es que lo hago sin activar el grade pero usando su interface  y funciona.  :(

Bueno seguiré para adelante que haremos.

Saludos y gracias

Desconectado skormel

  • PIC12
  • **
  • Mensajes: 50
    • Chaputronia
Re: Llegó la hora: comienzo con ARM
« Respuesta #83 en: 06 de Marzo de 2014, 18:50:10 »
Hola Skormel,

Cambie la función de delay como me dijiste y al hacer el grade de simulador otra vez lo mismo. Lo curioso es que lo hago sin activar el grade pero usando su interface  y funciona.  :(

Bueno seguiré para adelante que haremos.

Saludos y gracias


Utiliza mi código a ver que tal

Código: [Seleccionar]
// ***** 0. Documentation Section *****
// SwitchLEDInterface.c for Lab 8
// Runs on LM4F120/TM4C123
// Use simple programming structures in C to toggle an LED
// while a button is pressed and turn the LED on when the
// button is released.  This lab requires external hardware
// to be wired to the LaunchPad using the prototyping board.
// January 11, 2014

// Lab 8
//      Jon Valvano and Ramesh Yerraballi
//      November 21, 2013

// ***** 1. Pre-processor Directives Section *****
#include "TExaS.h"
#include "tm4c123gh6pm.h"

// ***** 2. Global Declarations Section *****

unsigned long in,out;

// FUNCTION PROTOTYPES: Each subroutine defined
void DisableInterrupts(void); // Disable interrupts
void EnableInterrupts(void);  // Enable interrupts
void delayms(unsigned long halfsecs);
//void delay(unsigned long halfsecs);

// ***** 3. Subroutines Section *****

// PE0, PB0, or PA2 connected to positive logic momentary switch using 10 k ohm pull down resistor
// PE1, PB1, or PA3 connected to positive logic LED through 470 ohm current limiting resistor
// To avoid damaging your hardware, ensure that your circuits match the schematic
// shown in Lab8_artist.sch (PCB Artist schematic file) or
// Lab8_artist.pdf (compatible with many various readers like Adobe Acrobat).
int main(void){
unsigned long volatile delay;
//**********************************************************************
// The following version tests input on PE0 and output on PE1
//**********************************************************************
  TExaS_Init(SW_PIN_PE0, LED_PIN_PE1);  // activate grader and set system clock to 80 MHz
 

  EnableInterrupts();           // enable interrupts for the grader

SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOE;           // Port E clock
  delay = SYSCTL_RCGC2_R;           // wait 3-5 bus cycles
  GPIO_PORTE_DIR_R |= 0x02;         // PE1 output
  GPIO_PORTE_DIR_R &= ~0x01;        // PE0 input
  GPIO_PORTE_AFSEL_R &= ~0x03;      // not alternative
  GPIO_PORTE_AMSEL_R &= ~0x03;      // no analog
  GPIO_PORTE_PCTL_R &= ~0x0000F00F; // bits for PD3, PD0
  GPIO_PORTE_DEN_R |= 0x03;         // enable PE1, PE0

GPIO_PORTE_DATA_R=0x02;

  while(1){

in=(GPIO_PORTE_DATA_R & 0x01);

if (in== 0x00){
GPIO_PORTE_DATA_R=0x02;
}
else{
  delayms(100);
GPIO_PORTE_DATA_R^=0x02;
}
  }
 
}


void delayms(unsigned long halfsecs){
 unsigned long volatile time;
 //time = 145452; // 0.1sec
 time = 905452;
 while(time){
 time--;
 }
}


Desconectado Nocturno

  • Administrador
  • DsPIC33
  • *******
  • Mensajes: 18310
    • MicroPIC
Re: Llegó la hora: comienzo con ARM
« Respuesta #84 en: 07 de Marzo de 2014, 16:20:07 »
Morelius, si al primer código que subiste le cambias 1538460 por 1333333 te ejecuta la graduación hasta el 100%.
El problema era que el delay estaba puesto muy lento y no se conseguían las pausas de 100ms.

Desconectado morelius21

  • PIC12
  • **
  • Mensajes: 55
Re: Llegó la hora: comienzo con ARM
« Respuesta #85 en: 08 de Marzo de 2014, 11:06:38 »
Hola a todos,

Gracias de veras por vuestros esfuerzos estoy muy agradecido(Skormel y Nocturno). Como soy novato, a veces me quedo estancado con cosas simples.

Bueno todo perfecto,

Ya voy por el capítulo 10 y estoy disfrutando como un niño.

SAludos y gracias otra vez.

Desconectado Nocturno

  • Administrador
  • DsPIC33
  • *******
  • Mensajes: 18310
    • MicroPIC
Re: Llegó la hora: comienzo con ARM
« Respuesta #86 en: 14 de Marzo de 2014, 16:06:04 »
¿Sabéis si le pasa algo al curso?, llevo días con el capítulo 11 terminado y no publican el 12.

Desconectado skormel

  • PIC12
  • **
  • Mensajes: 50
    • Chaputronia
Re: Llegó la hora: comienzo con ARM
« Respuesta #87 en: 14 de Marzo de 2014, 18:04:41 »
Supongo que habrá que esperar. Yo aún voy por el 10 ( últimamente ando con mucho lío y apenas llego para terminarlos a tiempo)

Desconectado skormel

  • PIC12
  • **
  • Mensajes: 50
    • Chaputronia
Re: Llegó la hora: comienzo con ARM
« Respuesta #88 en: 20 de Marzo de 2014, 16:26:01 »
En el tema "C10 Finite State maquine" hay un quiz que me tiene descolocado, a ver si me podéis echar una mano.

Citar
SYSTICK_WAIT  (1 point possible)
Assume we are calling SysTick_Wait as defined in Program 10.2. The bus period is 12.5 ns (80 MHz). What is the longest delay in seconds that we can create by calling this function just once?



Teniendo en cuenta que el tipo de variable que se le pasa a SysTick_Wait es un unsigned long, estamos hablando de una variable de 32bits por tanto el mayor número que podemos obtener es 2^32 = 4294967296  con lo que el rango de valores es 0 a 4294967295.

Por tanto si cada sentencia consume 12.5ns y le pasamos el mayor número posible 12.5 * 10^(-9) * 4294967295 = 53.68 seg. Sin embargo el sistema me lo da como erróneo.

¿En qué me equivoco?

Un saludo.


Desconectado acabello

  • PIC10
  • *
  • Mensajes: 18
Re: Llegó la hora: comienzo con ARM
« Respuesta #89 en: 20 de Marzo de 2014, 20:49:36 »
El registo RELOAD del SysTick solo permite 24 bit, por lo que 2^24=16777216  y el delay máximo 12.5n*16777216=0.2097s


 

anything