Hey Andreas! Hey Prashant!
Thank's for yout help!
With knowing that the example from the website uses no driver, i understand everything a little bit more.
At the moment i'm trying to make this example work but i'm only able to do this in really little steps and it feels like i'm stuck again.
At first i modified the file "I2C Pin access.h" and i'm now able to read and write the SDA and SCL pins.
It seems that the used timer (timer 0) is not working and i think it's not implemented in the example, because the programm does not reach the timers ISR.
Because of this i read the Timer Service chapter in the "50_DeviceDriversAndSystemServices_man_rev4.0.pdf" and i'm now trying to implement a timer that reaches it's ISR.
This may sound good at first but it causes me some new trouble i try to explain, maybe someone of you could help again.
To use the initialisation, open and configure functions i have to include the adi_tmr.h, right?
#include <services\tmr\adi_tmr.h>
Because of missing definitions i have some compiler errors and till now i only know how to fix a few of them. This took me to the code listed below:
#define ADI_TMR_ENUMERATION_START 0x70000
typedef unsigned int u32
#include <services\tmr\adi_tmr.h>
I still have some errors left and i absolutely don't know how to fix the first of them. I get the following message:
"C:\Program Files (x86)\Analog Devices\VisualDSP 5.0\Blackfin\include\services\tmr\adi_tmr.h", line 221: cc0065: error:
expected a ";"
typedef enum ADI_TMR_GP_CMD { // general purpose timer command IDs
For me as a rookie this sounds like a missing ; in the adi_tmr.h file. I checked the file at line 221 and i can't find any syntax mistake. The code from adi_tmr.h is listed below, line 221 is the empty line after "typedef enum ADI_TMR_GP_CMD { // general purpose timer command IDs
" at the beginning.
typedef enum ADI_TMR_GP_CMD { // general purpose timer command IDs
ADI_TMR_GP_CMD_START=ADI_TMR_ENUMERATION_START, // 0x70000 - starting point
ADI_TMR_GP_CMD_END, // 0x70001 - end of table
(Value = NULL)
ADI_TMR_GP_CMD_PAIR, // 0x70002 - single command pair being passed
(Value = ADI_TMR_GP_CMD_VALUE_PAIR *)
ADI_TMR_GP_CMD_TABLE, // 0x70003 - table of command pairs being passed
(Value = ADI_TMR_GP_CMD_VALUE_PAIR *)
ADI_TMR_GP_CMD_SET_PERIOD, // 0x70004 - sets the period value of the timer
(Value = u32)
ADI_TMR_GP_CMD_SET_WIDTH, // 0x70005 - sets the width register value of the timer
(Value = u32)
ADI_TMR_GP_CMD_GET_WIDTH, // 0x70006 - gets the width register value of the timer
(Value = u32 *)
ADI_TMR_GP_CMD_GET_COUNTER, // 0x70007 - gets the counter value
(Value = u32 *)
// maintain this order
// ****** order start
ADI_TMR_GP_CMD_SET_TIMER_MODE, // 0x70008 - set timer mode
(Value = 0 - not used, 1 - PWM mode, 2 - WDTH_CAP mode, 3 - EXT_CLK mode)TRUE/FALSE)
ADI_TMR_GP_CMD_SET_PULSE_HI, // 0x70009 - set PULSE_HI
(Value = TRUE - positive action pulse, FALSE - negative action pulse)
ADI_TMR_GP_CMD_SET_COUNT_METHOD, // 0x7000a - set count method
(Value = TRUE - count to end of period, FALSE - count to end of width)
ADI_TMR_GP_CMD_SET_INTERRUPT_ENABLE, // 0x7000b - enable/disable interrupt generation
(Value = TRUE - enable interrupt, FALSE - disable interrupt)
ADI_TMR_GP_CMD_SET_INPUT_SELECT, // 0x7000c - selects the timer input
(Value = TRUE - UART_RX or PPI_CLK, FALSE - TMRx or PF1)
ADI_TMR_GP_CMD_SET_OUTPUT_PAD_DISABLE, // 0x7000d - disables the output pad in PWM mode
(Value = TRUE - disabled, FALSE - ENABLED)
ADI_TMR_GP_CMD_SET_CLOCK_SELECT, // 0x7000e - sets the time clock select
(Value = TRUE - use PWM_CK for counter, FALSE - use SCLK for counter)
ADI_TMR_GP_CMD_SET_TOGGLE_HI, // 0x7000f - sets toggle hi state
(Value = TRUE - PULSE_HI alternates each period, FALSE - use programmed state)
ADI_TMR_GP_CMD_RUN_DURING_EMULATION, // 0x70010 - run timer during emulation mode
(Value = TRUE - timer runs during emulation mode, FALSE - timer doesn't run)
ADI_TMR_GP_CMD_GET_ERROR_TYPE, // 0x70011 - senses the error type
(Value = u32 *, 0 - no error, 1 - counter overflow, 2 - period register error, 3 - width register error)
// ****** order end
ADI_TMR_GP_CMD_IS_INTERRUPT_ASSERTED, // 0x70012 - senses if the timer's interrupt is asserted
(Value = u32 *, TRUE - asserted, FALSE - not asserted)
ADI_TMR_GP_CMD_CLEAR_INTERRUPT, // 0x70013 - clears a timer's interrupt
(Value = n/a)
ADI_TMR_GP_CMD_IS_ERROR, // 0x70014 - senses if the timer has an error
(Value = u32 *, TRUE - error FALSE - no error)
ADI_TMR_GP_CMD_CLEAR_ERROR, // 0x70015 - clears a timer's error status
(Value = n/a)
ADI_TMR_GP_CMD_IS_SLAVE_ENABLED, // 0x70016 - senses slave enable status
(Value = u32 *, TRUE - enabled, FALSE - not enabled)
ADI_TMR_GP_CMD_IMMEDIATE_HALT, // 0x70017 - stops time immediately in PWM mode
(Value = n/a)
ADI_TMR_GP_CMD_ENABLE_TIMER, // 0x70018 - starts/stops the timer
(Value = TRUE - timer enabled, FALSE - timer disabled)
ADI_TMR_GP_CMD_SET_ENABLE_DELAY, // 0x70019 - sets number of sys clocks to delay enable by
(Value = u32)
ADI_TMR_GP_CMD_GET_PERIOD // 0x7001A - gets the period register value of the timer
(Value = u32 *)
} ADI_TMR_GP_CMD;
At the moment i think that i can eliminate an error in the adi_tmr.h file and it has to do with my use of adi_tmr.h.
Does anyone have an idea about this?
Does anyone know a good easy understandable example how to use timers?