打印

新手急求通过Psoc和Mc55实现拨通电话的C程序

[复制链接]
1301|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
over_chain|  楼主 | 2011-3-12 11:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
望各位高手帮帮忙!
沙发
loveajia| | 2011-3-12 17:57 | 只看该作者

RE: 新手急求通过Psoc和Mc55实现拨通电话的C程序

#include <m8c.h>        // part specific constants and macros
#include "PSoCAPI.h"    // PSoC API definitions for all User Modules

void main()
{
int timerTicks;
long int i,j;
char * strPtr; // Parameter pointer
unsigned char Command_AT[] ={0x41,0x54,0x0D};
unsigned char Command_CALL[16] ={0x41,0x54,0x44,0x31,0x35,0x31,0x32,0x30,0x30,0x37,0x37,0x32,0x37,0x36,0x3B,0x0D};
UART_1_CmdReset(); // Initialize receiver/cmd
// buffer
UART_1_EnableInt(); // Enable RX interrupts
Counter8_1_WritePeriod(155); // Set up baud rate generator
Counter8_1_WriteCompareValue(77);
Counter8_1_Start(); // Turn on baud rate generator
UART_1_Start(UART_1_PARITY_NONE); // Enable UART
M8C_EnableGInt ; // Turn on interrupts
//UART_1_CPutString("\r\nWelcome to PSoC UART test program. V1.1 \r\n");

timerTicks = 0;
while(1) {
UART_1_PutString(Command_AT);
//UART_1_PutCRLF();
for(i=3000;i>=0;i--)
{for(j=100;j>=0;j--)
{timerTicks++;
if (timerTicks > 254)
    timerTicks = 0;
}
}
strPtr = UART_1_szGetParam();
//UART_1_PutString(strPtr);
//UART_1_PutCRLF();
//while( 1 )
//{
UART_1_PutString(Command_CALL);
//UART_1_PutCRLF();
for(i=3000;i>=0;i--)
{for(j=1000;j>=0;j--)
{timerTicks++;
if (timerTicks > 254)
    timerTicks = 0;
}
}
}
}
以上是我自己写的程序。我单独让psoc跟串口专家连接时,串口专家能够显示来自psoc的AT以及ATD……等,让mc55单独跟串口专家连接时,串口专家能够发送AT指令并且成功通信。但是让两者连接的时候单片机就不能给mc55发指令了,两者是通过RXD跟TXD交叉连接的。调试了两天都不行,只能求高手解答了,万分感谢

使用特权

评论回复
板凳
over_chain|  楼主 | 2011-3-13 20:57 | 只看该作者
问题解决:)

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

2

主题

24

帖子

1

粉丝