久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 5797|回復(fù): 3
打印 上一主題 下一主題
收起左側(cè)

grbl stm32f4移植

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:344556 發(fā)表于 2018-9-7 07:29 | 只看該作者 |只看大圖 回帖獎勵 |倒序瀏覽 |閱讀模式
grbl stm32f4 移植工程包:


單片機源程序如下:
  1. /*
  2.   main.c - An embedded CNC Controller with rs274/ngc (g-code) support
  3.   Part of Grbl

  4.   Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
  5.   Copyright (c) 2009-2011 Simen Svale Skogsrud

  6.   Grbl is free software: you can redistribute it and/or modify
  7.   it under the terms of the GNU General Public License as published by
  8.   the Free Software Foundation, either version 3 of the License, or
  9.   (at your option) any later version.

  10.   Grbl is distributed in the hope that it will be useful,
  11.   but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.   GNU General Public License for more details.

  14.   You should have received a copy of the GNU General Public License
  15.   along with Grbl.  If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. /*
  18.   之前在github上看到了grbl-0.9j在stm32上的移植,于是照貓畫老虎,移植了grbl1.1f-20170131,
  19. 增加了USB虛擬串口,不再需要外接轉(zhuǎn)換芯片,但其他功能都沒有調(diào)試,存在嚴(yán)重問題。此次移植了
  20. grbl1.1f-20170801,同時進(jìn)行了少許調(diào)試,目前通訊正常,步進(jìn)電機接口、冷卻和主軸正常,同時
  21. 加入了四相五線步進(jìn)接口(x和y),這些在cpu_map.h中有相應(yīng)定義。但手頭沒有機器,尚未實機測
  22. 試,慎用!
  23.   如有重大問題,請聯(lián)系 tuoqiang@outlook.com
  24. */

  25. #include "grbl.h"

  26. // Declare system global variable structure
  27. system_t sys;
  28. int32_t sys_position[N_AXIS];      // Real-time machine (aka home) position vector in steps.
  29. int32_t sys_probe_position[N_AXIS]; // Last probe position in machine coordinates and steps.
  30. volatile uint8_t sys_probe_state;   // Probing state value.  Used to coordinate the probing cycle with stepper ISR.
  31. volatile uint8_t sys_rt_exec_state;   // Global realtime executor bitflag variable for state management. See EXEC bitmasks.
  32. volatile uint8_t sys_rt_exec_alarm;   // Global realtime executor bitflag variable for setting various alarms.
  33. volatile uint8_t sys_rt_exec_motion_override; // Global realtime executor bitflag variable for motion-based overrides.
  34. volatile uint8_t sys_rt_exec_accessory_override; // Global realtime executor bitflag variable for spindle/coolant overrides.
  35. #ifdef DEBUG
  36.   volatile uint8_t sys_rt_exec_debug;
  37. #endif


  38. int main(void)
  39. {
  40.   //USB init
  41.   //Delay Init
  42.   //GPIO CLK init
  43.   Hardware_Init();
  44.   
  45.   // Initialize system upon power-up.
  46.   serial_init();   // Setup serial baud rate and interrupts
  47.   settings_init(); // Load Grbl settings from EEPROM
  48.   stepper_init();  // Configure stepper pins and interrupt timers
  49.   system_init();   // Configure pinout pins and pin-change interrupt

  50.   memset(sys_position,0,sizeof(sys_position)); // Clear machine position.
  51.   asm("cpsie i"); // Enable interrupts

  52.   // Initialize system state.
  53.   #ifdef FORCE_INITIALIZATION_ALARM
  54.     // Force Grbl into an ALARM state upon a power-cycle or hard reset.
  55.     sys.state = STATE_ALARM;
  56.   #endif
  57.   
  58.   // Check for power-up and set system alarm if homing is enabled to force homing cycle
  59.   // by setting Grbl's alarm state. Alarm locks out all g-code commands, including the
  60.   // startup scripts, but allows access to settings and internal commands. Only a homing
  61.   // cycle '$H' or kill alarm locks '$X' will disable the alarm.
  62.   // NOTE: The startup script will run after successful completion of the homing cycle, but
  63.   // not after disabling the alarm locks. Prevents motion startup blocks from crashing into
  64.   // things uncontrollably. Very bad.
  65.   #ifdef HOMING_INIT_LOCK
  66.     if (bit_istrue(settings.flags,BITFLAG_HOMING_ENABLE)) { sys.state = STATE_ALARM; }
  67.   #endif

  68.   // Grbl initialization loop upon power-up or a system abort. For the latter, all processes
  69.   // will return to this loop to be cleanly re-initialized.
  70.   for(;;) {

  71.     // Reset system variables.
  72.     uint8_t prior_state = sys.state;
  73.     memset(&sys, 0, sizeof(system_t)); // Clear system struct variable.
  74.     sys.state = prior_state;
  75.     sys.f_override = DEFAULT_FEED_OVERRIDE;  // Set to 100%
  76.     sys.r_override = DEFAULT_RAPID_OVERRIDE; // Set to 100%
  77.     sys.spindle_speed_ovr = DEFAULT_SPINDLE_SPEED_OVERRIDE; // Set to 100%
  78.                 memset(sys_probe_position,0,sizeof(sys_probe_position)); // Clear probe position.
  79.     sys_probe_state = 0;
  80.     sys_rt_exec_state = 0;
  81.     sys_rt_exec_alarm = 0;
  82.     sys_rt_exec_motion_override = 0;
  83.     sys_rt_exec_accessory_override = 0;

  84.     // Reset Grbl primary systems.
  85.     serial_reset_read_buffer(); // Clear serial read buffer
  86.     gc_init(); // Set g-code parser to default state
  87.     spindle_init();
  88.     coolant_init();
  89.     limits_init();
  90.     probe_init();
  91.     plan_reset(); // Clear block buffer and planner variables
  92.     st_reset(); // Clear stepper subsystem variables.

  93.     // Sync cleared gcode and planner positions to current system position.
  94.     plan_sync_position();
  95.     gc_sync_position();

  96.     // Print welcome message. Indicates an initialization has occured at power-up or with a reset.
  97.     report_init_message();

  98.     // Start Grbl main loop. Processes program inputs and executes them.
  99.     protocol_main_loop();

  100.   }
  101.   //return 0;   /* Never reached */
  102. }

復(fù)制代碼

所有資料51hei提供下載:
grbl1.1f-stm32f103c8-master.zip (471.01 KB, 下載次數(shù): 74)


分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏4 分享淘帖 頂 踩1
回復(fù)

使用道具 舉報

沙發(fā)
ID:548018 發(fā)表于 2019-6-9 22:30 | 只看該作者
被騙了,明明是F103的。Grbl網(wǎng)站本來就有的。
回復(fù)

使用道具 舉報

板凳
ID:612008 發(fā)表于 2019-9-16 12:05 | 只看該作者
測試過沒有啊
回復(fù)

使用道具 舉報

地板
ID:1619 發(fā)表于 2021-3-12 08:19 | 只看該作者
貨不對版啊。這是stm32f103的移植,并不是stm32f407
回復(fù)

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機教程網(wǎng)

快速回復(fù) 返回頂部 返回列表
主站蜘蛛池模板: 欧美国产免费 | 亚洲最新网址 | 欧美 日韩 中文 | 99久久国产免费 | 欧美综合一区二区 | 91精品国产91久久久久久三级 | 国产高清视频一区二区 | 久久久高清 | 欧美色综合一区二区三区 | 国产视频一区二区 | 成人免费日韩 | 国产乱码久久久久久 | 欧美一区二区三区在线 | 国产欧美在线视频 | 秋霞a级毛片在线看 | 欧美性一级 | 日本精品一区二区 | 亚洲国产福利视频 | 99久久久国产精品 | 免费看av大片 | 欧美三级电影在线播放 | 亚洲精品中文在线 | 91精品国产一区二区三区 | 成人亚洲精品 | 91国内产香蕉 | 成人av资源在线 | 国产高清亚洲 | 免费 视频 1级 | 欧美电影一区 | 亚洲成人综合社区 | 国产精品久久亚洲7777 | h片在线观看免费 | 一区二区在线免费观看 | 插插插干干干 | 麻豆av片| 麻豆久久久9性大片 | 最新中文字幕在线 | 天天想天天干 | 日日噜噜噜夜夜爽爽狠狠视频, | 久久久不卡网国产精品一区 | av黄色免费在线观看 |