PDA

View Full Version : Multitasking 12F675 I/O



jpeakall
- 25th November 2003, 20:51
Hi All,

I have been working on a two way wireless temp and humidity sensor. I have it working, and now I am finishing the circuit up prior to making a PCB.

Anyway, I am one pin short of having all the features I want using the 12F675. Can anyone think of way I can fit it all in? Here is the layout.

The remote sensor has an SHT11 and a TX/RXLC 315mHz transmitter/receiver. The 12F is run on 4 "AA" batteries in series through a 2.5Vreg. The TX/RX runs directly off the battery. The battery pack has a tap at the midpoint, i.e.. 2.6V when the pack is fully charged. I monitor the batteries at the
midpoint tap, and multiply it X2 to get the actual battery voltage. It's not perfect, but close enough for government work. The TX unit is run directly from one of the 12F pins so that it can be turned off during reception. This greatly improves range. The rub is I want to add a piezo speaker for remote reception check during placement of the sensor. I could live without it, or
I could use a different PIC, but I'd really like to squeeze it all into the 12F675.

The pin layout is as follows:

GPIO.0 -- ADC for battery monitoring
GPIO.1-- Switches TX off and on
GPIO.2 -- TX data line
GPIO.3 -- RX data line (.3 is input only)
GPIO.4 -- SHT11
GPIO.5 -- SHT11

So basically I am looking for a way to run a piezo speaker. Any ideas how I
could squeeze it all in?

Thanks,

Jonathan

www.madlabs.info

languer
- 26th November 2003, 01:57
Maybe you can multiplex GPIO.1 and GPIO.2 for the speaker.

I explain myself, from the info provided the speaker is meant for reception (i.e. RX). You can drive the speaker from the GPIO.2 (TX.data) 'anded' with the GPIO.1 (with the proper polarities of course). Thus, when the transmitter is off the speaker is on (enabled). Any data on the TX line (GPIO.2) will not be transmitted (since the TX is off) but will be available for the speaker. When the TX is on the speaker is off (disabled), and any data on the TX line is transmitted but does not get to the speaker.

Something like that. Hope it helps anyway.

languer.