开源改变世界

AT90USB支持和USB串口 #746

推推 grbl 3年前 (2023-01-22) 74次浏览

打开
imrahil 打开了这个问题 2015 年 6 月 23 日 · 11 条评论
打开

AT90USB支持和USB串口#746

imrahil 打开了这个问题 2015 年 6 月 23 日 · 11 条评论

注释

AT90USB支持和USB串口 #746

大家好!
感谢您几天前的辛勤工作和出色的外部 cpu_maps,我在最新的 grbl 中添加了对带有 AT90USB 的板的支持(我基于去年https://github.com/lincomatic/grbl/的 lincomatic 的分支)。它应该与 Printrboard 一起使用,但我的目标是 KOS 板(http://www.byq3d.eu/index.php?id_product=18&controller=product&id_lang=7

我不得不禁用所有控制引脚,因为 at90 只有一个引脚更改中断寄存器,它被禁用和限制引脚阻止了……

除了几乎一切正常,但我有两个问题:

  • 来自其他 gcode 发件人的稳定连接比通用 Gcode 发件人 ( https://github.com/winder/Universal-G-Code-Sender/ ) 或默认 python 一个 (simple_stream.py) …例如我无法从 grblPanel 或Chillipeppr(我只收到“预期的命令字母”错误)
    可能我在串行连接上搞砸了太多但我不是 C/C++ 忍者所以我现在被困住了……
  • 禁用不同端口/引脚上的电机。目前我的 Y 马达一直开着。

干杯!

附言。我喜欢我的 CoreXY 上带有 G2 的圆弧/圆!!:)(我是 CNC 的新手,有一些 3D 打印经验)

AT90USB支持和USB串口 #746
成员

@imrahil: 感谢分享!我一直想在某个时候将 Grbl 移植到 AT90USB,这样我就可以让它在我的 Printrboard 上运行,就像你说的那样。让我们了解您的进展!

AT90USB支持和USB串口 #746

你好!我想我弄清楚了这个该死的 USB 是如何工作的 :) 将一些初始化代码移到主循环中,因为 AT90USB 在串行连接开始时不会重新启动。

特殊字符(状态报告、周期开始等)现在不会在中断时被捕获,但我认为 at90 中的 USB 速度非常快,没有区别

Universal-gcode-sender 现在工作正常

AT90USB支持和USB串口 #746

你好伊姆拉希尔:

我也对在 AT90USB 上运行 GRBL for Printrboard 非常感兴趣。

是否可以与我们分享您的代码???
您是使用 arduino IDE 还是 makefile (avr-gcc) 编译的??

提前致谢 !!!

AT90USB支持和USB串口 #746

你好!有趣的事!我没有提到我的叉子!:) 代码可在此处获得 – https://github.com/imrahil/grbl/tree/at90usb1286_support
像普通 grbl 一样编译,但具有 Teensyduino 支持(https://www.pjrc.com/teensy/td_download.html

我很确定 Printrboard 的引脚布局与我的电路板不同,所以要小心!

AT90USB支持和USB串口 #746

这是个好消息!!!感谢您的链接….

我很确定 Printrboard 的引脚布局与我的电路板不同,所以要小心!
别担心,我会处理引出线……如果它有效的话,也许我们可以稍后将它添加到你的 git 中……!!
干杯!

AT90USB支持和USB串口 #746

伊姆拉希尔:看起来你的树枝坏了……

AT90USB支持和USB串口 #746

看起来你的树枝坏了……

它是怎么坏的?

AT90USB支持和USB串口 #746

如果我做一个干净的 chekout 然后让我得到:::

$ make
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=atmega328p -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/main.c -o build/main.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=atmega328p -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/motion_control.c -o build/motion_control.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=atmega328p -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/gcode.c -o build/gcode.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=atmega328p -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/spindle_control.c -o build/spindle_control.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=atmega328p -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/coolant_control.c -o build/coolant_control.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=atmega328p -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/serial.c -o build/serial.o
grbl/serial.c:137: 警告:’USART0_UDRE_vect’ 似乎是拼写错误的信号处理程序
grbl/serial。 c:191: 警告:“USART0_RX_vect”似乎是一个拼写错误的信号处理程序
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=atmega328p -I。-ffunction-sections -fdata-sections -MMD -MP -c grbl/protocol.c -o build/protocol.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=atmega328p -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/stepper.c -o build/stepper.o
grbl/stepper.c: 在函数 ‘st_wake_up’:
grbl/stepper.c:199: error: ‘PORTE ‘ 未声明(在此函数中首次使用)
grbl/stepper.c:199: 错误:(每个未声明的标识符仅报告一次
grbl/stepper.c:199: 错误:对于它出现的每个函数。)
grbl/stepper.c: 在函数 ‘st_go_idle’ 中:
grbl/ stepper.c:256: error: ‘PORTE’ undeclared (first use in this function)
grbl/stepper.c: In function ‘__vector_11’:
grbl/stepper.c:328: error: ‘PORTA’ undeclared (第一次使用在这个function)
grbl/stepper.c: In function ‘__vector_16’:
grbl/stepper.c:459: error: ‘PORTA’ undeclared (first use in this function)
grbl/stepper.c: 在函数 ‘st_reset’:
grbl/stepper .c:507: error: ‘PORTA’ undeclared (first use in this function)
grbl/stepper.c: In function ‘stepper_init’:
grbl/stepper.c:516: error: ‘DDRA’ undeclared (first use in this function)
grbl/stepper.c:518: error: ‘DDRE’ undeclared (first use in this function)
Makefile:53: 目标配方 ‘ build/stepper.o’ 失败
make: *** [build/stepper.o] 错误 1

这可能是由 makefile 中错误的 cpu 引起的

设备 ?= atmega328p
时钟 = 16000000
编程器 ?= -c avrisp2 -P usb

我将设备更换为
DEVICE ?= at90usb1286

如果我重新编译,我得到 ::
$ make
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I。-ffunction-sections -fdata-sections -MMD -MP -c grbl/stepper.c -o build/stepper.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/eeprom.c -o build/eeprom.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/settings.c -o build/settings.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/planner.c -o build/planner.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/nuts_bolts.c -o build/nuts_bolts.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/limits.c -o build/limits.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/print.c -o build/print.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/probe.c -o build/probe.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/report.c -o build/report.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/system.c -o build/system.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -o build/main.elf build/main.o build/motion_control.o build/gcode.o build/spindle_control.o build/coolant_control.o build/serial.o build/protocol.o build/stepper.o build/eeprom.o build/settings.o build/planner.o build/nuts_bolts.o build/limits.o build/print.o build/probe.o build/report.o build/system.o -lm -Wl,–gc-sections
rm -f grbl.hex
avr-objcopy -j .text -j .data -O ihex build/main.elf grbl.hex
avr-size –format=berkeley build/main. elf
文本数据 bss dec hex 文件名
30084 0 1494 31578 7b5a build/main.elf

现在似乎可以正确编译了!!!

例外,如果我清理并重新编译….我会遇到很多错误

$ make clean
rm -f grbl.hex build/ .o build/ .d build/*.elf

cml@LT02-CML01 /cygdrive/d/CML/GVT_data/research/3D_print/gbl_usb_clean/grbl-at90usb1286_support
$ make
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/main.c -o build/main.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/motion_control.c -o build/motion_control.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/gcode.c -o build/gcode.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/spindle_control.c -o build/spindle_control.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/coolant_control.c -o build/coolant_control.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/serial.c -o build/serial.o
grbl/serial.c: In function ‘serial_init’:
grbl/serial.c:60: 警告:隐式声明函数 ‘usb_init’
grbl/serial.c: 在函数 ‘serial_write’ 中:
grbl/serial.c:65: 警告:函数 ‘usb_serial_putchar’
grbl/serial.c 的隐式声明:在函数 ‘serial_read’ 中:
grbl/serial. c:70: 警告:函数 ‘usb_serial_getchar’
grbl/serial.c 的隐式声明:在函数 ‘serial_reset_read_buffer’ 中:
grbl/serial.c:85: 警告:函数 ‘usb_serial_flush_input’ 的隐式声明
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I。-ffunction-sections -fdata-sections -MMD -MP -c grbl/protocol.c -o build/protocol.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/stepper.c -o build/stepper.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/eeprom.c -o build/eeprom.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/settings.c -o build/settings.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/planner.c -o build/planner.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/nuts_bolts.c -o build/nuts_bolts.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/limits.c -o build/limits.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/print.c -o build/print.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/probe.c -o build/probe.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/report.c -o build/report.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -MMD -MP -c grbl/system.c -o build/system.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=at90usb1286 -I. -ffunction-sections -fdata-sections -o build/main.elf build/main.o build/motion_control.o build/gcode.o build/spindle_control.o build/coolant_control.o build/serial.o build/protocol.o build/stepper.o build/eeprom.o build/settings.o build/planner.o build/nuts_bolts.o build/limits.o build/print.o build/probe.o build/report.o build/system.o -lm -Wl,–gc-sections
build/main.o: 在函数main': main.c:(.text.main+0x34): undefined reference tousb_configured’main.c
:(.text.main+0x44): undefined reference to usb_serial_get_control' build/serial.o: In functionserial_reset_read_buffer’:
serial.c:(.text.serial_reset_read_buffer+0x0 ): 未定义的引用usb_serial_flush_input' build/serial.o: In functionserial_read’:
serial.c:(.text.serial_read+0x0): 未定义对usb_serial_getchar' build/serial.o: In functionserial_write 的引用’:
serial.c:(.text.serial_write+0x2): 未定义对usb_serial_putchar' build/serial.o: In functionserial_init 的引用’:
serial.c:(.text.serial_init +0x0): 未定义对usb_init' build/protocol.o: In functionprotocol_main_loop 的引用’:
protocol.c:(.text.protocol_main_loop+0x10e): 对`usb_serial_get_control’ 的未定义引用
Makefile:83: 目标 ‘build/main.elf’ 的配方失败
make: *** [ build/main.elf] 错误 1

有任何想法吗???从你身边得到同样的东西???

AT90USB支持和USB串口 #746

我想我现在明白了……
更新后的 mak efile 丢失了 usb 文件……这样做就可以了……

设备 ?= at90usb1286
时钟 = 16000000
编程器 ?= -c avrisp2 -P usb
源 = usb_serial.c main.c motion_control.c gcode.c spindle_control.c coolant_control.c serial.c
protocol.c stepper.c eeprom.c 设置。 c planner.c nuts_bolts.c limits.c
print.c probe.c report.c system.c

我为打印板制作了一个版本

AT90USB支持和USB串口 #746

抱歉,我从未使用过 makefile :) 总是通过 Arduino IDE 编译

AT90USB支持和USB串口 #746

任何人都可以为 Printrboard RevD 共享预编译的 Hex。试过 Lincomatic,但无法连接。

喜欢 (0)