bbsnero.blogg.se

Which pins to jump for serial loopback
Which pins to jump for serial loopback








  1. #Which pins to jump for serial loopback install#
  2. #Which pins to jump for serial loopback serial#
  3. #Which pins to jump for serial loopback driver#
  4. #Which pins to jump for serial loopback manual#
  5. #Which pins to jump for serial loopback software#

#Which pins to jump for serial loopback serial#

Once the UART is set up, you can use most of the usual C serial i/o functions, such as printf().

#Which pins to jump for serial loopback software#

The PIC can also can do software RS232, but that is susceptible to mistiming caused by interrupts. The essential line is #use rs232(baud=19200, UART1). If you only want PIC output, you don't need to hook up the PIC input. Connect MAX232N pins 11 & 12 to your PIC. Connect MAX232N pins 13 & 14 (and ground) to a female DB-9 connector as shown, and plug into your PC/laptop's serial port. The chip needs five 1uF capacitors around it, which is not a lot to ask for sparing you two extra supply voltages. You would think that in order to produce 12V signals it would need a +12V power supply, and maybe a negative supply as well, but it doesn't, it produces the needed +12V and -7V internally from a single convenient 5V supply. In fact it has two channels in each direction, should you ever want that many. The MAX232N is a lovely chip that serves this function, in both directions (PC to PIC and PIC to PC). In contrast, be sure that you do connect the PIC's ground to the PC's ground (Black wire).įor interfacing a PIC to a PC/laptop or to a Serial-to-USB Adapter, you need a level converter. If you do that, get rid of any other +5 source. If you wish, you can probably power your PIC from the PC, using USB as a power source. Note that the TTL-232R cable gives you access to the PC's +5 supply (Red wire), which is limited in current (probably to 500mA) by the USB port which is designed to protect from short circuits. YELLOW Rx "PC Receive." Data from PIC Tx (pin 25), to PC. ORANGE Tx "PC Transmit." Data from PC, to PIC Rx (pin 26). The TTL-232R cable has six wires, color coded and in this sequence on the SIP connector:īROWN CTS# Unused.

#Which pins to jump for serial loopback driver#

Also, please check to make sure that the USB-RS232 driver software does not interfere with your PIC's ICD driver software. The only drawback of this cable is that it costs a bit more than the cheaper, less convenient option below. This cable also provides a 5V output which you can use to power an xbee wireless modem, for example (the xbee needs a 3.3V regulator). The circuitry inside the cable takes care of the USB to RS232 as well as voltage-level shifting. You connect the cable's Tx (transmit data) pin with your PIC's Rx (receive data, pin 26), the cable's Rx pin with your PIC's Tx (pin 25), and the cable's ground with the PIC's ground, and you're all set.

#Which pins to jump for serial loopback manual#

You can find a manual for the cable here. The FTDIChip TTL-232R USB to RS232 cable (pictured at right), when used with theĪllows you to use your USB port as an RS232 port. The cheaper cable requires you to solder a DB-9 connector and use an external level-shifter chip, to shift between the high voltages used by the PC and the lower TTL voltages used by the PIC. It also provides +5V output from the PC which you can use to power other devices, such as an xbee radio (just need a 3.3V regulator). The TTL-232R is preferred because you can easily plug it into a protoboard and you don't need any other components to interface with your PIC. We have two different kinds of cables for PC to PIC RS232 communication: the FTDIChip TTL-232R (preferred) and a cheaper USB to RS232 cable. You can also set up your PIC to communicate with a Matlab program on a host PC. It is a Windows ap usually found at Programs/Accessories/Communications/Hyperterminal.

which pins to jump for serial loopback

You can also use Hyperterminal, which actually works somewhat better. The CCS IDE has a built-in text window for this purpose, shown at the bottom of this page. After you make the hardware connection - the PIC's transmit pin sends to the PC/laptop's receive pin and vice versa - you can open a text window on the PC/laptop and see whatever your PIC program prints, and type characters that will be transmitted to your PIC. The 18F4520 PIC has a built-in UART for transmitting and receiving characters on RS232 standard.

#Which pins to jump for serial loopback install#

However you can get an inexpensive "USB to Serial Adapter" cable which makes a COM port available, once you install some driver software to support the adapter cable. These are getting less common on newer computers. Read more about RS232 on wikipedia.Īll desktop and laptop computers used to have a serial or "COM" port, available through a male DB-9 connector.

which pins to jump for serial loopback

The original teletype machines were 110 baud. A typical baud rate is 19200, which is about 10000 times slower than USB. Baud rate refers to the number of bits/second. These are transmitted as 8 consecutive low and high logic levels, with a few framing bits as well. Each of about 100 characters (a, b, c, 1, 2, 3.) has a one-byte ASCII code. RS232 serial communication is an ancient, low speed, reliable standard.










Which pins to jump for serial loopback