This is a simple application note to show how easy it is to use the new ENC-S40 encoder IC connected to the PC serial port. I have included a simple Visual Basic program example below with full source code.
To view the schematic, click the small diagram below. We've reduced the drawing to thumbnail size for faster page loading. The full schematic is also available in the ENC-S40 data sheet found HERE.
The sample circuit above uses the TWS-434A RF transmitter, however, any RF transmitter should work just as well. Be sure if you're using the PWR output pin to power your transmitter that the power requirement of your transmitter is below the PWR output pins 25mA max.
Below is a screen shot of the application software. Note this can easily be expanded to send different bit patterns to a Holtek HT648L or HT658 decoder IC, and of course you can modify the VB combo box to use the full 10-bit address from 0 to 1023.
For this example I've setup the combo box to select addresses from 0 to 255 which should suffice for most any application.
The raw VB source code can be downloaded HERE. The ENCS40.exe file is pre-compiled & ready to run, but requires the use of comm1. If your PC does not have comm1 available, you'll need to modify & re-compile the project to use your available comm port.
The Comm Port drop-down menu allows selection of ports 1 through 5, but the form load routine defaults to comm1.
|The VB software is
very simple. ON/OFF buttons on the form, when clicked, will send the
synchronization character A, followed by the address shown in the Receiver
Address window of the VB combo box, and then the data to be placed on the
Private Sub cmdD0ON_Click()
Examine the VB source code to see how the remaining ON/OFF buttons work, and what values are sent when buttons are clicked
The SLEEP button will place the ENC-S40 in sleep mode, and the WAKE UP button causes the ENC-S40 to exit sleep mode for normal operation.
The PC serial port DTR signal is used to force entry & exit from sleep mode by connecting to the ENC-S40 sleep input pin as shown in the schematic above. The ENC-S40 CTS pin connects to the PC serial port CTS input signaling Clear To Send for hardware handshaking.
The VB software should be easy to modify for any application using the ENC-S40 in combination with the Holtek HT648L & HT658 8-bit series decoder IC's.
|Order The ENC-S40 encoder IC HERE|