|
Many Thanks in Advance!
Dear community, I have made some snail progress and have produced the following code as well as added a second DMA and VDAC_8 onto the *.cysch page, as part of my developing the final solution:
#include
<device.h>
#define
TABLE_LENGTH 32
void
{
176,152,127,103,79,57,38,22,10,3,0,3,10,22,38,57,79,103};
main()uint8 sineTable[32] = {127,152,176,198,217,233,245,252,254,252,245,233,217,198,uint8 channel, channel_2; uint8 td,td_2; /* Start the DAC,PWM and enable the clock */
VDAC8_Start();
VDAC8_1_Start();
Timer_Start();
* Request per burst - 1 (every burst needs a new request
* High byte of source address = 0 (as SRAM is within 16 bit address space)
* High byte of Destination address = 0 (as it resides within 16 bit address space) */
#if (defined(__C51__))/* Initailize the DMA Channel will Burst count of 1 (to send 1 byte at a time)
channel = DMA_DmaInitialize(1, 1, 0, 0);
channel_2 = DMA_2_DmaInitialize(1,1,0,0);
#else
* Request per burst - 1 (every burst needs a new request
* High byte of source address = The upper 16 bits of source address is initialized with
* only one variable because the base address will be same for all the variables in the
* pattern and only the offset changes
* High byte of destination address = 0 (the UDB control register resides in 16 bit address space */
/* Initailize the DMA Channel will Burst count of 1 (to send 1 byte at a time)
channel = DMA_DmaInitialize(1, 1, HI16(sineTable), HI16(VDAC8_viDAC8__D) );
channel_2 = DMA_2_DmaInitialize(1, 1, HI16(sineTable), HI16(VDAC8_2_viDAC8__D) );
#endif /* Allocate the td with the channel that was allocated */
td = CyDmaTdAllocate();
td_2 = CyDmaTdAllocate();
/* Configure the td to transfer 32 bytes of data with auto increment of source address and no following TD */
CyDmaTdSetConfiguration(td, TABLE_LENGTH, td, TD_INC_SRC_ADR);
CyDmaTdSetConfiguration(td_2, TABLE_LENGTH, td_2, TD_INC_SRC_ADR);
/* Set the lower 16 bits of source address and the destination adddress */
CyDmaTdSetAddress(td, LO16((
CyDmaTdSetAddress(td_2, LO16((
uint32)sineTable), LO16((uint32)VDAC8_viDAC8__D) );uint32)sineTable), LO16((uint32)VDAC8_2_viDAC8__D) );/* Set tds to be the initial td associated with channel */
CyDmaChSetInitialTd(channel, td);
CyDmaChSetInitialTd(channel_2, td_2);
/* Enable the DMA channel */
CyDmaChEnable(channel, 1);
CyDmaChEnable(channel_2, 1);
(;;)
{
}
for
Would someone please help me get this second DMA channel (DMA_2) to read exactly the same look up table value as DMA channel one (DMA), and send to my second VDAC_8 called (VDAC_8_1) , the first VDAC_8 is still called (VDAC_8). I am a novice at the moment, but will learn as time permits..
./main.c: In function 'main':
./main.c:93: error: 'VDAC8_2_viDAC8__D' undeclared (first use in this function)
The command 'arm-none-eabi-gcc.exe' failed with exit code '1'.
--------------- Build Failed: 10/25/2010 08:08:23 ---------------
|