Find Jobs
Hire Freelancers

numb1_hello

$10-50 USD

Në vazhdim
Postuar over 3 years ago

$10-50 USD

Paguhet në dorëzim
MPLAB IED CODE program running on a PIC32MM Curiosity Development Board. am trying to have the code below behave as follow Each timer interrupt should change the LEDs to one of the states shown below, in the order shown (go from state 1 to state 2, 2 to 3, 3 to 4, and from 4 back to 1): 1. Both LEDs off 2. LED1 off, LED2 on 3. LED1 on, LED2 off 4. Both LEDs on (return to state 1 after leaving state 4) the example code #include <xc.h> // Interrupt vector setup .globl __vector_dispatch_11 ## Timer 1 interrupt = vector #11 .section .vector_11, code, keep .align 2 .set nomips16 .ent __vector_dispatch_11 __vector_dispatch_11: j isrvector11 ## Jump to actual ISR code, which is in text section nop .end __vector_dispatch_11 .size __vector_dispatch_11, .-__vector_dispatch_11 // Start of text section .text ## Text section contains code .set noreorder ## Disable instruction reordering .globl main ## Define main label as a global entity .ent main ## and an entry point main: // Configure port A for output sw zero, TRISC ## TRISC = 0 --> all PORTC bits = output sw zero, ANSELC ## ANSELC = 0 --> all PORTC bits digital sw zero, TRISA ## TRISA = 0 --> all PORTA bits = output sw zero, ANSELA ## ANSELA = 0 --> all PORTA bits digital li t0, _PORTA_RA0_MASK ## $t0 = 0x00000001 li t1, _PORTC_RC9_MASK sw t1, LATCSET sw t0, LATACLR ## Set Port A, bit 0 (turn LED1 on) // Configure Timer 1 sw zero, T1CON ## Clear T1CON--disables timer to allow setup ori t1, zero, 0xFFFF ## Set t1 = 0xFFFF = initial PR1 value sw t1, PR1 ## (maximum possible clock period--65,535 cycles) li t2, _IFS0_T1IF_MASK ## t2 = bit mask for checking Timer 1 interrupt flag ## Prescale clock li t3, _T1CON_TCKPS1_MASK ## Prescale by factor of 64 (TCKPS = 10) sw t3, T1CONSET // Configure interrupts lui t3, 0x0001 ## Want INTCON bit 16 (VS<0>) = 1 ## so vectors 8 bytes apart ori t3, t3, _INTCON_MVEC_MASK ## Enable multivectored interrupt mode sw t3, INTCON li t3, _IPC2_T1IP_MASK ## Set T1 interrupt priority level to 7 sw t3, IPC2 ## Implicitly sets subpriority level to 0 sw t2, IEC0 ## Enable Timer 1 interrupts (uses ## same bit mask as T1 interrupt flag) ei ## Enable interrupts globally li t3, _T1CON_TON_MASK ## Enable Timer 1 by setting "ON" bit in T1CON sw t3, T1CONSET // Main loop--whole lotta nothing, just waiting for interrupt mainloop: j mainloop nop .end main // Handle Timer1 interrupt--clear interrupt flag and toggle LED .global isrvector11 .ent isrvector11 isrvector11: li t2, _IFS0_T1IF_MASK sw t2, IFS0CLR ## Clear T1IF in software! li t0, _PORTA_RA0_MASK ## $t0 = 0x00000001 li t1, _PORTC_RC9_MASK sw t1, LATCINV sw t0, LATAINV ## Flip LED1 eret ## Return from interrupt .end isrvector11
ID e Projektit: 28477959

Rreth projektit

2 propozime
Projekt në distancë
Aktive 3 yrs ago

Po kërkoni të fitoni para?

Përfitimet e ofertës për Freelancer

Vendosni buxhetin dhe afatin tuaj
Paguhuni për punën tuaj
Përshkruani propozimin tuaj
Është falas të regjistrohesh dhe të bësh oferta për punë
2 profesionistët e pavarur ofrojnë mesatarisht $55 USD oferta për këtë punë
Avatari i Përdoruesit
Hello I have more than 15 years of experience in the embedded systems design and pcb design and electronics systems design So let's discuss your project in chat
$50 USD në 3 ditë
5,0 (6 përshtypje)
2,4
2,4
Avatari i Përdoruesit
Hello, I am electronics and telecommunication engineer and I am quite experienced in embedded systems design. So far I have used PIC microcontrollers including PIC32MM for many different projects and I am quite sure that I can help you with your project. Just give me all the details and I will do my best to help you. Best regards
$60 USD në 7 ditë
4,8 (4 përshtypje)
2,2
2,2

Rreth klientit

Flamuri i UNITED STATES
Lynn, United States
5,0
1
Mënyra e pagesës u verifikua
Anëtar që nga nën 9, 2020

Verifikimi i klientit

Faleminderit! Ne ju kemi dërguar me email një lidhje për të kërkuar kredinë tuaj falas.
Ndodhi një gabim gjatë dërgimit të email-it tuaj. Ju lutemi provoni përsëri.
Përdorues të regjistruar Punë të postuara
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Po ngarkohet shikimi paraprak
Leja u dha për Geolocation.
Seanca e hyrjes ka skaduar dhe ke dalë. Hyr sërish.