We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More

Please discuss about the assignment 

regard 

thanks

 

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).

 

Assignment

 

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 cs609@vu.edu.pk.

 

 

 

 

 

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

 

 

+ Click Here To Join also Our facebook study Group.

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?


See Your Saved Posts Timeline

Views: 3690

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

Attachments:

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>>

 

Note:-

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.....

too

#include
#include

void add(){
int a = 40;
}

int main(){
add();

getch();
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;
    for(i=0;i<15;i++)
    {
        SPIRxBuffer=0xDEED;
    }

    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.CKP=0;
    SPI1CON1bits.CKE=1;
    SPI1CON1bits.MODE16=1;
    SPI1CON1bits.MSTEN=1;
    SPI1CON1bits.SPRE=7;
    SPI1CON1bits.PPRE=1;
    SPI1CON1bits.DISSDO=0;
    SPI1CON1bits.DISSCK = 0;


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


// Force First word after Enabling SPI
    DMA2REQbits.FORCE=1;                
    while(DMA2REQbits.FORCE==1);
}
 
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] );
}
else
{
//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
while(DMA2REQbits.FORCE==1);

IFS1bits.INT1IF = 0;
}

RSS

Latest Activity

+ M.Tariq Malik's 9 discussions were featured
13 seconds ago
M +S +K posted a status
"Sirf Ehsas Badal Jaate Hain Duniya Mein Warna, Mohabbat Aur Nafrat Aik Hee Dil Se Hoti Hai"
5 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion EDU101 Foundations of Education Additional Reading material and Reference Books in the group EDU101 Foundations of Education
8 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion EDU101 Foundations of Education Additional Reading material and Reference Books in the group EDU101 Foundations of Education
8 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion EDU101 Foundations of Education Additional Reading material and Reference Books in the group EDU101 Foundations of Education
8 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion EDU101 Foundations of Education Additional Reading material and Reference Books in the group EDU101 Foundations of Education
8 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion EDU101 Foundations of Education Additional Reading material and Reference Books in the group EDU101 Foundations of Education
9 minutes ago
M +S +K posted a status
"Kabhi Itna Na Muskurao Ke Nazar Lag Jaye, Har Aik Ki Aankh Mein Meri Tarah Mohabbat Nahi Hoti"
11 minutes ago

Today Top Members 

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

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