• 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this