喂鱼系统的PIC编码 [英] PIC CODING FOR FEEDING FISH SYSTEM

查看:80
本文介绍了喂鱼系统的PIC编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.我必须做一个有关GSM的项目,用于喂鱼系统.但是我在使PIC编码用于馈电系统向GSM调制解调器发送输出时遇到问题.我决定使用PIC16F877A.请有人帮我构建编码....

hello. i have to do a project about GSM, for feeding fish system. But i have a problem to make PIC Coding for feeding system to send output for GSM modem. I decide to use PIC16F877A. please anyone help me to construct the coding....

推荐答案

假设您的GSM调制解调器有一个串行端口,请使用一个串行端口将其连接到PIC的USART端口引脚. RS-232电平转换器.

阅读各种Microchip应用笔记,并提供有关USART端口用法的源代码示例.

调制解调器(包括GSM调制解调器)由文本命令(AT命令集)控制.请参阅调制解调器的数据表.

最后,通过对从/向USART端口读取和写入字符串的函数进行编程来实现调制解调器通信.

您可以使用C编译器为PIC器件生成代码.但是,许多PIC器件只有几个字节的RAM(就像您的368字节一样).因此,通常最好使用汇编代码.在您的情况下,您必须保留内存以容纳调制解调器可能的最长答案,或者实施可在接收期间解码答案的代码.

如果您只想发送短消息(SMS),则使用PIC devive可能是可以实现的(别忘了您还必须初始化调制解调器).对于较长的消息,或者当您想通过调制解调器发送电子邮件时,使用小型嵌入式设备将是更好的解决方案.
Assuming your GSM modem has a serial port, connect it to the USART port pins of the PIC using a RS-232 level shifter.

Read the various Microchip application notes with souce code examples about the usage of the USART port.

Modems (including GSM modems) are controlled by text commands (AT command set). See the data sheet of your modem.

Finally implement the modem communication by programming functions that read and write strings from/to the USART port.

You may use a C compiler to generate the code for your PIC device. However, many PIC devices have only a few bytes of RAM (like yours with 368 bytes). Therefore, it is often better to use assembler code. In your case, you have to reserve memory to hold the longest possible answer from the modem or implement code that can decode answers during receive.

If you only want to send short messages (SMS), using the PIC devive may be realizable (don''t forget that you must also initialize the modem). With longer messages or when you want to send emails via the modem, using a small embedded device would be a better solution.


这篇关于喂鱼系统的PIC编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆