XMC™ Forum Discussions
XMC™
Hi all,I am working with an RTC module on an XMC4700 board. The problem is that the seconds counter seems to increment more than once per second, alth...
Show More
Hi all,
I am working with an RTC module on an XMC4700 board. The problem is that the seconds counter seems to increment more than once per second, although the prescaler value is set to 0x7FFF. When I step into individual assembly instructions in Debug mode, the seconds register seems to increment every other istruction, sometimes even once per instruction primitive (ldr, etc,). Now, the weird part is that the timekeeping seems to be correct - whenever I display the register values obtained with XMC_RTC_GetTimeStdFormat();, on a hyperterminal via UART, the 'seconds' value seems to get incremented every second - I left the terminal running in the background and even after half an hour the RTC shows the correct time. However, interrupts that are handled by SCU_0_IRQHandler (<-- I hope this is not the mistake) seem to trigger more than once per second as each interrupt routine also clears the hyperterminal and it is indeed refreshed at a very fast speed - such that I can barely see some values. Show Less
I am working with an RTC module on an XMC4700 board. The problem is that the seconds counter seems to increment more than once per second, although the prescaler value is set to 0x7FFF. When I step into individual assembly instructions in Debug mode, the seconds register seems to increment every other istruction, sometimes even once per instruction primitive (ldr, etc,). Now, the weird part is that the timekeeping seems to be correct - whenever I display the register values obtained with XMC_RTC_GetTimeStdFormat();, on a hyperterminal via UART, the 'seconds' value seems to get incremented every second - I left the terminal running in the background and even after half an hour the RTC shows the correct time. However, interrupts that are handled by SCU_0_IRQHandler (<-- I hope this is not the mistake) seem to trigger more than once per second as each interrupt routine also clears the hyperterminal and it is indeed refreshed at a very fast speed - such that I can barely see some values. Show Less
XMC™
Hi all,Is it possible to have two slices of the CCU8 unit generating two PWM signals connect an ERU unit to each slice using the iout and pdout of eac...
Show More
Hi all,
Is it possible to have two slices of the CCU8 unit generating two PWM signals connect an ERU unit to each slice using the iout and pdout of each ERU to control the CCU8 slice? Thus 2x iout + 2x pdout from the ERU units to the two slices of the CCU8?
Regards
Enigma Show Less
Is it possible to have two slices of the CCU8 unit generating two PWM signals connect an ERU unit to each slice using the iout and pdout of each ERU to control the CCU8 slice? Thus 2x iout + 2x pdout from the ERU units to the two slices of the CCU8?
Regards
Enigma Show Less
XMC™
Hi All,In the XMC1300 is it somehow possible to have the CCU8_PWM output going into the ERU with another signal to form a new signal? I have tried, bu...
Show More
Hi All,
In the XMC1300 is it somehow possible to have the CCU8_PWM output going into the ERU with another signal to form a new signal? I have tried, but failed, now I have to output the PWM to a pin and then use it with another signal in the ERU. This just wastes 2 GPIO pins for nothing...
Regards
Enigma Show Less
In the XMC1300 is it somehow possible to have the CCU8_PWM output going into the ERU with another signal to form a new signal? I have tried, but failed, now I have to output the PWM to a pin and then use it with another signal in the ERU. This just wastes 2 GPIO pins for nothing...
Regards
Enigma Show Less
XMC™
Hi,I want to communicate over I2C with MPU9150. I have a XMC1100 Boot kit and Dave3.I implemented some functions but i cant trigger the FIFO standard ...
Show More
Hi,
I want to communicate over I2C with MPU9150.
I have a XMC1100 Boot kit and Dave3.
I implemented some functions but i cant trigger the FIFO standard receive interrupt to retrieve read data. A ssample code is here.
The received buffer is always 0x00.
What can be the problem? I attached the I2C intterupt to NVIC2 module. Show Less
I want to communicate over I2C with MPU9150.
I have a XMC1100 Boot kit and Dave3.
I implemented some functions but i cant trigger the FIFO standard receive interrupt to retrieve read data. A ssample code is here.
#include//Declarations from DAVE3 Code Generation (includes SFR declaration)
#define MPU9150_I2C_ADDRESS 0xD0
#define MPU9150_WHO_AM_I 0x75
#define MPU9150_PWR_MGMT_1 0x6B
uint16_t DataReceive1 = 0x0000;
void receive_data_handler(void);
int write(uint8_t address, uint8_t payload );
int read(uint8_t address);
int main(void)
{
// status_t status; // Declaration of return variable for DAVE3 APIs (toggle comment if required)
DAVE_Init(); // Initialization of DAVE Apps
uint16_t Expect;
write(MPU9150_PWR_MGMT_1,0x00 );
while(1)
{
read(MPU9150_WHO_AM_I);
Expect= DataReceive1;
}
return 0;
}
int write(uint8_t address, uint8_t payload ){
// Configure message data length
I2C001_DataType data1,data2,data3,data4;
// Write access IO expander device PCA9502
// Transmission by the master with start condition,
// I2C write condition and slave address
data1.Data1.TDF_Type = I2C_TDF_MStart;
data1.Data1.Data = (MPU9150_I2C_ADDRESS | I2C_WRITE);
I2C001_WriteData(&I2C001_Handle0,&data1);
// Write to the direction register
data2.Data1.TDF_Type = I2C_TDF_MTxData;
data2.Data1.Data = address;
I2C001_WriteData(&I2C001_Handle0,&data2);
// Write data to configure one bit as output
data3.Data1.TDF_Type = I2C_TDF_MTxData;
data3.Data1.Data = payload;
I2C001_WriteData(&I2C001_Handle0,&data3);
// Stop condition by the master
data4.Data1.TDF_Type = I2C_TDF_MStop;
data4.Data1.Data = ubyteFF;
I2C001_WriteData(&I2C001_Handle0,&data4);
return 1;
}
int read(uint8_t address){
// Configure message data length
I2C001_DataType data1,data2,data3,data4,data5;
// Read access IO expander device PCA9502
// Transmission by the master with start condition,
// I2C write condition and slave address
data1.Data1.TDF_Type = I2C_TDF_MStart;
data1.Data1.Data = (MPU9150_I2C_ADDRESS | I2C_WRITE);
I2C001_WriteData(&I2C001_Handle0,&data1);
// Write data to the device
data2.Data1.TDF_Type = I2C_TDF_MTxData;
data2.Data1.Data = address;
I2C001_WriteData(&I2C001_Handle0,&data2);
// Transmit repeated start condition and slave address
data3.Data1.TDF_Type = I2C_TDF_MRStart;
data3.Data1.Data = MPU9150_I2C_ADDRESS | I2C_READ;
I2C001_WriteData(&I2C001_Handle0,&data3);
// Read one data from slave
data4.Data1.TDF_Type = I2C_TDF_MRxAck1;
data4.Data1.Data = ubyteFF;
I2C001_WriteData(&I2C001_Handle0,&data4);
// Stop condition by the master
data5.Data1.TDF_Type = I2C_TDF_MStop;
data5.Data1.Data = ubyteFF;
I2C001_WriteData(&I2C001_Handle0,&data5);
return 1;
}
// Event Handler( FIFO receive interrupt event) registered with NVIC002 App
void receive_data_handler(void)
{
uint16_t DataReceive1 = 0x0000;
// Read receive buffer, put the data in DataReceive1
I2C001_ReadData(&I2C001_Handle0,&DataReceive1);
}
The received buffer is always 0x00.
What can be the problem? I attached the I2C intterupt to NVIC2 module. Show Less
XMC™
Hi All,I have an issue with the CCU8 unit. I have set it to be in single shot and I use the inverted output. The issue is now that once I have trigger...
Show More
Hi All,
I have an issue with the CCU8 unit. I have set it to be in single shot and I use the inverted output. The issue is now that once I have triggered it to start, it does exactly what it should, but if I use and external stop to clear and stop the timer, the output stays high. I am doing this through an event, since I believe there is no reason to use an interrupt for this operation. Is this how the CCU8 should work or is this a bug?
Regards
Enigma Show Less
I have an issue with the CCU8 unit. I have set it to be in single shot and I use the inverted output. The issue is now that once I have triggered it to start, it does exactly what it should, but if I use and external stop to clear and stop the timer, the output stays high. I am doing this through an event, since I believe there is no reason to use an interrupt for this operation. Is this how the CCU8 should work or is this a bug?
Regards
Enigma Show Less
XMC™
Hi All,I seem not to follow the reference manual very well (16-40 to 16-43) on the ADC conversion times.First the example on 16-42. Does this mean it ...
Show More
Hi All,
I seem not to follow the reference manual very well (16-40 to 16-43) on the ADC conversion times.
First the example on 16-42. Does this mean it takes 1000ns to measure and have a result available for a single channel on a single S&H block? What is the 2nd conversion mentioned?
I would like to know something simple. Assuming I am using two analog input supplied to the two different S&H blocks. What is the fastest conversion time I can achieve if I read a single value out and how long would it take to read out both values?
I would appreciate any clarity someone can give me on this.
Regards
Enigma Show Less
I seem not to follow the reference manual very well (16-40 to 16-43) on the ADC conversion times.
First the example on 16-42. Does this mean it takes 1000ns to measure and have a result available for a single channel on a single S&H block? What is the 2nd conversion mentioned?
I would like to know something simple. Assuming I am using two analog input supplied to the two different S&H blocks. What is the fastest conversion time I can achieve if I read a single value out and how long would it take to read out both values?
I would appreciate any clarity someone can give me on this.
Regards
Enigma Show Less
XMC™
Hi All,Can someone point out where I can find an example of working with the ADC in data reduction mode. I have now worked quite a bit with the ADC, b...
Show More
Hi All,
Can someone point out where I can find an example of working with the ADC in data reduction mode. I have now worked quite a bit with the ADC, but would like to see a working example of the data reduction mode.
Regards
Enigma Show Less
Can someone point out where I can find an example of working with the ADC in data reduction mode. I have now worked quite a bit with the ADC, but would like to see a working example of the data reduction mode.
Regards
Enigma Show Less
XMC™
HI friend,I found some bugs in DAVE when you choose ADC function in XMC4104 chip.As the chip detail :================Package= LQFP64ROM= 64 KB FlashRA...
Show More
HI friend,
I found some bugs in DAVE when you choose ADC function in XMC4104 chip.
As the chip detail :
================
Package= LQFP64
ROM= 64 KB Flash
RAM= 20 KB RAM
InOut= 35 digital I/O
ADC= 9 ADC Channels, 12-bit
=================
1.When you choose ADC_MEASUREMENT [4.1.12] app and try to add 9 channel ADC pin.
the APP channel limit is 1~8.which mean use all of ADC channel is not possible.
2.Some motor application will need ADC synchronize with in ADC0 and ADC1.
Base on the datasheet XMC4101 can support "G0CH0 +G1CH0","G0CH3+G1CH3","G0CH6+G1CH6"
But in fact app will allow you set two of them not three in sync. Conversion option.
Could official friend update it in next app version.
By the way ,have anyone try to trace the code that DAVE app initial?
I can not find any sentence that set ADC register in the c code
Sam Tsang Show Less
I found some bugs in DAVE when you choose ADC function in XMC4104 chip.
As the chip detail :
================
Package= LQFP64
ROM= 64 KB Flash
RAM= 20 KB RAM
InOut= 35 digital I/O
ADC= 9 ADC Channels, 12-bit
=================
1.When you choose ADC_MEASUREMENT [4.1.12] app and try to add 9 channel ADC pin.
the APP channel limit is 1~8.which mean use all of ADC channel is not possible.
2.Some motor application will need ADC synchronize with in ADC0 and ADC1.
Base on the datasheet XMC4101 can support "G0CH0 +G1CH0","G0CH3+G1CH3","G0CH6+G1CH6"
But in fact app will allow you set two of them not three in sync. Conversion option.
Could official friend update it in next app version.
By the way ,have anyone try to trace the code that DAVE app initial?
I can not find any sentence that set ADC register in the c code
Sam Tsang Show Less
XMC™
Hi there,I am trying to use unions in Dave but run in syntax problems. Here is the sample codetypedef union{uint16_t a; uint32_t b;} Mem;int main(void...
Show More
Hi there,
I am trying to use unions in Dave but run in syntax problems. Here is the sample code
typedef union
{uint16_t a;
uint32_t b;
} Mem;
int main(void)
{
Mem->a=5; <--- ../Main.c:96:4: error: expected identifier or '(' before '->' token
}
the declaration seems to be ok, however I can not access the variable. Does anybody know, what I need to do?
thanks in advance,
Felix Show Less
I am trying to use unions in Dave but run in syntax problems. Here is the sample code
typedef union
{uint16_t a;
uint32_t b;
} Mem;
int main(void)
{
Mem->a=5; <--- ../Main.c:96:4: error: expected identifier or '(' before '->' token
}
the declaration seems to be ok, however I can not access the variable. Does anybody know, what I need to do?
thanks in advance,
Felix Show Less
XMC™
Hi everybody,I have a XMC4500 relaxKit and I use the ERU to trigger a capture of CCU42.CC40 when a button on the board is pressed. Debugging shows tha...
Show More
Hi everybody,
I have a XMC4500 relaxKit and I use the ERU to trigger a capture of CCU42.CC40 when a button on the board is pressed. Debugging shows that this works fine and the timer value at button-press gets captured into CCU42_CC40->CV[1].
Now I want to transfer the captured value into an array in RAM using the DMA. My configurations of the DMA are:
- source address &CCU42_CC40->CV[1]
- destination and source transfer width of 16bit because I only want to transfer the captured timer-value and not the rest of the capture-register
- destination address count mode incremental
- source address count mode no change
- source and destination burst length of 1
- block size of 1
- transfer type multi-block with reloading source address and contiguous destination address
However, this setup doesn't work since I can't see any values arriving at the destination array. Only if I change at least the source transfer width to 32bits I can see values arriving in the destination array. But each time the whole content of the capture-register is copied to the destination array.
How can I achieve a 16bit transfer with the DMA so that I only get the captured timer value in the destination array?
Regards,
Niclas Show Less
I have a XMC4500 relaxKit and I use the ERU to trigger a capture of CCU42.CC40 when a button on the board is pressed. Debugging shows that this works fine and the timer value at button-press gets captured into CCU42_CC40->CV[1].
Now I want to transfer the captured value into an array in RAM using the DMA. My configurations of the DMA are:
- source address &CCU42_CC40->CV[1]
- destination and source transfer width of 16bit because I only want to transfer the captured timer-value and not the rest of the capture-register
- destination address count mode incremental
- source address count mode no change
- source and destination burst length of 1
- block size of 1
- transfer type multi-block with reloading source address and contiguous destination address
However, this setup doesn't work since I can't see any values arriving at the destination array. Only if I change at least the source transfer width to 32bits I can see values arriving in the destination array. But each time the whole content of the capture-register is copied to the destination array.
How can I achieve a 16bit transfer with the DMA so that I only get the captured timer value in the destination array?
Regards,
Niclas Show Less
Trending discussions