From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27307 invoked by alias); 14 Oct 2003 17:12:01 -0000 Mailing-List: contact ecos-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@sources.redhat.com Received: (qmail 27257 invoked from network); 14 Oct 2003 17:11:59 -0000 Received: from unknown (HELO vitacom.net.co) (64.86.248.237) by sources.redhat.com with SMTP; 14 Oct 2003 17:11:59 -0000 Received: (qmail 313 invoked by uid 1008); 14 Oct 2003 17:11:54 -0000 Received: from unknown (HELO dns.vitacom.net) (127.0.0.1) by localhost with SMTP; 14 Oct 2003 17:11:54 -0000 Received: (from vpopmail@localhost) by dns.vitacom.net (8.12.8/8.12.8/Submit) id h9EHBsQx000311; Tue, 14 Oct 2003 12:11:54 -0500 Message-Id: <200310141711.h9EHBsQx000311@dns.vitacom.net> X-Authentication-Warning: dns.vitacom.net: vpopmail set sender to transfers@phaber.com using -f From: "Transferencia de Archivos" To: ecos-discuss@sources.redhat.com Date: Tue, 14 Oct 2003 17:12:00 -0000 Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_0_310_1066151513"; charset="iso-8859-1" Subject: [ECOS] eCos and eb40a capture mode X-SW-Source: 2003-10/txt/msg00229.txt.bz2 --=_0_310_1066151513 Content-Type: text/plain; format=flowed; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Content-length: 1023 Im working now on the at91eb40a target of ecos, and I'm using the cvs version of ecos, I have succesfully used ecos for his own things, until now. I have now to read an external pwm signal and I have found that the micro has a capture mode that does the reading almos from himself, I have been trying to configure the micro using hal_write and as gdb says it has been done succesfully. the micro is the AT91R40008 But outside, the line is i/o so I need it as an input, as my configuration plans to do the line must go as an input, the line never goes from the logic 1. Is ecos using the timers of the eb40a for any of his functions? I need some advice here. To be more explicit. I have configured the three timers of the R40008, TC0, TC1, TC2 in capture mode, so in the rising edge of TIOA(the line that gets the pwm) the TC_V is loaded in RA and the, when the falling edge comes, he loads the RB. When I cheked the physical line of the r40008 after configuring, the line is at logic 1!. Here's the code. --=_0_310_1066151513 Content-Disposition: attachment; filename=idu.c Content-Type: text/plain; charset="iso-8859-1"; name=idu.c Content-Transfer-Encoding: quoted-printable Content-length: 8775 #include #include #include "CIF.h" #include "fft.h" #include "timer_counter.h" #include "pio_control.h" #include #include #include //include #define PS_BASE 0xFFFF4000 #define PS_PCER 0x04 #define PS_PCDR 0x04 /* now declare (and allocate space for) some kernel objects, like the two threads we will use */ cyg_thread thread_s[2]; /* space for two thread objects */ static cyg_interrupt intTC0; static cyg_handle_t intTC0_handle; static cyg_sem_t TC0_data_ready; static cyg_sem_t TC0_transmitir; static cyg_sem_t TC0_fin_transmision; cyg_count32 TC0_data_ready_counter; cyg_count32 TC0_transmitir_counter; cyg_count32 TC0_fin_transmision_counter; #define CYGNUM_HAL_PRI_HIGH 0 cyg_uint16 TC0_TALTO; cyg_uint16 TC0_PERIODO; char stack[2][4096]; /* space for two 4K stacks */ #define TC0_MAX_DATA 2048 #define TC0_NDAT 5 cyg_uint16 TC0_RAM[TC0_MAX_DATA]; /*Espacio para 2048 datos de 16bits para = el canal0*/ cyg_uint16 TC0_RBM[TC0_MAX_DATA]; /*8K en total */ cyg_uint16 TC0_CUENTA1=3D0; cyg_uint16 TC0_CUENTA2=3D0; /* now the handles for the threads */ cyg_handle_t main_thread; cyg_handle_t instrumentation_thread; /* and now variables for the procedure which is the thread */ cyg_thread_entry_t main_program; cyg_thread_entry_t instrumentation_program; /* and now a mutex to protect calls to the C library */ cyg_mutex_t cliblock; cyg_vector_t intTC0_vector =3D TC0_IRQ; cyg_uint32 interrupt_TC0_isr( cyg_vector_t vector, cyg_addrword_t data) //BASADO EN eCos book, pag 48 { cyg_interrupt_mask(vector); cyg_interrupt_acknowledge(vector); return(CYG_ISR_HANDLED | CYG_ISR_CALL_DSR); } void interrupt_TC0_dsr( cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) { HAL_IO_REGISTER REGISTER; cyg_semaphore_post(&TC0_data_ready); REGISTER=3DTC_BASE+TC_CHANNEL0+TC_RA; HAL_READ_UINT16(REGISTER,TC0_PERIODO); REGISTER=3DTC_BASE+TC_CHANNEL0+TC_RB; HAL_READ_UINT16(REGISTER,TC0_TALTO); cyg_interrupt_unmask(vector); } void cyg_user_start(void) { HAL_IO_REGISTER REGISTER; cyg_uint32 TC_REGISTER; printf(STR_HEADER); cyg_priority_t intTC0_priority =3D CYGNUM_HAL_PRI_HIGH; printf("Iniciando la configuraci=F3n del TC,Medici=F3n PWM"); //Hay que activar el periferico TC_REGISTER=3D0x00; TC_REGISTER=3DTC_REGISTER | (PIO_PER_ENABLE<