Anybody can explain, why this function which use to turn on modem but reboot
the whole board?
Thanks
--- In "wawan_wiratno" <> wrote:
>
> Hi Don,
> this function is resetting the whole board not the modem only
>
> int gsmpwron() {
> printf("powering on...\n");
> if (pc104base==NULL) {
> printf("device not found");
> return(-1);
> }
> *gsmstat=(0x01); /* set power on */
> usleep(4000000); /* wait for power change to happen */
> printf("modem on\n");
> return 0;
> }
>
> same as my command line using poke8
> poke8 0x11e00143 0x01
>
> what I need is resetting the modem only not entire board.
>
> many thanks
>
> Wawan
>
>
> --- In Don Tucker <dtucker@> wrote:
> >
> > This is some sample C++ code from my TS-7260 + TS-GSM1. Some of the
> > memory addresses may be different because of differing devices and/or
> > jumper settings. I hope it is helpful.
> >
> > Don
> >
> >
> > devmem=-1;
> > devmem = open("/dev/mem", O_RDWR|O_SYNC);
> > if(devmem == -1)
> > return 0;
> >
> > int InitializeCellModem(int devmem)
> > {
> > volatile unsigned char *pc104base=NULL;
> > volatile unsigned char *gsmid;
> > int offset = 0x140;//for JP4=OFF on TS-GSM1
> >
> > pc104base = (unsigned
> > char*)mmap(0,getpagesize(),PROT_READ|PROT_WRITE,MAP_SHARED,
> > devmem,PC104_8BIT_IO);
> > //check memory map was successful
> > if (pc104base == MAP_FAILED)
> > return 0;
> > //check that the cell modem is present
> > gsmid = pc104base + offset;
> > if (*gsmid != 9)
> > return 0;
> >
> > //assign global pointer to ON/OFF bit in memory registers for cell phone
> > OP.gsm_stat = pc104base + offset + 3;
> >
> > return 1;
> > }
> >
> > void TurnCellModemOff(int TimeDelay)
> > {
> > *(OP.gsm_stat)=(0x00);
> > sleep(TimeDelay);
> > }
> >
> > void TurnCellModemOn(int TimeDelay)
> > {
> > *(OP.gsm_stat)=(0x01);
> > sleep(TimeDelay);
> > }
> >
> >
> >
> >
> > *(OP.gsm_stat)=(0x00);
> >
> > On 11/22/2011 1:50 AM, wawan_wiratno wrote:
> > >
> > > Hi All,
> > >
> > > I need to reset power of ts-gsm1 only when communication is hang.
> > > its mean when I cannot initiate AT command will reboot modem only not
> > > the whole board.
> > >
> > > according to docs, that register base+3 bit number 0 is the controller
> > > so I use poke8 command to turn on/off
> > >
> > > poke8 0x11e00143 0x0 --> modem turn off successfully
> > > but poke8 0x11e00143 0x1 --> will reboot the whole board
> > >
> > > note: JP5 ON, IRQ7, JP4 OFF
> > >
> > > please help
> > >
> > > thanks
> > > Wawan
> > >
> > >
> >
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|