开源改变世界

AT90USB 支持和 USB 串口 #746

推推 grbl 3年前 (2022-10-28) 316次浏览 0个评论
打开
伊姆拉希尔 打开了这个问题 2015 年 6 月 23 日 · 11 条评论
打开

AT90USB 支持和 USB 串口第746章

伊姆拉希尔 打开了这个问题 on 23 Jun 2015 · 11 条评论

注释

AT90USB 支持和 USB 串口 #746

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

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

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

  • 与通用 Gcode 发件人 ( https://github.com/winder/Universal-G-Code-Sender/ ) 或默认 python 之一 (simple_stream.py) 以外的其他 gcode 发件人的稳定连接…例如,我无法从 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

你好伊姆拉希尔:

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

可以和我们分享你的代码吗???
你是用 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

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

$ 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:错误:’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 (first use in this函数)
grbl/stepper.c:在函数’__vector_16’中:
grbl/stepper.c:459:错误:’PORTA’未声明(在此函数中首次使用)
grbl/stepper.c:在函数’st_reset’中:
grbl/stepper .c:507: 错误: ‘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: recipe for target’ 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 十六进制文件名
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:在函数“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): 未定义的对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 文件.. 这样做,它会工作…

DEVICE ?= at90usb1286
CLOCK = 16000000
PROGRAMMER ?= -c avrisp2 -P usb
SOURCE = usb_serial.c main.c motion_control.c gcode.c主轴控制.ccoolant_control.c serial.c
protocol.c stepper.c eeprom.c设置。 c planner.cnuts_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 的,但我无法连接。

AT90USB 支持和 USB 串口 #746
喜欢 (0)

您必须 登录 才能发表评论!