• 0
Sign in to follow this  
Gary Armstrong

Sample Assembly Code for ChipKit uC32

Question

I have purchased a uC32 Chipkit (with a Pic32MX340F512H). I have a PicKit3 for development. I was provided a blink.c example which I now have running. Can anyone provide an assembly language example? I am running MPLAB X IDE.

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Try this one as simple as possible, this will not even blink, but will only switch the LED on

https://github.com/1i7/verilog-basics/blob/master/mips-pic32/task1_1-light-asm/light.S

#include <p32xxxx.h>
####################################################################
# Зажечь лампочку на ножке RD10 (chipKIT #8) ассемблером
main:   .global main                # Помечаем метку main как глобальную

    # Установить ножку RD10 как вывод - установить бит TRISD[10] в 0 - отправить 0x400 в TRISDCLR

    li t1, 1 << 10
    la t2, TRISDCLR #0xBF8860C4
    sw t1, 0 (t2) 
    
    # Установить значение 1 на ножке RD10 - установить бит LATD[10] в 1 - отправить 0x400 в LATDSET
    li t1, 1 << 10
    la t2, LATDSET #0xBF8860E8
    #la t2, LATDCLR #0xBF8860E4
    sw t1, 0 (t2) 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this