Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added UNO Shield V3 board #348

Merged
merged 1 commit into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions uCNC/src/hal/boards/avr/avr.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ extends = common_avr
board = uno
build_flags = ${common_avr.build_flags} -D BOARD=BOARD_UNO

[env:uno_shield_v3]
extends = common_avr
board = uno
build_flags = ${common_avr.build_flags} -D BOARD=BOARD_UNO_SHIELD_V3

[env:x_controller]
extends = common_avr
board = uno
Expand Down
66 changes: 66 additions & 0 deletions uCNC/src/hal/boards/avr/boardmap_uno_shield_v3.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
Name: boardmap_uno_shield_v3.h
Description: Contains all MCU and PIN definitions for Arduino UNO similar to Grbl 1.1+ to run µCNC.

Copyright: Copyright (c) João Martins
Author: João Martins
Date: 05/01/2023

µCNC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. Please see <http://www.gnu.org/licenses/>

µCNC is distributed WITHOUT ANY WARRANTY;
Also without the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
*/

#ifndef BOARDMAP_UNO_SHIELD_V3_H
#define BOARDMAP_UNO_SHIELD_V3_H

#ifdef __cplusplus
extern "C"
{
#endif

#ifndef BOARD_NAME
#define BOARD_NAME "UNO SHIELD V3"
#endif

#include "boardmap_uno.h"

//swap limit z and replace pwm by spin enable pin
#ifdef LIMIT_Z_BIT
#undef LIMIT_Z_BIT
#endif
#ifdef LIMIT_Z_PORT
#undef LIMIT_Z_PORT
#endif
#ifdef PWM0_BIT
#undef PWM0_BIT
#endif
#ifdef PWM0_PORT
#undef PWM0_PORT
#endif
#ifdef PWM0_CHANNEL
#undef PWM0_CHANNEL
#endif
#ifdef PWM0_TIMER
#undef PWM0_TIMER
#endif

// Grbl 0.8 limit z
#define LIMIT_Z_BIT 3 // assigns LIMIT_Z pin
#define LIMIT_Z_PORT B // assigns LIMIT_Z port
#define LIMIT_Z_ISR 0 // assigns LIMIT_Z ISR

// spindle en
#define DOUT1_BIT 4
#define DOUT1_PORT B

#ifdef __cplusplus
}
#endif

#endif
5 changes: 5 additions & 0 deletions uCNC/src/hal/boards/boarddefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ extern "C"
#include "avr/boardmap_uno.h"
#endif

#if (BOARD == BOARD_UNO_SHIELD_V3)
#define MCU MCU_AVR
#include "avr/boardmap_uno_shield_v3.h"
#endif

#if (BOARD == BOARD_X_CONTROLLER)
#define MCU MCU_AVR
#include "avr/boardmap_x_controller.h"
Expand Down
1 change: 1 addition & 0 deletions uCNC/src/hal/boards/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ extern "C"
#define BOARD_MKS_DLC 4
#define BOARD_X_CONTROLLER 5
#define BOARD_MKS_GEN_L_V1 6
#define BOARD_UNO_SHIELD_V3 7
#define BOARD_BLUEPILL 10
#define BOARD_BLACKPILL 11
#define BOARD_MKS_ROBIN_NANO_V1_2 12
Expand Down