|
采用stm32 仿三菱PLC,含原理圖,源碼,帶說明,保證源碼編譯通過,還有些小問題需要改進(jìn),特此貼出給大家參考。
0.png (6.08 KB, 下載次數(shù): 143)
下載附件
2019-3-9 01:26 上傳
FX1N三菱PLC說明文檔
1 技術(shù)規(guī)格:
輸入電源 24V +- 10%(20V觸發(fā)掉電保護(hù))
輸入: 8路 隔離
輸出: 8路 隔離 達(dá)林頓管輸出
232編程接口
485通訊接口,可連接觸摸屏、文本顯示器等等
兩個(gè)電位器輸出
輸入輸出 均帶有指示燈
0.png (30.08 KB, 下載次數(shù): 139)
下載附件
2019-3-9 01:27 上傳
電路原理圖如下:
0.png (94.79 KB, 下載次數(shù): 141)
下載附件
2019-3-9 01:27 上傳
0.jpg (60.63 KB, 下載次數(shù): 161)
下載附件
2019-3-9 01:27 上傳
用IAR編譯無錯(cuò)誤無警告.JPG (227.67 KB, 下載次數(shù): 128)
下載附件
2019-3-9 01:28 上傳
單片機(jī)源程序如下:
- /* Includes ------------------------------------------------------------------*/
- #include "iostm32f10xxB.h"
- #include "stm32f10x_lib.h"
- #include "main.h"
- //rac
- /* Includes ------------------------------------------------------------------*/
- #include "iic.c"
- #include "uart.c"
- #include "plc.c"
- #include "stm32f10x_it.c"
- /* Private functions ---------------------------------------------------------*/
- /*******************************************************************************
- * Function Name : main
- * Description : Main program.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- int main(void)
- {
- #ifdef DEBUG
- debug();
- #endif
- //配置系統(tǒng)時(shí)鐘
- sys_config();
- //配置 NVIC 和 Vector Table
- NVIC_Configuration();
- //配置使用的GPIO口
- GPIO_Configuration();
- //改變指定管腳的映射 GPIO_Remap_SWJ_JTAGDisable JTAG-DP 失能 + SW-DP使能
- GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable , ENABLE);
-
-
- xxdelay();
- SysTick_Config();
- I2C_EE_Init();
- Analog_Configration();
- DMA_Configration();
- program = (unsigned char *)(0x0800C000);
- UART0_setup();
- // uart0_txptr = 0;
- // uart0_txall = 2;
- // COM0_OUT;
- // USART1->DR = 0x55;
- UART1_setup();
- LED0_OFF;
- LED1_OFF;
-
- //主循環(huán)
- plc_main();
- }
- #ifdef DEBUG
- /*******************************************************************************
- * Function Name : assert_failed
- * Description : Reports the name of the source file and the source line number
- * where the assert_param error has occurred.
- * Input : - file: pointer to the source file name
- * - line: assert_param error line source number
- * Output : None
- * Return : None
- *******************************************************************************/
- void assert_failed(u8* file, u32 line)
- {
- /* User can add his own implementation to report the file name and line number,
- ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
- /* Infinite loop */
- while (1)
- {
- }
- }
- #endif
- /******************* (C) COPYRIGHT 2008 STMFANS *********************************
- *****END OF FILE****/
復(fù)制代碼
所有資料51hei提供下載:
STM001-STM32F103RBT6PLC源碼說明書原圖.7z
(883.39 KB, 下載次數(shù): 962)
2019-3-9 01:29 上傳
點(diǎn)擊文件名下載附件
下載積分: 黑幣 -5
|
評(píng)分
-
查看全部評(píng)分
|