Scara robot with cnc shield v3 0 and avr assembly code explain costycnc

  Рет қаралды 47

Boboaca Costel

Boboaca Costel

2 ай бұрын

Put this code in web page www.costycnc.it/avr1 and compile and upload to arduino uno cnc shield v3.0(you can modify code or create one new directly from web browser!!!)
;for scala robot, draw a rhombus continuous
.equ DDRB=4
.equ PORTB=5
.equ DDRD=10
.equ PORTD=11
.equ PB0=0 ;ENABLE
.equ PD5=5 ;STEP
.equ PD2=2 ;DIRECTION
.equ PD6=6 ;STEP
.equ PD3=3 ;DIRECTION
.org 0x60
init:
; arduino nano cnc shield v3.0
sbi DDRB,PB0 ;enable motors
sbi DDRD,PD2 ;step motor x
sbi DDRD,PD5 ;dir motor x
sbi DDRD,PD3 ;step motor y
sbi DDRD,PD6 ;dir motor y
cbi PORTB,PB0 ; enable motors
loop:
cbi PORTD,PD5 ;set DIR pin low
call turnx ;turn motor x
sbi PORTD,PD6 ;set DIR pin high
call turny ;turn motor y
sbi PORTD,PD5 ;set DIR pin low
call turnx ;turn motor x
cbi PORTD,PD6 ;set DIR pin high
call turny ;turn motor y
rjmp loop ;loop
turnx:
ldi r21,3
turn1:
call stepx
dec R20
brne turn1
dec R21
brne turn1
ret
turny:
ldi r21,3
turn2:
call stepy
dec R20
brne turn2
dec R21
brne turn2
ret
stepx:
sbi PORTD,PD2 ; put high pin STEP motor x
rcall pulse ;pulse
cbi PORTD,PD2 ;put low pin Step motor x
rcall pulse ;pulse
ret
stepy:
sbi PORTD,PD3 ; put high pin STEP motor y
rcall pulse ;pulse
cbi PORTD,PD3 ; put high pin STEP motor y
rcall pulse ;pulse
ret
pulse:
ldi r17,3
pls:
dec R16
brne pls
dec R17
brne pls
ret

Пікірлер
AES: How to Design Secure Encryption
15:37
Spanning Tree
Рет қаралды 150 М.
🤔Какой Орган самый длинный ? #shorts
00:42
The child was abused by the clown#Short #Officer Rabbit #angel
00:55
兔子警官
Рет қаралды 24 МЛН
DO YOU HAVE FRIENDS LIKE THIS?
00:17
dednahype
Рет қаралды 85 МЛН
Drone Tracking Radar:  Part 6 Range Doppler
12:14
Jon Kraft
Рет қаралды 34 М.
$8 MilkV Duo: Arduino on one core and Linux on the other
13:49
Andreas Spiess
Рет қаралды 76 М.
Getting Started with Meshtastic - Devices
15:01
The Comms Channel
Рет қаралды 191 М.
Altium Designer Quick-Start Tutorial with Phil Salmony from Phil's Lab
23:37
Learn Drag and Drop in SwiftUI 2024 - Easy Tutorial for Beginners
1:30
Muhammad Zeeshan Mazhar
Рет қаралды 41
costycnc grande foam cutter cnc cut area 75x75x300cm
0:59
Boboaca Costel
Рет қаралды 44
PCB Chip Antenna Hardware Design - Phil's Lab #139
32:34
Phil’s Lab
Рет қаралды 15 М.
Здесь упор в процессор
18:02
Рома, Просто Рома
Рет қаралды 183 М.
Klavye İle Trafik Işığını Yönetmek #shorts
0:18
Osman Kabadayı
Рет қаралды 380 М.