Dichroitische Strahlteiler - strahlteiler
I am using an MSP430F5336 device and trying to get the DMAs to work with the multiplier block. I can't seem to get anything to work at all with them. I have used DMA blocks in the past and know I there are some tricks to get them to work properly but I can't seem to get this to work at all. The DMA don't trigger and they won't move any data. When I try to trigger manually, I get garbage data that I don't know where it is coming from. The documentation is lacking for this particular function. The MPY section refers to the DMA section for more information on using DMAs with the multiplier but there is no information at all in the DMA block on how to correctly use the multiplier in conjunction with the DMA block. The sample code is also lacking with this particular procedure.
#define DMA_MPY_MULT_U16_U16(x, y)\{\ __istate_t mpy_state = __get_interrupt_state();\ __disable_interrupt();\ MPY32L = (uint16_t)(x);\ OP2L = (uint16_t)(y);\ OP2H = 0;\ __set_interrupt_state(mpy_state);\ __delay_cycles(1);\} // DMA2SZ can be set to 2
Mpy benefits
Transferring the both operands to the multiplier by the DMA is also possible. The first operand is transferred by the DMA channel 0 (e.g. software trigger, 2 words, block mode), the second operand is transferred by the DMA channel 1 ("end of channel 0" trigger, 2 words, block mode), the MPY result is transferred by the DMA channel 2 ("multiplier ready" trigger, 4 words, block mode). Using this approach would make interrupt disabling unnecessary, but sacrificing the three DMA channels is a real overkill...
I guess that my reply isn't helpful for your design anymore, but I feel obliged to share some experience for those who would be interested in the "MPY + DMA mystery". Both the user's guide and MSP430 forums lack of any comprehensive explanation of how these modules work together. Obviously the information is scarce because the application is very rare and exotic, but anyway ...
The DMA transfer of 4 words takes 8 MCLK cycles, which saves 10 clock cycles instead of 18 cycles by the CPU (using the indirect autoincrement addressing). The call-return instructions will consume all the MCLKs that were so painfully gained. That's why no function should be used, only an inlined macro:
To achieve a deep, rich and expansive DOF, you'll want to set the f-stop to around f/11 or higher. You may have seen this principle demonstrated when you look ...
MPY dashboard
Sep 28, 2020 — The 8 pin cable is missing 1 slot is it ok? ... [[Template core/front/global/follow is throwing an error. This theme may be out of date. Run the ...
MPY membership
void DMA_MPY_Init(void){ mpy_result = 0u; DMACTL1 = DMA2TSEL__MPY; // DMA2TSEL_29 DMA2SA = (void __data20 *)&RES0; DMA2DA = &mpy_result; DMA2SZ = (sizeof mpy_result) / 2; // 4 words DMA2CTL = DMADSTINCR_3 | DMASRCINCR_3 | // src & dst incremented as word DMADT_5 | DMASWDW | DMAEN; // block mode (preferably repeated)}
I just noticed that there is no IFG bit. Maybe the DMA never fires because there is never a result ready. You might need to manually start the first computation, so completing it will trigger the DMA first time. Apparently, ‘MPY ready’ doesn’t mean it is ready to do something, but rather that it is done with doing something (which isn’t the case until the first math operation was performed)
#define DMA_MPY_MULT_U32_U32(x, y)\{\ __istate_t mpy_state = __get_interrupt_state();\ __disable_interrupt();\ *(uint32_t *)&MPY32L = (uint32_t)(x);\ *(uint32_t *)&OP2L = (uint32_t)(y);\ __set_interrupt_state(mpy_state);\ __delay_cycles(1);\} // look for the result in mpy_result
Diffusion light helps you do this by masking the direction that each source hits the subject. Direct light will often cast harsh, unnatural-looking shadows.
Mpy login
Eyepieces have focal lengths, too — 25- or 10-mm, for example, and thus their own magnification. To calculate the magnification, simply divide the focal length ...
Mpy corrosion
Size: Large Condition: 9/10 Condition Details: The shirt is in very good condition. The labels have signs of wear, but the shirt has no noticeable damage, ...
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional.
Are you sure about the DMA4TSEL/DMA5TSEL constants? Once there have been problems with the header files (well, some years ago, so it should be fixed now).
Calculate how much you might need to invest to reach a target amount.
I will supply my sample code for anyone that would like to pick through it and make suggestions. This is just a test function that I used so it is missing some items and is only for reference. Don't worry about the math involved, I just care about the flow. (By the way, I have tried writing manually to the OP2 register to kick things off but that does not work either.) I tried each one alone and have not been able to get either one to work.
My particular problem that I am trying to solve is I have an array of unsigned integers (16 bits) that need to be multiplied by a constant that is an unsigned long (32 bits). I am only interested in saving the second integer of the result (second 16 bits) and they are stored in a new array. This is a perfect use of the DMAs and I would really like to get it working.
You can also transfer the result backwards by decrementing from RES3 down to RES0, but it takes by 4 MCLK cycles longer (I don't know why) and is not recommended. All the time measurements were made by a hardware timer sourced by SMCLK 4x faster (the faster the better) than MCLK taking into account the overhead for handling the timer.
Different lamps come with unique features, each created to give the customer an unforgettable experience. These magnifying lamp needlework ...
Mpy certification
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
void test_stim_tmp(uint16 scale_value, uint16 ramp_time){ uint16 waveform[256]; uint16 waveform_scaled[256]; uint16 index1; uint16 index2; uint16 index3; uint32 operand1; volatile uint16 tmp1; volatile uint16 tmp2; volatile uint16 tmp3; for (i = 0; i < 256; i++) waveform[i] = i; operand1 = (uint32)scale_value * (uint32)0x10000 / (uint32)ramp_time; // setup multiplier MPY32CTL0 |= OP1_32; MPY32L = operand1 & 0xffff; MPY32H = (operand1 >> 16) & 0xffff; // setup DMA4 - MPY to array DMACTL2 = DMA4TSEL_29; DMA4CTL = DMADT_4+DMADSTINCR_3; // repeat single block xfer, dest inc DMA4DAL = (uint16)waveform_scaled; DMA4SAL = (uint16)(&RES1); DMA4SZ = 256; DMA4CTL |= DMAEN; // setup DMA5 - array to MPY DMACTL2 |= DMA5TSEL_29; DMA5CTL = DMADT_4+DMASRCINCR_3; // repeat single block xfer, source inc DMA5DAL = (uint16)(&OP2); DMA5SAL = (uint16)(waveform + 1); DMA5SZ = 256; DMA5CTL |= DMAEN; // halt here with debugger and single step but DMAs never to fire}
Mpy meaning
The X-FWR motorized filter wheels have 57 ms filter change speeds and optional IO: 1 digital input, 2 digital outputs; The T-MM mirror mounts have +/- 5° ...
Thanks for the reply. I agree with concept of using the same trigger for both DMA channels. I tried to back it off and use just a single DMA and tried both feeding the MPY unit and pulling from it but neither one worked. I tried both level and edge triggered DMA (I thought that it should be edge triggered but I had to try level since edge didn't work but neither of those worked either). There is just no information on how to use the DMA unit with the MPY unit.
The "dummy" delay cycles and restoring the interrupt state are needed for synchronization, if the result is accessed right away. They consume exactly 4 MCLKs. But they can be removed at your own choice and risk.
Mpy medical
Also, you cannot trigger two DMA channels by the same trigger (after the first DMA fired, the trigger is gone). If you want two actions from one trigger, then you’ll have to set-up one channel for single operation, 1 byte transfer, and trigger the second channel by the completion of the first channel. Which only works if you don’t have to count-up source or destination of the first channel (e.g. for moving 16 bit results to TXBUF as two subsequent 8 bit DMA transfers).
The MTF describes how well an imaging system performs in depiction of fine structures with minimal blur. Image quality can be improved with increased signal ...
Did you try to set-up DMA first and then init the MPY?After all, the DMA is triggered by the MPY ‘ready’ interrupt flag (clear it first), and DMA needs to be edge-triggered (except if using the external DMA trigger)
The multiplier provides a single(!) trigger to the DMA, that's why the only transfer mode that works is "block mode" (or "repeated block mode", i.e. DMA_1 or DMA_5). Another important issue is the size of the operands: the first operand can be of any size (8, 16, 24 or 32 bits). The second operand must be 24 or 32 bits! It is possible to emulate the second operand of 8 or 16 bits just by a "dummy" write access to OP2H, i.e. "OP2H = 0;".Skipping to do so, the MPY result registers will contain the correct data, but the DMA destination will not. Accessing the high word of the second operand is crucial, because it generates the trigger request and it defines the exact moment when the trigger should fire (4 cycles later after the end of the high word access). The write access can take from 3 up to 5 cycles, thus the trigger timing will vary. By the way, transferring the result less than 64 bits by the DMA is not worth trying, because the CPU would do that almost as fast as the DMA. Here is the code snippet:
The only way I have been able to make it work is to use a timer and adjust the CCR0 and CCR2 values to step through the array. This works well enough for my application so I have a solution but I still don't know how to make the MPY and DMA work together.
Is there someone out there that has gotten this to work that would be willing to share their code? I am trying to use the DMA both as feeding the MPY block and pulling data from it, but if you have either one alone and it works, I would be most grateful for that also.
by SI Hajdu · 2002 · Cited by 48 — The use of lenses for spectacles (eyeglasses), distant vision (telescopes), and high magnification (microscopes) required early lens makers accurately to grind ...