pic32mx320f064h Microchip Technology Inc., pic32mx320f064h Datasheet - Page 93

no-image

pic32mx320f064h

Manufacturer Part Number
pic32mx320f064h
Description
64/100-pin General Purpose, 32-bit Flash Microcontrollers
Manufacturer
Microchip Technology Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
pic32mx320f064h-40I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-40I/PT
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
pic32mx320f064h-40V/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-80I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-80V/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064hT-40I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
EXAMPLE 5-1:
© 2007 Microchip Technology Inc.
/*
The following code example illustrates a DMA channel 0 configuration for a normal addressing
transfer.
*/
IEC1CLR=0x00010000;
IFS1CLR=0x00010000;
DMACONSET=0x00008000;
DCH0CON=0x3;
CH0ECON=0;
DCH0SSA=0x1d010000;
DCH0DSA=0x1d020000;
DCH0SSIZ=0;
DCH0DSIZ=0;
DCH0CSIZ=0;
DCH0INTCLR=0x00ff00ff;
DCH0CONSET=0x80;
DCH0ECONSET=0x00000080;
// do something else
// poll to see that the transfer was done
while(TRUE)
{
}
// check the transfer completion result
int dmaFlags=DCH0INT;
if( (dmaFlags&0xb)
{
}
pollCnt=100;
while(pollCnt--);
register int pollCnt;
CONFIGURING THE DMA FOR NORMAL ADDRESSING MODE OPERATION
break;
Advance Information
// disable DMA channel 0 interrupts
// clear existing DMA channel 0 interrupt flag
// enable the DMA controller
// channel off, pri 3, normal mode, no chaining
// no start or stop irq’s, no pattern match
// program the transfer
// transfer source physical address
// transfer destination physical address
// source size 256 bytes
// destination size 256 bytes
// 256 bytes transferred per event
// clear existing events, disable all interrupts
// turn channel on
// initiate a transfer
// set CFORCE to 1
// use a poll counter.
// polling continuously the DMA controller in a tight
// loop would affect the performance of the DMA transfer
// one of CHERIF (DCHxINT<0>), CHTAIF (DCHxINT<1>)
// or CHBCIF (DCHxINT<3>) flags set
// transfer completed
// use an adjusted value here
// wait before reading again the DMA controller
PIC32MX FAMILY
DS61143A-page 91

Related parts for pic32mx320f064h