Skip to content

Commit

Permalink
Merge pull request #227 from Paciente8159/LPC176x
Browse files Browse the repository at this point in the history
NXP LPC176x core integration
  • Loading branch information
Paciente8159 authored Jul 29, 2022
2 parents d561c97 + b4edad0 commit d985b87
Show file tree
Hide file tree
Showing 52 changed files with 15,265 additions and 12,753 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@

# Changelog

## [1.5.b] - Unreleased
## [1.5.beta] - Unreleased

### Added

- added core support for ESP8266 with limitied functionalities (#222)
- added core support for ESP8266 with limitied functionalities (lacks analog and input ISR) (#222)
- added support for NXP LPC176x core (lacks EEPROM and analog) (#227)

### Changed

- configurable RX serial buffer size (#222)
- updated tinyUSB to version 0.13.0 (#227)

### Fixed

Expand Down Expand Up @@ -938,7 +940,7 @@ Version 1.1.0 comes with many added features and improvements over the previous

### Initial release

[1.5.b]: https://github.com/Paciente8159/uCNC/releases/tag/v1.5.b
[1.5.b]: https://github.com/Paciente8159/uCNC/releases/tag/v1.5.beta
[1.4.7]: https://github.com/Paciente8159/uCNC/releases/tag/v1.4.7
[1.4.6]: https://github.com/Paciente8159/uCNC/releases/tag/v1.4.6
[1.4.5]: https://github.com/Paciente8159/uCNC/releases/tag/v1.4.5
Expand Down
1 change: 1 addition & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ extra_configs =
uCNC/src/hal/boards/samd21/samd21.ini
uCNC/src/hal/boards/stm32/stm32.ini
uCNC/src/hal/boards/esp8266/esp8266.ini
uCNC/src/hal/boards/lpc176x/lpc176x.ini
; uCNC/src/hal/mcus/virtual/virtual.ini

[common]
Expand Down
10 changes: 9 additions & 1 deletion uCNC/src/hal/boards/avr/boardmap_rambo14.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ extern "C"
#define DOUT31_BIT 7
#define DOUT31_PORT B

#ifndef STEPPER0_HAS_MSTEP
#define STEPPER0_HAS_MSTEP
#endif
// STEP0 MICROSTEP
#define DOUT23_BIT 1
#define DOUT23_PORT G
Expand Down Expand Up @@ -156,6 +159,9 @@ extern "C"
#define DOUT19_PORT K

// stepper current digital potenciometer
#ifndef STEPPER_CURR_DIGIPOT
#define STEPPER_CURR_DIGIPOT
#endif
#define DOUT12_BIT 7
#define DOUT12_PORT D
#define DOUT13_BIT 2
Expand All @@ -165,8 +171,10 @@ extern "C"
#define DIN13_BIT 3
#define DIN13_PORT B

// specific rambo settings
// specific rambo settings
#ifndef STEPPER_CURR_DIGIPOT
#define STEPPER_CURR_DIGIPOT
#endif
#define STEPPER0_HAS_MSTEP
#define STEPPER1_HAS_MSTEP
#define STEPPER2_HAS_MSTEP
Expand Down
6 changes: 3 additions & 3 deletions uCNC/src/hal/boards/esp8266/esp8266.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
################
# STM32 Boards #
################
##################
# ESP8266 Boards #
##################

[env:d1]
platform = espressif8266
Expand Down
142 changes: 142 additions & 0 deletions uCNC/src/hal/boards/lpc176x/boardmap_re_arm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
/*
Name: boardmap_re_arm.h
Description: Contains all MCU and PIN definitions for Re-Arm Panucatt to run µCNC.
Copyright: Copyright (c) João Martins
Author: João Martins
Date: 17/06/2022
µ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_RE_ARM_H
#define BOARDMAP_RE_ARM_H

#ifdef __cplusplus
extern "C"
{
#endif

#ifndef BOARD_NAME
#define BOARD_NAME "RAMPS 1.4 RE-ARM"
#endif

// Setup step pins
#define STEP0_BIT 1 // assigns STEP0 pin
#define STEP0_PORT 2 // assigns STEP0 port
#define STEP1_BIT 2 // assigns STEP1 pin
#define STEP1_PORT 2 // assigns STEP1 port
#define STEP2_BIT 3 // assigns STEP2 pin
#define STEP2_PORT 2 // assigns STEP2 port
#define STEP3_BIT 0 // assigns STEP3 pin
#define STEP3_PORT 2 // assigns STEP3 port
#define STEP4_BIT 8 // assigns STEP4 pin
#define STEP4_PORT 2 // assigns STEP4 port

// Setup dir pins
#define DIR0_BIT 11 // assigns DIR0 pin
#define DIR0_PORT 0 // assigns DIR0 port
#define DIR1_BIT 20 // assigns DIR1 pin
#define DIR1_PORT 0 // assigns DIR1 port
#define DIR2_BIT 22 // assigns DIR2 pin
#define DIR2_PORT 0 // assigns DIR2 port
#define DIR3_BIT 5 // assigns DIR2 pin
#define DIR3_PORT 0 // assigns DIR2 port
#define DIR4_BIT 13 // assigns DIR2 pin
#define DIR4_PORT 2 // assigns DIR2 port

// Setup limit pins

#define LIMIT_X_BIT 24 // assigns LIMIT_X pin
#define LIMIT_X_PORT 1 // assigns LIMIT_X port
// #define LIMIT_X_ISR -6 // assigns LIMIT_X ISR
#define LIMIT_X2_BIT 25 // assigns LIMIT_X2 pin
#define LIMIT_X2_PORT 1 // assigns LIMIT_X2 port
// #define LIMIT_X2_ISR -5 // assigns LIMIT_X2 ISR
#define LIMIT_Y_BIT 26 // assigns LIMIT_Y pin
#define LIMIT_Y_PORT 1 // assigns LIMIT_Y port
// #define LIMIT_Y_ISR 1 // assigns LIMIT_Y ISR
#define LIMIT_Y2_BIT 27 // assigns LIMIT_Y2 pin
#define LIMIT_Y2_PORT 1 // assigns LIMIT_Y2 port
// #define LIMIT_Y2_ISR 1 // assigns LIMIT_Y2 ISR
#define LIMIT_Z_BIT 29 // assigns LIMIT_Z pin
#define LIMIT_Z_PORT 1 // assigns LIMIT_Z port
// #define LIMIT_Z_ISR -4 // assigns LIMIT_Z ISR

// Setup probe pin
#define PROBE_BIT 28
#define PROBE_PORT 1
// #define PROBE_ISR -3

// Setup com pins
#if (INTERFACE == INTERFACE_UART)
#define RX_BIT 3
#define TX_BIT 2
#define RX_PORT 0
#define TX_PORT 0
// only uncomment this if other port other then 0 is used
//#define COM_NUMBER 0
#elif (INTERFACE == INTERFACE_USB)
// PIN A10 is also used because of the USB ID (USB OTG)
#define USB_DM_BIT 30
#define USB_DM_PORT 0
#define USB_DP_BIT 29
#define USB_DP_PORT 0
#endif

// // Setup PWM
#define PWM0_BIT 5 // assigns PWM0 pin
#define PWM0_PORT 2 // assigns PWM0 pin
#define PWM0_CHANNEL 6

#define PWM1_BIT 4 // assigns PWM1 pin
#define PWM1_PORT 2 // assigns PWM1 pin
#define PWM1_CHANNEL 5

// Setup generic IO Pins
// Functionalities are set in config.h file

// // blink led
// #define DOUT31_BIT 28
// #define DOUT31_PORT 4

// Stepper enable pin. For Grbl on Uno board a single pin is used
#define STEP0_EN_BIT 10
#define STEP0_EN_PORT 0
#define STEP1_EN_BIT 19
#define STEP1_EN_PORT 0
#define STEP2_EN_BIT 21
#define STEP2_EN_PORT 0
#define STEP3_EN_BIT 4
#define STEP3_EN_PORT 0
#define STEP4_EN_BIT 29
#define STEP4_EN_PORT 4

// Setup the Step Timer used has the heartbeat for µCNC
// Timer 0 is used by default
//#define ITP_TIMER 0
// Setup the SERVO Timer used by µCNC
// Timer 1 is set by default
//#define SERVO_TIMER 1

#define SERVO3_BIT 18
#define SERVO3_PORT 1
#define SERVO2_BIT 19
#define SERVO2_PORT 1
#define SERVO1_BIT 21
#define SERVO1_PORT 1
#define SERVO0_BIT 20
#define SERVO0_PORT 1

#ifdef __cplusplus
}
#endif

#endif
15 changes: 15 additions & 0 deletions uCNC/src/hal/boards/lpc176x/lpc176x.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
##################
# LPC176X Boards #
##################

[common_lpc176x]
platform = https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/0.1.3.zip
platform_packages = Paciente8159/framework-arduino-lpc176x @ https://github.com/Paciente8159/pio-framework-arduino-lpc176x/archive/0.2.10.zip
lib_ldf_mode = off
lib_compat_mode = strict
build_flags = ${common.build_flags} -D NXP_LPC17xx

[env:re_arm]
extends = common_lpc176x
board = nxp_lpc1768
build_flags = ${common_lpc176x.build_flags} -D BOARD=BOARD_RE_ARM -D INTERFACE=1
3 changes: 0 additions & 3 deletions uCNC/src/hal/boards/stm32/stm32.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,18 @@ build_flags = ${common.build_flags} -D HAL_TIM_MODULE_DISABLED -D HAL_EXTI_MODUL

[env:bluepill_f103c8]
extends = common_stm32
platform = ststm32
board = bluepill_f103c8
build_flags = ${common_stm32.build_flags} -D BOARD=BOARD_BLUEPILL -D INTERFACE=1

[env:bluepill_f103c8_clone]
extends = common_stm32
platform = ststm32
board = bluepill_f103c8
build_flags = ${common_stm32.build_flags} -D BOARD=BOARD_BLUEPILL -D INTERFACE=1
; uncomment if it's a bluepill clone
upload_flags = -c set CPUTAPID 0x2ba01477

[env:blackpill_f401cc]
extends = common_stm32
platform = ststm32
board = blackpill_f401cc
build_flags = ${common_stm32.build_flags} -D BOARD=BOARD_BLACKPILL -D INTERFACE=1

Loading

0 comments on commit d985b87

Please sign in to comment.