caramoan tour package

caramoan tour package

Author Topic: GSM to ZILOG MCU codes po d2...  (Read 1136 times)

Offline ΔЅịMø

  • Gas Turbine
  • **
  • Posts: 2903
  • Pogi/Ganda Points: 140
  • Gender: Male
  • "Live Curious"
GSM to ZILOG MCU codes po d2...
« on: March 09, 2011, 10:16:29 AM »
Start ko lang po ung thread na 2 mga masters pra po sa mga masters na willing po mag-tutor sa mga gumagamit nang GSM na mga newbie.. Isa nrin po ako dun... ;D ;D

calling po lahat nang mga bigatin sa zilog:

1. master kaizer
2. master paranz
3. iba pang masters

;D ;D ;D ;D ;D
Computer Engineering National Organization registration thread


Philippine Electronics Forum

GSM to ZILOG MCU codes po d2...
« on: March 09, 2011, 10:16:29 AM »

Offline tiktak

  • Gas Turbine
  • **
  • Posts: 2859
  • Pogi/Ganda Points: 203
  • Gender: Male
    • Tiktakx's Blog
Re: GSM to ZILOG MCU codes po d2...
« Reply #1 on: March 09, 2011, 10:56:06 AM »
there are some examples here but not based on zilog, but it is practically the same, first i would suggest to read on AT commands that are supported by your modem and trying it first with hyperterminal then learn how to use the zilog uart, sir paranz has an example on his tutorial
8051 stuff

Philippine Electronics Forum

Re: GSM to ZILOG MCU codes po d2...
« Reply #1 on: March 09, 2011, 10:56:06 AM »

Offline ΔЅịMø

  • Gas Turbine
  • **
  • Posts: 2903
  • Pogi/Ganda Points: 140
  • Gender: Male
  • "Live Curious"
Re: GSM to ZILOG MCU codes po d2...
« Reply #2 on: March 09, 2011, 11:50:33 AM »
may konting background na po ako sa AT commands sir... tska, madjo okay na po ung UART background ko... ung pag-ta-trap nlng po nang message sir... na-PM ko na po si sir kai dati bwt po array parsing.. na-try ko na po ung code ni sir kai sir..

while((MessageString = getc()));

kya lang, may error po...

problem ko lang po sir is, ung pag-capture nang message from the receiver sir... ;D
Computer Engineering National Organization registration thread


Philippine Electronics Forum

Re: GSM to ZILOG MCU codes po d2...
« Reply #2 on: March 09, 2011, 11:50:33 AM »

Offline ionik3

  • Size AAA Battery
  • ***
  • Posts: 66
  • Pogi/Ganda Points: 5
Re: GSM to ZILOG MCU codes po d2...
« Reply #3 on: December 31, 2011, 06:42:54 PM »
mga sir tanong ko lng kung may iba pang way bukod sa printf(); para mag send ng AT commands?

Philippine Electronics Forum

Re: GSM to ZILOG MCU codes po d2...
« Reply #3 on: December 31, 2011, 06:42:54 PM »

Offline ΔЅịMø

  • Gas Turbine
  • **
  • Posts: 2903
  • Pogi/Ganda Points: 140
  • Gender: Male
  • "Live Curious"
Re: GSM to ZILOG MCU codes po d2...
« Reply #4 on: January 04, 2012, 03:40:00 PM »
mga sir tanong ko lng kung may iba pang way bukod sa printf(); para mag send ng AT commands?

Bakit po di kayo gagamit ng printf() sir?
Computer Engineering National Organization registration thread


Philippine Electronics Forum

Re: GSM to ZILOG MCU codes po d2...
« Reply #4 on: January 04, 2012, 03:40:00 PM »

Offline ionik3

  • Size AAA Battery
  • ***
  • Posts: 66
  • Pogi/Ganda Points: 5
Re: GSM to ZILOG MCU codes po d2...
« Reply #5 on: January 04, 2012, 04:56:37 PM »
Bakit po di kayo gagamit ng printf() sir?

project ko po kasi is LED matrix message scroll via SMS.
kapag naglalagay po ako ng printf nababasawan po yung pwde ma-scroll na characters.
Sa tingin ko po malakas kumain ng memory yung printf kaya naghahanap ko alternatives for printf.

Offline ionik3

  • Size AAA Battery
  • ***
  • Posts: 66
  • Pogi/Ganda Points: 5
Re: GSM to ZILOG MCU codes po d2...
« Reply #6 on: January 04, 2012, 09:44:50 PM »
Bale ito ok naman. nkakareceive naman ako ng sms from gsm.
Kapag wala yung mga codes na to. 150 characters yung pwde ko i-output.
Pero kapag nilagay ko, 70+ characters na lng.

Quote
void initGSM()
{
   pause(200);
   printf("ATE0");   // First lest turn echo off
   cr();         // We need to pause as we will discard all received data after "ATE0\r"
   pause(200);

   printf("AT+CFUN=1");   
   cr();     
   pause(200);

   printf("AT+CMGF=1");   
   cr();       
   pause(200);

   printf("AT+CMGS=\"+639\"");
   pause(100);
   cr();
   pause(100);
   printf("ok na ko!");
   pause(100);
   ctrl_z();

}
:D

Offline ΔЅịMø

  • Gas Turbine
  • **
  • Posts: 2903
  • Pogi/Ganda Points: 140
  • Gender: Male
  • "Live Curious"
Re: GSM to ZILOG MCU codes po d2...
« Reply #7 on: January 05, 2012, 03:31:20 PM »
ayun po pala ang problema. para po kasi skin, wala pong kinalaman ang printf sa pagdisplay ng message. Yung message po ba na papa-scroll nyo yung i-pi-printf nyo sir?
Computer Engineering National Organization registration thread


Offline ionik3

  • Size AAA Battery
  • ***
  • Posts: 66
  • Pogi/Ganda Points: 5
Re: GSM to ZILOG MCU codes po d2...
« Reply #8 on: January 05, 2012, 05:52:18 PM »
Hindi po. May ibang function po ako para magscroll. Ginagamit ko lang po yung printf for initialization of gsm. :D


Ay sir, pwde po patulong dito? Hindi po kasi mabasa ng mcu ko yung message e. Nagiging blanko kapag  ginamit ko yung function na to.
Quote
void read()
{
   int gsm;

   printf("AT+CMGR=1\r");      // SEND AT+CMGR=1
   pause(500);
   
   for (gsm=0;gsm<=160;gsm++)
   {
      LED_DATA[gsm]= getch();
   }

}

Sa umpisa may value yung LED_DATA ko. Na-iscroll naman po yung value nung LED_DATA. Pero kapag ginamit ko na yung function read() nagiging blanko na.

Offline ΔЅịMø

  • Gas Turbine
  • **
  • Posts: 2903
  • Pogi/Ganda Points: 140
  • Gender: Male
  • "Live Curious"
Re: GSM to ZILOG MCU codes po d2...
« Reply #9 on: January 05, 2012, 06:34:29 PM »
Hindi po. May ibang function po ako para magscroll. Ginagamit ko lang po yung printf for initialization of gsm. :D


Ay sir, pwde po patulong dito? Hindi po kasi mabasa ng mcu ko yung message e. Nagiging blanko kapag  ginamit ko yung function na to.
Sa umpisa may value yung LED_DATA ko. Na-iscroll naman po yung value nung LED_DATA. Pero kapag ginamit ko na yung function read() nagiging blanko na.


Yung AT+CMGR po kasi, slot 1 lang po ng SIM yung babasahin nya sir. Baka wala na pong laman yung slot 1 ng SIM kaya po blangko yung LED-DATA nyo.
Computer Engineering National Organization registration thread


Offline ionik3

  • Size AAA Battery
  • ***
  • Posts: 66
  • Pogi/Ganda Points: 5
Re: GSM to ZILOG MCU codes po d2...
« Reply #10 on: January 05, 2012, 11:17:33 PM »
Sir meron sya message sa slot 1.

http://i82.photobucket.com/albums/j249/ionik3/atcmgr1.jpg

Ito na lng po kulang sa project namin e. :(

Offline ionik3

  • Size AAA Battery
  • ***
  • Posts: 66
  • Pogi/Ganda Points: 5
Re: GSM to ZILOG MCU codes po d2...
« Reply #11 on: January 15, 2012, 12:28:17 AM »
Mga sir may nakita akong ibang way para mag send sa GSM module
Quote
...
Tx_String("AT+CMGF=1\n"); //set to text mode
WaitRX();
...
Tx_String("AT+CMGR=1\n"); //read message entry #1
WaitRX();
...


tapos ito yung mga functions.

Quote
void send(char c)
{
   /*UART0*/
   while (!(U0STAT0 & 0x04)); //Transmit Data register enabled
   U0TXD = c; //Send data
}
//////////////////////////////////
//Transmit string
// and wait till response is complete
void Tx_String(char*sptr)
{
   for(;*sptr;++sptr)
   {
      if(*sptr == 0x0A)
      send(0x0D);
      else
      send(*sptr);
   }
}

void WaitRX(void)
{
   rxptr = Rx;
   rxlen=0;
   rxtmr=45;
   while(rxtmr>0);
}

Hindi ko alam kung tama or may mali sa code. Hindi ko pa kasi natatry.

Offline ionik3

  • Size AAA Battery
  • ***
  • Posts: 66
  • Pogi/Ganda Points: 5
Re: GSM to ZILOG MCU codes po d2...
« Reply #12 on: January 15, 2012, 03:10:55 AM »
ito na try ko na. kaso may error.

Quote
WARNING (747) --> Segment overlap occurs while binding the segment 'FAR_DATA'
WARNING (747) --> EDATA has an out of range address of E:0425
WARNING (747) --> FAR_DATA has an out of range address of E:0377 to E:0425

Any idea kung ano meaning nito?

Offline ΔЅịMø

  • Gas Turbine
  • **
  • Posts: 2903
  • Pogi/Ganda Points: 140
  • Gender: Male
  • "Live Curious"
Re: GSM to ZILOG MCU codes po d2...
« Reply #13 on: January 16, 2012, 12:37:19 PM »
Ano po ba yung complete code?
Computer Engineering National Organization registration thread


Offline ionik3

  • Size AAA Battery
  • ***
  • Posts: 66
  • Pogi/Ganda Points: 5
Re: GSM to ZILOG MCU codes po d2...
« Reply #14 on: January 16, 2012, 01:21:17 PM »
Main.c
Quote
#include <ez8.h>
#include <stdio.h>
//#include "SCANCODE.h"
#include "functions.h"

//PB0 = Strobe
//PB1 = Data
//PB2 = Clock

void main()
{
   Clear_Display_Ram();

   PAAF = 0x30;

   PADD = 0xff;
   PBDD &= ~0x07;
   PCDD = 0x00;

   PBOUT = 0xff;   
   PCOUT = 0xff;

   initUART();
   initGSM();
   //read();
   
   for(d=0;d<64;d++)
   {
      clock();
   }
      strobe();
      d = 0;

   while(1)
   {
      Display();
      i++;
      if(i == 1)//SPEED NG DISPLAY
      {
         i = 0;
         shift();
      }
   }
}   



Ito sir yung functions.h
Code: [Select]
#include <eZ8.h>
#include "cmap.h"
#include <sio.h>
#include <string.h>

void clock(void);
void strobe(void);
void cr(void);
void pause(int duration);
void Tx_String(char*sptr);
void ctrl_z(void);

unsigned short int space;
unsigned char *Display_Ram;
unsigned char char_pointer;
unsigned char mask;
char count;
unsigned char shift_counter;
unsigned short int i;
unsigned short int cnt;
unsigned short int d;

char *LED_DATA = "Useful for your tweets on Twitter, as well as a multitude of other applications, this is a free online calculator which counts the number of characters or letters in a text.";


void load(void)
{
unsigned char counter1;
if(LED_DATA[char_pointer]==0x00)
{
char_pointer = 0;
space = 12;
}

  for(counter1 = 0; counter1 < 5; counter1++)
{
if(space>0)
{
Display_Ram[63 + counter1] = 0x00;
}
else
Display_Ram[63 + counter1] = character_data[(LED_DATA[char_pointer] - 0x20)][counter1];
}

Display_Ram[68] = 0x00;

char_pointer++;

if(space==1)
{
//read();
}

if(space>0)
{
space--;
char_pointer = 0;
}

}

void Clear_Display_Ram(void)
{
unsigned char rcount;
memset(Display_Ram,' ',150);
for(rcount = 0; rcount < 69; rcount++)
Display_Ram[rcount] = 0x00;
}


void shift(void)
{
unsigned char i;

for(i=0;i<69;i++)
Display_Ram[i] = Display_Ram[i+1];

shift_counter++;
if(shift_counter == 6)
{
shift_counter = 0;
load();
}
}

void scan(void)
{
for (count=63;count>(-1);count--) //95
{
if ((Display_Ram[count] & mask) == mask)
{
PBOUT |= 0x02;
}
else
{
PBOUT &= ~0x02;
}
clock();
}
strobe();
}

#define INTEN 150

void Display(void)
{
unsigned char bit = 0x01;
mask = 0x80;
for(cnt=0;cnt<8;cnt++)
{
scan();
PCOUT = ~bit;
for(d=0;d<INTEN;d++);
PCOUT = 0xff;
mask = mask >> 1;
bit = bit << 1;
}
}

void clock(void)
{
PBOUT &= ~0x04; // clock hi
PBOUT |= 0x04; // clock low
}

void strobe(void)
{
PBOUT &= ~0x01; // strobe hi
PCOUT |= 0x01; // strobe low
}

void initUART(void)
{
   init_uart(_UART0, _DEFFREQ, 9600);
   select_port(_UART0);
   pause(1000);
}

void initGSM(void)
{
    pause(200);
Tx_String("ATE0");
pause(500);
    cr();   

Tx_String("AT+CFUN=1");
pause(300);
cr();

Tx_String("AT+CMGS=\"+639");
pause(100);
cr();
Tx_String("Hallu!!");
pause(200);
ctrl_z();

}

void pause(int duration)
{
int i2;
int j2;

for (i2=0;i2<duration;i2++)
{
for (j2=0;j2<325;j2++);
}
}

void ctrl_z(void)
{
putch(26);
}

void cr(void)
{
putch(13);
}

void read(void)
{
short int gsm;

    Tx_String("AT+CMGR=1\n");
for(gsm=0;gsm<=150;gsm++)
    {
      LED_DATA[gsm] = getch();
}
cr();

}
void send(char c)
{
/*UART0*/
while (!(U0STAT0 & 0x04)); //Transmit Data register enabled
U0TXD = c; //Send data
}

void Tx_String(char*sptr)
{
for(;*sptr;++sptr)
{
if(*sptr == 0x0A)
send(0x0D);
else
send(*sptr);
}
}

bale yung initGSM(); pa lang yung sinusubukan ko.

Offline thEta

  • CR2032 Battery
  • **
  • Posts: 21
  • Pogi/Ganda Points: 1
Re: GSM to ZILOG MCU codes po d2...
« Reply #15 on: May 09, 2012, 11:50:12 PM »
sir ask lng po ung serial communication po ba ng zilog at ng modem is always open?

Offline ΔЅịMø

  • Gas Turbine
  • **
  • Posts: 2903
  • Pogi/Ganda Points: 140
  • Gender: Male
  • "Live Curious"
Re: GSM to ZILOG MCU codes po d2...
« Reply #16 on: May 09, 2012, 11:55:48 PM »
sir ask lng po ung serial communication po ba ng zilog at ng modem is always open?


What do you mean? ;D
Computer Engineering National Organization registration thread


Offline thEta

  • CR2032 Battery
  • **
  • Posts: 21
  • Pogi/Ganda Points: 1
Re: GSM to ZILOG MCU codes po d2...
« Reply #17 on: May 10, 2012, 12:01:41 AM »
kc sir natry ko na mg send and recieve sms sa vb.net, kasi dun f mg pasa ka
ng at command sa modem need pa po na i open ang comports then after processing
ng modem i close na naman po ung communication. . .ask ko lng po f same din ba sa zilog . .
heheh para din po sa thesis namin . . nag aadvance lng kami :D
 ;D  ;D  ;D

Offline ΔЅịMø

  • Gas Turbine
  • **
  • Posts: 2903
  • Pogi/Ganda Points: 140
  • Gender: Male
  • "Live Curious"
Re: GSM to ZILOG MCU codes po d2...
« Reply #18 on: May 10, 2012, 12:05:52 AM »
Yung sa PC kasi, need mo talaga yang i-close para magamit ng iba, AFAIK. Correct me if I'm wrong mga master. :D Yung sa zilog, pwede na open lang yan always.

OT:
Ano ba talaga gusto nyo? Basic o advance? ;D ;D ;D
Computer Engineering National Organization registration thread


Offline thEta

  • CR2032 Battery
  • **
  • Posts: 21
  • Pogi/Ganda Points: 1
Re: GSM to ZILOG MCU codes po d2...
« Reply #19 on: May 10, 2012, 12:14:02 AM »
ahh ganun pala sir, , basic lang naman yan para sa inyu mga sir  ;D ;D
sir baka meron po kau link san mkahanap ng mga sample codes
para sa zilog 082A . . basics lng po ha . . saka na po ung advance
f mkakapasa  ;D ;D ;D ;D ;D ;D ;D ;D ;D

Philippine Electronics Forum

Re: GSM to ZILOG MCU codes po d2...
« Reply #19 on: May 10, 2012, 12:14:02 AM »

 

Privacy Policy

Contact Us: elabph@yahoo.com