CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PDA application

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
adrian



Joined: 08 Sep 2003
Posts: 92
Location: Glasgow, UK

View user's profile Send private message

PDA application
PostPosted: Fri Nov 25, 2005 7:01 am     Reply with quote

I have been asked to look into a new design and want to 'bounce' a few ideas around before I get started.

I want to connect a PIC to the RS232 connection of a PDA. The PIC has to be powered via the RS232 lines and be able to use its internal USART to communicate with the PDA. Anybody know what the output voltage swing of an RS232 port on a typical PDA is? I don't even have one to measure.

I was thinking of using the 16F627A/628A/648A or 16F688, as these are the smallest PIC's I can find with a USART. My first thought was to put it to sleep and wake it through the RDA interrupt. Is it possible to do this? I have hunted throught the data sheet and found the following - but I need clarification.

From section 14.5 shows that the USART has an interrupt capability.
From section 14.8.1 shows that the device can wake up from sleep through ...... any peripheral interrupt which is active in sleep.
But
From section 12.2 the baudrate generator is used to derive baud rate frequencies from the oscillator.
From section 14.8 the #TO bit is set and the oscillator driver is turned off.

So it looks to me as if when in sleep, the oscillator is off, hence the BRG is off. So if an RDA interrupt occurs, the device will have to wakeup, restart the internal oscillator - which takes time - so I have possibly missed some if not all the incomming data.

Anybody got any thoughts?
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Fri Nov 25, 2005 8:47 am     Reply with quote

Can you arrange for the PDA to send a "wake-up" signal of a few "U"'s or "^C"'s then pause before sending a real message? This is fairly common in oceanographic equipment.
_________________
The search for better is endless. Instead simply find very good and get the job done.
adrian



Joined: 08 Sep 2003
Posts: 92
Location: Glasgow, UK

View user's profile Send private message

PostPosted: Fri Nov 25, 2005 8:57 am     Reply with quote

SherpaDoug wrote:
Can you arrange for the PDA to send a "wake-up" signal of a few "U"'s or "^C"'s then pause before sending a real message? This is fairly common in oceanographic equipment.


That shouldn't be a problem, I'll talk to the guys who are going to write the PDA software.

What I really wanted to know is, can I wake the PIC up using this approach? I don't have a 16F627A yet to try.
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Fri Nov 25, 2005 9:02 am     Reply with quote

If you make it as far as needing a simple Palm app to test your hardware, B&B has a freebie starting point PalmTerm for download.

http://www.bb-elec.com/product.asp?sku=palmterm

I'm not sure if I would try to derive my power from the PDA. I guess it would depend on what else you're going to have to power besides the PIC. You may want to think about a powered cable?

Good luck,

John
adrian



Joined: 08 Sep 2003
Posts: 92
Location: Glasgow, UK

View user's profile Send private message

Re: PDA application
PostPosted: Mon Nov 28, 2005 7:06 am     Reply with quote

me wrote:

So it looks to me as if when in sleep, the oscillator is off, hence the BRG is off. So if an RDA interrupt occurs, the device will have to wakeup, restart the internal oscillator - which takes time - so I have possibly missed some if not all the incomming data.


Its actually worse than this.... When the PIC is put to sleep, an INT_RDA wont wake it! This is on a 16F628 - non A - version, as it was all I could find. I am assuming that this will be the same for the 'A' part?

The only way I could get it to work, was to tie the RxD (B1) to the external interrupt (B0), so that an incomming character would wake up the devive.

jecottrell wrote:
I'm not sure if I would try to derive my power from the PDA. I guess it would depend on what else you're going to have to power besides the PIC. You may want to think about a powered cable?

Can't used a tethered cable as it is supposed to be a mobile application.

If anyone has a PDA out there, can they measure what the output voltage swing of the RS232 port is, and report back.

Thanks
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Mon Nov 28, 2005 8:32 am     Reply with quote

Use the IRQ line tied to the receive pin (in addition to it going to the RX pin of your UART). Just before you go to sleep, enable the wake-on-interrupt feature. Then when you wake up, turn off the IRQ until the next time you go to sleep.

Good chance you will miss the first word though. You might have to set up the PDA to ping the PIC a few times, waiting for an ACK back before proceeding.
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Mon Nov 28, 2005 10:49 am     Reply with quote

Quote:
Can't used a tethered cable as it is supposed to be a mobile application.


Sorry, should have been more precise. I've seen specialized cables (data-lump) with a small enclosure in-line that contains a 9v battery and required circuitry.

UPS tracking indicates my brand new Fluke 199 will arrive this afternoon. I will attempt to get a reading on a PalmIII XE if I get a chance. What type of PDA do you plan on utilizing?

Here is page that may shed some light: (pertinent info is about half way down)

http://www.pspilot.de/pppm100/pppm100.html

What sort of power is your application going to require from the PDA?

John
Guest








PostPosted: Mon Nov 28, 2005 12:38 pm     Reply with quote

rwyoung wrote:
Use the IRQ line tied to the receive pin (in addition to it going to the RX pin of your UART). Just before you go to sleep, enable the wake-on-interrupt feature. Then when you wake up, turn off the IRQ until the next time you go to sleep.

Yup that's what I did - see above.

rwyoung wrote:
Good chance you will miss the first word though. You might have to set up the PDA to ping the PIC a few times, waiting for an ACK back before proceeding.

Thanks for the heads up I'll check on that.

jecottrell wrote:
I will attempt to get a reading on a PalmIII XE if I get a chance. What type of PDA do you plan on utilizing?

Thanks, I'm actually planning on using a Pocket PC rather than a Palm, as it has to do other stuff as well. But I'm sure they will use the same type of drivers.
adrian



Joined: 08 Sep 2003
Posts: 92
Location: Glasgow, UK

View user's profile Send private message

PostPosted: Wed Nov 30, 2005 6:25 am     Reply with quote

jecottrell wrote:
UPS tracking indicates my brand new Fluke 199 will arrive this afternoon. I will attempt to get a reading on a PalmIII XE if I get a chance.

John has you meter arrived yet?
Tut
Guest







PostPosted: Wed Nov 30, 2005 6:51 am     Reply with quote

A word of caution ...

I can't speak for the Pocket PC, but the serial ports for Palm-based PDAs are not all alike. Some applications that we had using Palm Pilots worked fine plugging into our 3-wire RS232 port to a PIC, but when I tried the serial cable for my Palm-based Treo 600 phone, I found out that the RS232 xcvr IC is in the serial cable and draws its power from the RS232 control lines.

Tut
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Wed Nov 30, 2005 8:13 am     Reply with quote

This comment is specific to Palm but may apply to other PDA's.
The good news is that a used palm PDA can be obtained for trash metal prices. The bad news is Palm is paranoid and provides almost no hardware documentation which is perhaps one reason why a used Palm is as valuable as a week old hamburger. I joined Palm's developer program thinking I might get a schematic but no luck. PDA's are useful graphic interfaces..you get a touchscreen 8K or more of ram/rom RS232 ( well sort of) since they only care to have it talk to Palm cradles some of which are passive and some powered even providing an ethernet interface and all for about $20 used. You'll find you'll need your DVM and scope to tease out the details of interfacing. There is little on the WEB about the internals of Palm PDA's ..Palm could be supressing it with patent and copyright enforcement I don't know but be careful about publishing what you find.
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

RE:
PostPosted: Wed Nov 30, 2005 8:00 pm     Reply with quote

Hi,

RS 232 voltage levels are usually between 5 to 12 Volts, my desktop PC has 12 Volts and my Laptop has +5 V. Your application must cater for the lowest possible voltage.

thanks
arunb
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Wed Nov 30, 2005 8:39 pm     Reply with quote

Adrian,

Sorry I didn't get back to you. I got busy and missed several of the posts in the thread. I just saw that it came back up.

I just put the scope on a PALM IIIxE and this is for the data coming out of the palm: It idles at -5.5v and swings to +6v during the transmission.

I would heed the advice to verify whatever hardware you plan on using.

Good luck,

John
adrian



Joined: 08 Sep 2003
Posts: 92
Location: Glasgow, UK

View user's profile Send private message

PostPosted: Thu Dec 01, 2005 7:05 am     Reply with quote

Thanks guys I appreciate the replies.

We have used the HP iPAQ devices in the past, and the Engineering PDA is out on loan - so got another one on order. In the meantime I have been trying to get info out of HP - nightmare. After getting very dizzy going round their web site, I gave up and spoke to their tech support. It would seem that I will have to sign up to their developers network at a cost of $199 - and I only get to ask ONE question! They have got it sewn up like the Palm stories Douglas mentioned.

OK it looks like +/- 5V should be a starting point. Tap it off through an LDO and run the PIC at 3V3 - which will also cut the current requirment. Time to start sharpening my pencil until the iPAQ arrives.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group