Jump to content
  • 0

Sample Assembly Code for ChipKit uC32


Gary Armstrong

Question

3 answers to this question

Recommended Posts

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) 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...