What could be wrong in my zilog program?

Status
Not open for further replies.

xueyuanlu

New Member
Hello,I am trying to send a message using the microcontroller. I am wondering what could be wrong in this program?



#include<ez8.h>
#include<sio.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

void main(void) {
unsigned int x;

init_uart(_UART0, _DEFFREQ, _DEFBAUD);
select_port(_UART0);
printf("AT+CMGF=1\n");
for(x=0;x<0xFFFF;x++);
printf("AT+CMGS=\"+639157135321\"\n");
for(x=0;x<0xFFFF;x++);
printf("Hello Philippines and Hello World!");
putch(0x1a);

}

I am trying to send a message "Hello Philippines and Hello World" using the AT Commands, to +639157135321. I am from the Philippines by the way, so the country code is +63. The program compiles, and no errors, but the expected output does not happen. Of course 9157135321. Could there be any wrong in logic or in punctuations, commands, whatsoever? thanks
 
Last edited:
Have you looked at the UART output pin to see if anything is happening. With a scope or logic probe.
 
Yeah, I've tried it and it seems that the voltage levels in the UART and the signal is just fine. I tried including these lines to the program:

PCOC = 0x00;
PCAF = 0x00;
PCDD = 0x00;
PCHDE |= 0xFF;

while(1)
{
PCOUT = 0xFF;
for(x=0;x<0xFFFF;x++);
PCOUT = 0x00;
for(x=0;x<0xFFFF;x++);
}

with Port C connected to LEDS if they will blink. Fortunately the LEDS do blink upon the inclusion of these codes, but the program with AT Commands doesn't seem to perform the desired output. Could there be any logic problem with my program?
 
Yes and I have them uploaded here.
**broken link removed**
Ugh! What a horrible file host! I've uploaded them here so no one else has to go through that.
Plus, you've included manuals for different development boards in the zip file. Which one are you using?
ie: What hardware is there between the micro and the modem? Any RS232 interface chips?
 

Attachments

  • Zilog_Documents.zip
    5.6 MB · Views: 162
Last edited:
Thanks

To everyone who replied to my query, my mistake. The program is now working, it takes about two minutes for it to respond. I was just too in a hurry I guess to see the result. I let the system be on a run for about two minutes and now its working. Thanks for all those who made a response

Xue Yuan Lu
 
2 minutes delay

That 2 minutes delays, seems to be satisfactory for you after all. Surprising!
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…