Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

Please discuss about the assignment 




Assignment No. 03
Semester: Fall 2016

CS609 – System Programming



Total Marks: 10


Due Date: 23/01/2017


Uploading instructions:


  • Your assignment must be in .c files name. (Any other formats like scan images, Word, PDF, bmp, Zip, etc will not be accepted).
  • Name your file with your ID (e.g. bc020200786).
  • No assignment will be accepted through email.
  • Lessons 23-30.


Rules for Marking:


It should be clear that your assignment will not get any credit if:


  • The assignment is submitted after due date.
  • The submitted assignment does not open, execute or file is corrupted.
  • Your assignment is copied from internet, handouts or from any other student

      (Strict disciplinary action will be taken in this case).




Question 1                                                                                                                                              (10  Marks)



Write a C program for setting up a slave DMA channel 1 to transfer 40 bytes by keeping the following points in mind.


  • Auto initialization should be off.
  • Channel 1 should be set up for read cycle in single transfer mode.






NOTE: Do not worry about the output and just concentrate on logic. There should be no error in your program. Do not put any query on MDB about this assignment, if you have any query then email at






Deadline: Your assignment must be uploaded/submitted on or before 23rd January 2017.



Views: 3823


Replies to This Discussion

Please Discuss here about this assignment.Thanks

Our main purpose here discussion not just Solution

We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions. Read More>>



For Important Helping Material related to this subject (Solved MCQs, Short Notes, Solved past Papers, E-Books, FAQ,Short Questions Answers & more). You must view all the featured Discussion in this subject group.

For how you can view all the Featured discussions click on the Back to Subject Name Discussions link below the title of this Discussion & then under featured Discussion corner click on the view all link.

Or visit this link 

Click Here For Detail.


.•°How to Download past papers from study groups°•.


Please Click on the below link to see…

.... How to Find Your Subject Study Group & Join .... 

Does anyone have any idea to help start the discussion and get this assignment done.

koi to send kr do yaaaaaaaaaaaaaaaaar

i am waiting

I'm too waiting.....



void add(){
int a = 40;

int main(){

return 0;

es program me channel 1 kaise add krenge?

cs 609 plzzzzzzzzzzzzzzzzzzzzzzzz koe complete solution send kr dy

unsigned int SPIRxBuffer[15] __attribute__((space(dma)));
void initDMA2()
    unsigned int i;

    DMA2CON = 0x0800;                                                           // Null-Write, Continuous, Ping-Pong disabled, Post-Inc., Periph-RAM
    DMA2CNT = 14;                                                               // Transfer 15 words at a time
    DMA2REQ = 0x00A;                                                            // Select SPI1 as DMA request source

    DMA2PAD = (volatile unsigned int) &SPI1BUF;
    DMA2STA = __builtin_dmaoffset(SPIRxBuffer);

    IFS1bits.DMA2IF = 0;                                                        // Clear the interrupt flag
    IEC1bits.DMA2IE = 1;                                                        // Enable DMA interrupt
    IPC6bits.DMA2IP = 6;                                                // set DMA interrupt priority to 6
    DMA2CONbits.CHEN = 1;                                                       // Enable DMA Channel
//    DMA2REQbits.FORCE = 1;                                                      // Force First word after Enabling SPI

// Force First word after Enabling SPI
//    DMA2REQbits.FORCE=1;
//    while(DMA2REQbits.FORCE==1);
void configSPI()
    // Configure SPI1CON register to the following
    SPI1CON1bits.DISSCK = 0;

// ?    Enable SPI module (SPI1STATbits.SPIEN=?)

// Force First word after Enabling SPI
void __attribute__((__interrupt__, no_auto_psv)) _DMA2Interrupt(void)
    getResultADS131E04();                                                     // Here is where I read from the SPIRxBuffer, and it´s all ceros
    IFS1bits.DMA2IF = 0;                                                        // Clear the DMA2 Interrupt Flag

void __attribute__((__interrupt__, no_auto_psv)) _DMA2Interrupt(void)
static unsigned int bufferCount = 0; // Keep record of which buffer is being written

ADS131E04_nCS = 1; // set /CS to high
DMA2CONbits.CHEN = 0; // Disable DMA Channel (not sure about it)

if( bufferCount == 0 )
//getResultADS131E04_DMA( &SPIRxBufferA[0] );
//getResultADS131E04_DMA( &SPIRxBufferB[0] );

bufferCount ^= 1;
IFS1bits.DMA2IF = 0; // Clear the DMA2 Interrupt Flag
void __attribute__((__interrupt__, no_auto_psv))_INT1Interrupt(void) // interrupt for ADC Converter Data Ready

ADS131E04_nCS = 0; // set /CS to low
DMA2CONbits.CHEN = 1; // Enable DMA Channel
DMA2REQbits.FORCE = 1; // Force First word after Enabling SPI

IFS1bits.INT1IF = 0;


© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service