Quantcast

close(fd) takes too long

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

close(fd) takes too long

Mipo01
Hi everyone,

I would like to ask for some suggestions.

I have looping code where i am using function for reading GPS data from Gallop43 board ttyO0 port.
I have problem that when i try to close port it takes too long. Usually around 20 - 30 seconds. First few times immediately and than this problem occurred.

Code:
int gps (float* lat1, float* lon1){

        int fd, round = 0;
        int size,longitude_deg,lattitude_deg,UTC;
        char buff[70],temp_buff[7];
        float longitude_min, lattitude_min;
       
        fd = open("/dev/ttyO0", O_RDWR | O_NOCTTY | O_NDELAY);
        if (fd == -1){
                printf("Can't open port for GPS!\n");
                return 1;
        }
        else {
                fcntl(fd, F_SETFL, 0);
                do{
                        memset(temp_buff,0,sizeof(temp_buff));    //reset the buffer
                        size = read(fd, buff, 70);
                if (buff[4]=='M'&&buff[5]=='C'&&buff[17]=='A')
                        {
                                close(fd);    
                                printf ("OK\n");
                               
                                memset(temp_buff,0,sizeof(temp_buff));
                                temp_buff[0]=buff[19];
                                temp_buff[1]=buff[20];
                                lattitude_deg = atof (temp_buff);

                                memset(temp_buff,0,sizeof(temp_buff));
                                temp_buff[0]=buff[21];
                                temp_buff[1]=buff[22];
                                temp_buff[2]=buff[23];
                                temp_buff[3]=buff[24];
                                temp_buff[4]=buff[25];
                                temp_buff[5]=buff[26];
                                temp_buff[6]=buff[27];
                                temp_buff[7]=buff[28];
                                lattitude_min = atof (temp_buff);

                                memset(temp_buff,0,sizeof(temp_buff));
                                temp_buff[0]=buff[32];
                                temp_buff[1]=buff[33];
                                temp_buff[2]=buff[34];
                                longitude_deg = atof (temp_buff);

                                memset(temp_buff,0,sizeof(temp_buff));
                                temp_buff[0]=buff[35];
                                temp_buff[1]=buff[36];
                                temp_buff[2]=buff[37];
                                temp_buff[3]=buff[38];
                                temp_buff[4]=buff[39];
                                temp_buff[5]=buff[40];
                                temp_buff[6]=buff[41];
                                temp_buff[7]=buff[42];
                                longitude_min = atof (temp_buff);

                                memset(temp_buff,0,sizeof(temp_buff));
                                temp_buff[0]=buff[7];
                                temp_buff[1]=buff[8];
                                temp_buff[2]=buff[9];
                                temp_buff[3]=buff[10];
                                temp_buff[4]=buff[11];
                                temp_buff[5]=buff[12];
                                UTC = atof (temp_buff);
                               
                                memset(buff,0,sizeof(buff));

                                *lat1=lattitude_deg+(lattitude_min/60);
                                *lon1=longitude_deg+(longitude_min/60);

                        return 0;
                        }
                                round++;
                }while(round<300);
                                close(fd);
                                return 0;
                                }

Thank you very much.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: close(fd) takes too long

hiCountryCowboy


I am running an OveroEarth on a Gallop43 and am logging the GPS output plus another sensor connected via USB/Serial dongle.  My code is very similar to what was posted, but I do an fopen(fd) followed by fprintf() followed by a fflush(fd) then finally a fclose(fd) without issues.  I do not call fcntl().   I am opening/writing/flushing/closing the GPS file once a second while the serial sensor is opening/writing/flushing/closing its data file about 8-10 times per second.   The application has been running for sometime without incident.

<quote author="Mipo01">

>Hi everyone,

>I would like to ask for some suggestions.

>I have looping code where i am using function for reading GPS data from Gallop43 board ttyO0 port.
>I have problem that when i try to close port it takes too long. Usually around 20 - 30 seconds. First few >times immediately and than this problem occurred.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: close(fd) takes too long

Mipo01
Thank you very much for the response. I tried to change it but the same issue occurred. It gets stuck on the same point.

Code:

int gps (float* lat1, float* lon1){

                FILE* fd;
        int round = 0;
        int longitude_deg,lattitude_deg,UTC;
        char buff[44],temp_buff[7];
        float longitude_min, lattitude_min;
       
        fd = fopen("/dev/ttyO0", "r+");
        if (fd == NULL){
                printf("Can't open port for GPS!\n");
                return 1;
        }
        else {
                do{
                        memset(temp_buff,0,sizeof(temp_buff));    //reset the buffer
                        fgets (buff,44,fd);
                if (buff[4]=='M'&&buff[5]=='C'&&buff[17]=='A')
                        {      
                                printf ("In the loop \n");
                                fflush(fd);
                                printf ("flushed \n");
                                fclose(fd);    
                                printf ("OK\n");
                               
                                memset(temp_buff,0,sizeof(temp_buff));
                                temp_buff[0]=buff[19];
                                temp_buff[1]=buff[20];
                                lattitude_deg = atof (temp_buff);
...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: close(fd) takes too long

Miner, Jonathan W (US SSA)
Hi -

Without knowing how your entire application works, it seems odd to open/close the GPS port each time you need GPS data.  You would expect that this should not cause a resource problem, but there is also additional time involved with executing the open/close calls, and associated resource management. Why not use a daemon like gpsd to manage the interface with the GPS and then use the gpsd API to poll for the current location?

I'll admit that I've worked with USB and serial GPS devices, but never with a Gumstix or Gallop board; so maybe my answer doesn't work in this particular situation.
________________________________________
From: Mipo01 [[hidden email]]
Sent: Monday, December 17, 2012 08:08
To: [hidden email]
Subject: Re: [Gumstix-users] close(fd) takes too long

Thank you very much for the response. I tried to change it but the same issue
occurred. It gets stuck on the same point.

Code:

int gps (float* lat1, float* lon1){

                FILE* fd;
        int round = 0;
        int longitude_deg,lattitude_deg,UTC;
        char buff[44],temp_buff[7];
        float longitude_min, lattitude_min;

        fd = fopen("/dev/ttyO0", "r+");
        if (fd == NULL){
                printf("Can't open port for GPS!\n");
                return 1;
        }
        else {
                do{
                        memset(temp_buff,0,sizeof(temp_buff));    //reset
the buffer
                        fgets (buff,44,fd);
                if (buff[4]=='M'&&buff[5]=='C'&&buff[17]=='A')
                        {
                                printf ("In the loop \n");
                                fflush(fd);
                                printf ("flushed \n");
                                fclose(fd);
                                printf ("OK\n");

                                memset(temp_buff,0,sizeof(temp_buff));
                                temp_buff[0]=buff[19];
                                temp_buff[1]=buff[20];
                                lattitude_deg = atof (temp_buff);
...



--
View this message in context: http://gumstix.8.n6.nabble.com/close-fd-takes-too-long-tp4966259p4966263.html
Sent from the Gumstix mailing list archive at Nabble.com.

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: close(fd) takes too long

qmay123
In reply to this post by Mipo01
Do you need to open and close for every call of the gps function? Can you leave the stream open and read when needed?

Also fscanf might provide a cleaner (not sure about faster) version of the temp buffer code you have shown.

I saw Jonathan's message while writing this, I agree with him. I'm not familiar with gpsd, but you could also make a class to handle gps data.  Look around I'm sure there are already a lot of gps examples (which I'm sure gpsd is probably a good one).
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: close(fd) takes too long

hiCountryCowboy
In reply to this post by Mipo01
This is an airborne application with very strict data retention specs and unreliable power.  Weight is of utmost concern so packing extra batteries isn't an option.  I am sure there are many more eloquent ways to do the job, but for me, it's simple and it works.   

--- On Mon, 12/17/12, Miner, Jonathan W (US SSA) <[hidden email]> wrote:

From: Miner, Jonathan W (US SSA) <[hidden email]>
Subject: Re: [Gumstix-users] close(fd) takes too long
To: "General mailing list for gumstix users." <[hidden email]>
Date: Monday, December 17, 2012, 5:51 AM

Hi -

Without knowing how your entire application works, it seems odd to open/close the GPS port each time you need GPS data.  You would expect that this should not cause a resource problem, but there is also additional time involved with executing the open/close calls, and associated resource management. Why not use a daemon like gpsd to manage the interface with the GPS and then use the gpsd API to poll for the current location?

I'll admit that I've worked with USB and serial GPS devices, but never with a Gumstix or Gallop board; so maybe my answer doesn't work in this particular situation.
________________________________________
From: Mipo01 [Mipo01@...]
Sent: Monday, December 17, 2012 08:08
To: gumstix-users@...
Subject: Re: [Gumstix-users] close(fd) takes too long

Thank you very much for the response. I tried to change it but the same issue
occurred. It gets stuck on the same point.

Code:

int gps (float* lat1, float* lon1){

                FILE* fd;
        int round = 0;
        int longitude_deg,lattitude_deg,UTC;
        char buff[44],temp_buff[7];
        float longitude_min, lattitude_min;

        fd = fopen("/dev/ttyO0", "r+");
        if (fd == NULL){
                printf("Can't open port for GPS!\n");
                return 1;
        }
        else {
                do{
                        memset(temp_buff,0,sizeof(temp_buff));    //reset
the buffer
                        fgets (buff,44,fd);
                if (buff[4]=='M'&&buff[5]=='C'&&buff[17]=='A')
                        {
                                printf ("In the loop \n");
                                fflush(fd);
                                printf ("flushed \n");
                                fclose(fd);
                                printf ("OK\n");

                                memset(temp_buff,0,sizeof(temp_buff));
                                temp_buff[0]=buff[19];
                                temp_buff[1]=buff[20];
                                lattitude_deg = atof (temp_buff);
...



--
View this message in context: http://gumstix.8.n6.nabble.com/close-fd-takes-too-long-tp4966259p4966263.html
Sent from the Gumstix mailing list archive at Nabble.com.

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
gumstix-users@...
https://lists.sourceforge.net/lists/listinfo/gumstix-users

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
gumstix-users@...
https://lists.sourceforge.net/lists/listinfo/gumstix-users

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: close(fd) takes too long

Fritz Sonnichsen
I am observing a TBOI/OVERO board with a scope and pin 17 appears to
send 0v, 1.8v when toggled with GPIO. It is interfacing with a CMOS/PIC
that requires (I think) a 2.5V  threshold to go from low to high.
I want to use an IC Buffer or inverter such as the CD4049UB, CD4050B.

Sound like a good idea? Interested in what others do.

Thanks
Fritz


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Pin Voltage Conversion 1.8 to 5V

Fritz Sonnichsen
I am observing a TBOI/OVERO board with a scope and pin 17 appears to
send 0v, 1.8v when toggled with GPIO. It is interfacing with a CMOS/PIC
that requires (I think) a 2.5V  threshold to go from low to high.
I want to use an IC Buffer or inverter such as the CD4049UB, CD4050B.
Sound like a good idea? Interested in what others do.

Thanks
Fritz


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: close(fd) takes too long

Fritz Sonnichsen
In reply to this post by Fritz Sonnichsen
SORRY FOR THIS POST-I ACCIDENTLY SENT IT TO SOMEONE ELSES TOPIC when I
tried to "send to list".

Please ignore.

Fritz


On 12/17/2012 11:15 PM, Fritz Sonnichsen wrote:

> I am observing a TBOI/OVERO board with a scope and pin 17 appears to
> send 0v, 1.8v when toggled with GPIO. It is interfacing with a CMOS/PIC
> that requires (I think) a 2.5V  threshold to go from low to high.
> I want to use an IC Buffer or inverter such as the CD4049UB, CD4050B.
>
> Sound like a good idea? Interested in what others do.
>
> Thanks
> Fritz
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> gumstix-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gumstix-users
>


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: close(fd) takes too long

temnick
In reply to this post by Mipo01
Hi,

I have just spotted a couple of things in your original code which might  
or might not be a reason for the problems with close(fd). First, inside  
the loop you write beyond the boundaries of temp_buff array (its size is 7  
and when doing something like temp_buff[7] = ... the data is written after  
the last element of temp_buff). I would also check the code returned by  
read() for actual number of characters read (what will happen if the  
program tries to read beyond the end of file?), and also for errors.

Cheers,
Anton

On Mon, 17 Dec 2012 07:08:07 -0000,  
<[hidden email]> wrote:

> Date: Sun, 16 Dec 2012 10:42:30 -0800 (PST)
> From: Mipo01 <[hidden email]>
> Subject: [Gumstix-users] close(fd) takes too long
> To: [hidden email]
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=us-ascii
> Hi everyone,
> I would like to ask for some suggestions.
> I have looping code where i am using function for reading GPS data from
> Gallop43 board ttyO0 port.
> I have problem that when i try to close port it takes too long. Usually
> around 20 - 30 seconds. First few times immediately and than this problem
> occurred.
> Code:
> int gps (float* lat1, float* lon1){
>        int fd, round = 0;
>         int size,longitude_deg,lattitude_deg,UTC;
>         char buff[70],temp_buff[7];
>         float longitude_min, lattitude_min;
>        fd = open("/dev/ttyO0", O_RDWR | O_NOCTTY | O_NDELAY);
>         if (fd == -1){
>                 printf("Can't open port for GPS!\n");
>                 return 1;
>         }
>         else {
>                 fcntl(fd, F_SETFL, 0);
>                 do{
>                         memset(temp_buff,0,sizeof(temp_buff));    //reset
> the buffer
>                         size = read(fd, buff, 70);
>                 if (buff[4]=='M'&&buff[5]=='C'&&buff[17]=='A')
>                         {
>                                 close(fd);
>                                 printf ("OK\n");
>                                memset(temp_buff,0,sizeof(temp_buff));
>                                 temp_buff[0]=buff[19];
>                                 temp_buff[1]=buff[20];
>                                 lattitude_deg = atof (temp_buff);
>                                memset(temp_buff,0,sizeof(temp_buff));
>                                 temp_buff[0]=buff[21];
>                                 temp_buff[1]=buff[22];
>                                 temp_buff[2]=buff[23];
>                                 temp_buff[3]=buff[24];
>                                 temp_buff[4]=buff[25];
>                                 temp_buff[5]=buff[26];
>                                 temp_buff[6]=buff[27];
>                                 temp_buff[7]=buff[28];
>                                 lattitude_min = atof (temp_buff);
>                                memset(temp_buff,0,sizeof(temp_buff));
>                                 temp_buff[0]=buff[32];
>                                 temp_buff[1]=buff[33];
>                                 temp_buff[2]=buff[34];
>                                 longitude_deg = atof (temp_buff);
>                                memset(temp_buff,0,sizeof(temp_buff));
>                                 temp_buff[0]=buff[35];
>                                 temp_buff[1]=buff[36];
>                                 temp_buff[2]=buff[37];
>                                 temp_buff[3]=buff[38];
>                                 temp_buff[4]=buff[39];
>                                 temp_buff[5]=buff[40];
>                                 temp_buff[6]=buff[41];
>                                 temp_buff[7]=buff[42];
>                                 longitude_min = atof (temp_buff);
>                                memset(temp_buff,0,sizeof(temp_buff));
>                                 temp_buff[0]=buff[7];
>                                 temp_buff[1]=buff[8];
>                                 temp_buff[2]=buff[9];
>                                 temp_buff[3]=buff[10];
>                                 temp_buff[4]=buff[11];
>                                 temp_buff[5]=buff[12];
>                                 UTC = atof (temp_buff);
> memset(buff,0,sizeof(buff));
>                                *lat1=lattitude_deg+(lattitude_min/60);
>                                 *lon1=longitude_deg+(longitude_min/60);
>                        return 0;
>                         }
> round++;
>                 }while(round<300);
> close(fd);
> return 0;
> }
> Thank you very much.

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pin Voltage Conversion 1.8 to 5V

cPhillips
In reply to this post by Fritz Sonnichsen
We built a board that has a MAX3013 chip for level converting. Also a MAX3387E for RS232 comms.

I think even a level converter like this one should work:
https://www.adafruit.com/products/395

-Caleb

On Mon, Dec 17, 2012 at 11:17 PM, Fritz Sonnichsen <[hidden email]> wrote:
I am observing a TBOI/OVERO board with a scope and pin 17 appears to
send 0v, 1.8v when toggled with GPIO. It is interfacing with a CMOS/PIC
that requires (I think) a 2.5V  threshold to go from low to high.
I want to use an IC Buffer or inverter such as the CD4049UB, CD4050B.
Sound like a good idea? Interested in what others do.

Thanks
Fritz


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pin Voltage Conversion 1.8 to 5V

Neil MacMunn
In reply to this post by Fritz Sonnichsen
Hi Fritz,

If you just need to shift one signal you can do so with a mosfet and a couple of resistors. Have a look at sheet 6/10 in the latest Chestnut schematic.


-
Neil


On Mon, Dec 17, 2012 at 8:17 PM, Fritz Sonnichsen <[hidden email]> wrote:
I am observing a TBOI/OVERO board with a scope and pin 17 appears to
send 0v, 1.8v when toggled with GPIO. It is interfacing with a CMOS/PIC
that requires (I think) a 2.5V  threshold to go from low to high.
I want to use an IC Buffer or inverter such as the CD4049UB, CD4050B.
Sound like a good idea? Interested in what others do.

Thanks
Fritz


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pin Voltage Conversion 1.8 to 5V

Curtis Olson-2
In reply to this post by cPhillips
On Tue, Dec 18, 2012 at 10:40 AM, Caleb Phillips <[hidden email]> wrote:
We built a board that has a MAX3013 chip for level converting. Also a MAX3387E for RS232 comms.

I think even a level converter like this one should work:
https://www.adafruit.com/products/395

For what it's worth, I've used the 8 channel adafruit level translator (linked above) and have had success with serial communication, spi communication, and pwm signals for servos.

Regards,

Curt. 
--
Curtis Olson:


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pin Voltage Conversion 1.8 to 5V

garry.allen
I like the lvc family of logic for level conversion. The inputs will operate at up to 5.5V. The 74lvc1g07 is a single gate buffer with an open collector output. Alternatively you can get them in packages with more gates. In both cases, stepping up or stepping down, set the supply voltage of the logic to the lower voltage.
On 19/12/2012, at 4:20 AM, Curtis Olson <[hidden email]> wrote:

On Tue, Dec 18, 2012 at 10:40 AM, Caleb Phillips <[hidden email]> wrote:
We built a board that has a MAX3013 chip for level converting. Also a MAX3387E for RS232 comms.

I think even a level converter like this one should work:
https://www.adafruit.com/products/395

For what it's worth, I've used the 8 channel adafruit level translator (linked above) and have had success with serial communication, spi communication, and pwm signals for servos.

Regards,

Curt. 
--
Curtis Olson:

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pin Voltage Conversion 1.8 to 5V

Fritz Sonnichsen
In reply to this post by Neil MacMunn
Thanks for all the replies. I finally decided to use a conventional BJT with about 10K into the base.  Similar to the MOSFET it probably consumes a few more nA but the pulses are infrequent. This is working quite well.

I am using a voltage divider to send pulses back to the PIC. Again very little current for this application.

Cheers
Fritz

On 12/18/2012 12:11 PM, Neil MacMunn wrote:
Hi Fritz,

If you just need to shift one signal you can do so with a mosfet and a couple of resistors. Have a look at sheet 6/10 in the latest Chestnut schematic.


-
Neil


On Mon, Dec 17, 2012 at 8:17 PM, Fritz Sonnichsen <[hidden email]> wrote:
I am observing a TBOI/OVERO board with a scope and pin 17 appears to
send 0v, 1.8v when toggled with GPIO. It is interfacing with a CMOS/PIC
that requires (I think) a 2.5V  threshold to go from low to high.
I want to use an IC Buffer or inverter such as the CD4049UB, CD4050B.
Sound like a good idea? Interested in what others do.

Thanks
Fritz


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users



------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d


_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Loading...