Use B4PPC, Bluetooth, Mobile Phone and a Basic Stamp to control a 74HC138.

pdablue

Active Member
Licensed User
Longtime User
Hi,

This example uses Basic4PPC, an LG Fathom mobile phone and a Basic Stamp
to control the pins of a 74HC138 on a circuit breadboard using a wireless
Bluetooth Serial Port Connection. Using Basic4PPC we can write custom
GUI interface programs for any chip that we want to checkout on a circuit
breadboard.

You could use a PDA, Mobile Phone or Tablet device. I used a battery
powered Firefly Bluetooth Serial Port adapter with an RS232 to TTL
converter to get the wireless serial port commands to the Basic Stamp
breadboard circuit. The Basic Stamp is used to control the Address
and Enable lines of the 74HC138.

You can use a similar setup to interface to any breadboard circuit that you
want. The possibilities are endless and Basic4PPC makes it easy.

Basic4PPC combined with a Mobile Device, a wireless Bluetooth connection,
an RS232 to TTL converter and your favorite Microcontroller setup provides
you with a powerfull way to test and check out individual chips and circuit
designs. Once you try this out a few times, you will wonder how you ever
lived without it! Its a whole new way of doing things ...

Below is a picture of the Lab setup that I used to test everything. I used
a Basic Stamp 2p24 module running on a Board of Education PCB with a
74HC138 plugged into the Breadboard and wired up to the Basic Stamp.

Here is a listing of the program code that runs on the Basic Stamp.


' {$STAMP BS2p}
' {$PBASIC 2.5}

serdata VAR Byte
Baud CON 240

INPUT 15

OUTPUT 0
OUTPUT 1
OUTPUT 2
OUTPUT 3
OUTPUT 4
OUTPUT 5

'Address line A0 of the 74HC138 is connected to Basic Stamp output line P0.
'Address line A1 of the 74HC138 is connected to Basic Stamp output line P1.
'Address line A2 of the 74HC138 is connected to Basic Stamp output line P2.
'At Power-up, Initialize Address lines A0,A1,A2 by setting them all Low.

LOW 0
LOW 1
LOW 2

'Active low Enable line 1\ of the 74HC138 is connected to Basic Stamp output line P3.
'Active low Enable line 2\ of the 74HC138 is connected to Basic Stamp output line P4.
'Active high Enable line 3 of the 74HC138 is connected to Basic Stamp output line P5.
'At Power-up, Initialize Enable lines 1\,2\,3 to their inactive states.

HIGH 3
HIGH 4
LOW 5

Main:

DO
SERIN 15,Baud,[serdata]

'Character A was received. Set lines P0,P1,P2 equal to Address: 000
IF serdata=65 THEN
LOW 0
LOW 1
LOW 2
ENDIF

'Character B was received. Set lines P0,P1,P2 equal to Address: 001
IF serdata=66 THEN
HIGH 0
LOW 1
LOW 2
ENDIF

'Character C was received. Set lines P0,P1,P2 equal to Address: 010
IF serdata=67 THEN
LOW 0
HIGH 1
LOW 2
ENDIF

'Character D was received. Set lines P0,P1,P2 equal to Address: 011
IF serdata=68 THEN
HIGH 0
HIGH 1
LOW 2
ENDIF

'Character E was received. Set lines P0,P1,P2 equal to Address: 100
IF serdata=69 THEN
LOW 0
LOW 1
HIGH 2
ENDIF

'Character F was received. Set lines P0,P1,P2 equal to Address: 101
IF serdata=70 THEN
HIGH 0
LOW 1
HIGH 2
ENDIF

'Character G was received. Set lines P0,P1,P2 equal to Address: 110
IF serdata=71 THEN
LOW 0
HIGH 1
HIGH 2
ENDIF

'Character H was received. Set lines P0,P1,P2 equal to Address: 111
IF serdata=72 THEN
HIGH 0
HIGH 1
HIGH 2
ENDIF

'Character I was received. Set P3 High, to set Enable 1\ line High.
IF serdata=73 THEN
HIGH 3
ENDIF

'Character J was received. Set P3 Low, to set Enable 1\ line Low.
IF serdata=74 THEN
LOW 3
ENDIF

'Character K was received. Set P4 High, to set Enable 2\ line High.
IF serdata=75 THEN
HIGH 4
ENDIF

'Character L was received. Set P4 Low, to set Enable 2\ line Low.
IF serdata=76 THEN
LOW 4
ENDIF

'Character M was received. Set P5 High, to set Enable 3 line High.
IF serdata=77 THEN
HIGH 5
ENDIF

'Character N was received. Set P5 Low, to set Enable 3 line Low.
IF serdata=78 THEN
LOW 5
ENDIF

LOOP ' repeat forever
END
 

Attachments

  • resized_cg138pic1.jpg
    resized_cg138pic1.jpg
    76.4 KB · Views: 503
  • resized_cg138pic2.jpg
    resized_cg138pic2.jpg
    40.3 KB · Views: 445
  • chip138.sbp
    10.9 KB · Views: 365
  • CHIPGUI_138_INSTALL.zip
    170.3 KB · Views: 337
  • LabHC138r.jpg
    LabHC138r.jpg
    87 KB · Views: 417
Last edited:

Beja

Expert
Licensed User
Longtime User
Sorry duplicate
 
Last edited:

Beja

Expert
Licensed User
Longtime User
Hi,
I am not using basic4ppc, but I thought you may use Select Case serdata, instead of a long list of IF-THEN.
I have Board of Education and will try, if had time, to port your project to b4a.. I think for me is much easier since I never used B4PPC.
 
Top