8/3/2017 0 Comments Making A Serial Loopback PlugA sound card (also known as an audio card) is an internal expansion card that provides input and output of audio signals to and from a computer under control of.Next Thing Co Documentation. Welcome to The CHIP Operating System. We made a computer. A $9 computer. And every computer needs an operating system. Ours is The CHIP Operating System. Grab an old TV (or any screen with a composite video input), a keyboard and mouse, and stick some electricity in the micro USB port. In a few seconds, you’ll have CHIP’s operating system on your screen, ready to do computer things. CHIP is built for making - we’ve packed a powerful processor, 4 GB of storage, stereo audio, video out, and lots of connections for playing and making your projects and products. The CHIP Operating System is built for doing: browse the . And because it’s based on the popular Linux Debian, if there’s something you need, you can probably install it. So how do use this thing? Let’s get started. Start CHIP. Boot CHIP. HP Linux Imaging and Printing Print, Scan and Fax Drivers for Linux. How to get RS232 communications working between your computer and measuring device: RS232 pin connections, testing, serial port notes, handshaking. How to build a 5-in-1 network admin's cable. First things first. Let’s boot CHIP into the CHIP Operating System and do some computer things! Add some power, turn on the wireless network, and even connect a bluetooth keyboard to get rid of those annoying cables. Power Up. The single most important thing to using any electronic device is getting electricity to the right places. We’re going to cover how to turn CHIP “on”. This might seem so straightforward that it doesn’t deserve several paragraphs, but CHIP is pretty clever, so there’s actually a few things worth knowing. What’s It Need? In general, CHIP is powered by a 5- volt source like a USB port or phone charger, and draws about 5. A peak (at boot time), runs on around 2. Serial Terminal Overview. Flow control. These are all words that get thrown around a lot when working with electronics, especially. A, and rests with around 8. A with the processor totally unloaded. To make sure you have enough headroom, we recommend that you use a 5v power supply with 2 Amps current available (you could go as low as 9. A, but you risk brown- outs). This may be more than you need to know if you just want to plug it in to the wall, but, as you build projects with CHIP, you’ll be happy to know there’s a lot of ways to get the electricity flowing. How Do I Know CHIP Is On? CHIP is silent. It doesn’t take much energy, so it’s not very hot. It has no discernible smell. As a result, many of your senses are not great indicators that it is working. There are two LEDs next to the USB micro connector. When CHIP is on, you should see the PWR LED light up nice and bright. Power From The Wall. The CHIP’s micro. USB connector is used to provide power from most any USB power source. USB wall- wart adapters are probably littered all over your house. If for some reason you don’t have one, you can buy one at any electronics retailer. We recommend a 5. V powersupply with 2 Amps current available. Just plug a USB- A- to- micro. USB- B cable (that’s the same cable most phones, tablets, and whatnot use to charge) into the wall- wart and CHIP, and you’ll see the PWR LED light up. This CHIP is using the power from a computer’s USB port: Power From A Battery. CHIP can also be battery powered. Specifically, any single cell (1. S) 3. 7. V Lithium Polymer (Li. Po) battery with a 2- pin JST- PH 2. JST- PH socket. The JST can only plug it in one way: if you are having a hard time lining things up, turn it around! Needless to say, do not force the battery connector into the socket if something doesn’t feel right! If you have added a connector to your own battery, make sure you have the JST wired correctly: the (- ) connection should be on the outside edge of CHIP. What’s really great is that if you plug in to a charger and plug in a battery, the battery will charge - all the power management is on CHIP itself. Roughly, it takes about four to six hours to charge a 3. Ah Li. Po battery from a 5. V 2. A power source. Also, our delightful little Power Management IC, the AXP2. CHIP is basically running on a un- interruped power supply – If charge power fails, CHIP seamlessly switches onto battery power without shutting off. Now you’re ready to connect CHIP to a screen, keyboard and mouse or even work on CHIP from another computer. Button. There is a tiny tiny button on CHIP next to pin header U1. CHIP on or off. If CHIP is off and connected to a power source, hold down the button for one second to power it up. To turn CHIP off (rather brutally), hold the button for 1. We recommend using the operating system to power CHIP off, but if you need to, you can use this button. Connect To Wi. Fi. Connecting to a Wi. Fi network is easy using the Wi. Fi icon the top right system tray. Just select a network to initiate a connection. If the network requires a password you’ll be prompted for it. You can also set up Wi- Fi from the command line. If you need more control and information over your network connection, use the Settings- > Network Connections panel to show your connections. Double click on a connection to bring up the connection editor: Connect Bluetooth. Bluetooth device setup can be accessed using the Bluetooth icon in the top right system tray. When you begin a connection, you’ll be guided through the necessary steps to connect to your device. For example, when you pair with a keyboard, you’ll often be prompted for a code to enter to ensure a unique connection. Once you have paired a device, future connections will usually be automatic when the devices are in range and powered up. You can manage, and also connect to, your devices using the the Bluetooth Devices panel, accessed from the Bluetooth system tray: Using The Terminal. One of the great powers of Linux is the so- called “command- line.” This simple text interface for computing unveils many of the gears and levers that make a computer tick. Many find it easier to get things done, as it is a focused and terse way to interact with the computer. When you first use the Terminal Emulator program, you may quickly find that you do not have permission to do something. That is because many commands are safely reserved for “root” access, and you are automatically logged in as the “chip” user. Don’t fear: you can often use the sudo command and use the default password chip to execute these restricted commands. Finally, it is probably wise to change the default password on your CHIP. You can do with withpasswd. Don’t forget it!! If you are such a fan of the command line, you may want to boot with out the desktop and window system. Instructions for that are here. Terminal for Beginners Glossary. One of the great things about Linux is the terminal application. You can simply add - h to get some hints on how to use a command, such as cp - h or you can read a manual page using man cp. Most unix commands have a variety of options that can be executed in the command with flags, such as ls - l - a. Even better, search the internet! This primer is simply here to help you understand what a command might be doing, not to help you use it to its full ability. Some options are ls - l to list in long format to provide information about permissions, size, and date. Ex: mv this. one that. Ex: cp this. one this. Add directories for more fun: cp ~/Pictures/Vacation/saturn. Users/otherone/Pictures/Vacation/saturn. Use the - r to make it recursive to delete a directory. Ex: rm this. one deletes that file. You’ll see sudo as the first word in a lot of commands - all it is doing is giving the command the necessary access. You’ll be asked for a password the first time you use sudo. The default password and user is “chip”. Debian Linux systems, such as the CHIP Operating System. And so on. pwd present working directory. In case you forget where you are. Not much to it: pwd will output the directory name, such as /Users/home/chip/Pictures/Vacation/grep a tool used for searching through files. It’s quite deep and can be complicated, but if you see the word grep in some command, you know it’s searching for a match. Merge files: cat append. Overwrite: echo . Display text in file: cat showit. Create: cat > new. Ex: less longtext. Use the space bar to view the next page. Type q to exit. nano a text editor. You’ll often see commands that call nano so you can edit a configuration. Ex: nano /etc/avahi/services/afpd. Apple file service file. Ex: find ~/Documents - name particular. Documents directory. Used for file permissions, which can be important when sharing things on the network, scripting actions, and many more reasons. If things seem slow, or you want to see how much CPU or memory a program is using, just type htop to see a table of all running processes, then type q when you want to exit. Ex: scp Pictures/Vacation/motel. Pictures/Vacation/accident. Pictures copies a couple jpegs to another computer on the network. Ex: ssh chip@chip. CHIP on a local network. CTRL C if you can’t use the terminal because a process is taking too long, type CTRL- C on your keyboard to cancel the most recent command. Connecting Accessories. CHIP has a lot of connectors, some for building, some for doing normal computer things. This section covers the normal computer things, like audio, video, and input. Recommended Accessories. CHIP is a minimal computer. Many CHIP users may never connect common peripherals, instead using CHIP as a “headless” computer. We recommend: Bluetooth Keyboard. USB mouse. Monitor with a composite video input. USB cable: USB- A to micro. USB- BTRRS to RCA connector. A, 5. V USB power supply. Additionally, some of the advanced tutorials require: Speakers with RCA audio input. Jumper wire. USB to UART cable. Single cell Lithium Polymer battery. Powered USB Hub. You’ll find that a simple powered USB hub is pretty essential if you want to use a lot of USB devices with CHIP. If you don’t have a powered USB port, you’ll quickly max out power if you attach too many accessories. Keyboard and Mouse. Many keyboards have USB hubs built- in, so you can attach a mouse to the keyboard, attach the keyboard to CHIP, and immediately have control. However, it’s likely the two will draw too much current, so you’ll want to connect to a powered hub before you connect. Bluetooth Keyboard and Mouse. As you know, CHIP has built- in bluetooth. If you want to use a keyboard and mouse, you can keep your USB port free for other things (like mass storage or a MIDI controller!) and keep your desk clean. Interfacing The Serial / RS- 2. Port. Interfacing the Serial / RS2. Port. The Serial Port is harder to interface than the Parallel Port. In most cases. any device you connect to the serial port will need the serial transmission. This can be done using a. UART. On the software side of things, there are many more registers that you. Standard Parallel Port. The serial port transmits a '1' as - 3 to - 2. Therefore the serial port can have a maximum swing of 5. V compared to the parallel port which has a maximum swing of 5 Volts. Therefore cable loss is not going to be as much of a problem for serial cables than they are for parallel. If your device needs to be mounted a far distance away from the computer then 3 core cable (Null Modem Configuration) is going to be a lot cheaper that running 1. However you must take into account the cost of the interfacing at each end. You may of seen many electronic diaries and palmtop computers which have infra red capabilities build in. However could you imagine transmitting 8 bits of data at the one time across the room and being able to (from the devices point of view) decipher which bits are which? Therefore serial transmission is used where one bit is sent at a time. Ir. DA- 1 (The first infra red specifications) was capable of 1. UART. The pulse length however was cut down to 3/1. RS2. 32 bit length to conserve power considering these devices are mainly used on diaries, laptops and palmtops. Many of. these have in built SCI (Serial Communications Interfaces) which can be. Serial Communication reduces the pin. MPU's. Only two pins are commonly used, Transmit Data (TXD). Receive Data (RXD) compared with at least 8 pins if you use a 8 bit. Parallel method (You may also require a Strobe). It only requires 3 wires. TD, RD & SG) to be wired straight through thus is more cost effective to. The theory of operation is reasonably easy. The. aim is to make to computer think it is talking to a modem rather than. Any data transmitted from the first computer must be. TD is connected to RD. The second computer. RD is connected to TD. Signal Ground (SG). When the Data Terminal Ready is asserted active, then the. Data Set Ready and Carrier Detect immediately become active. At this point. the computer thinks the Virtual Modem to which it is connected is ready and. As. both computers communicate together at the same speed, flow control is not. When. the computer wishes to send data, it asserts the Request to Send high and. Clear to Send, It immediately gets a reply. As we don't have a modem connected to the phone line this. Figure 2 : Loopback Plug Wiring Diagram. This loopback plug can come in extremely handy when writing Serial / RS2. Communications Programs. It has the receive and transmit lines connected. Serial Port is. immediately received by the same port. If you connect this to a Serial Port. Terminal Program, anything you type will be immediately displayed. This can be used with the examples later in this tutorial. Please note that this is not intended for use with Diagnostic Programs and. For these programs you require a differently. Loop Back plug which may vary from program to program. A typical Data Terminal. Device is a computer and a typical Data Communications Device is a Modem. DTE to DCE is. the speed between your modem and computer, sometimes referred to as your. This should run at faster speeds than the DCE to DCE speed. Therefore we should. DCE to DCE speed to be either 2. K or 3. 3. 6. K. Considering the. DTE to DCE speed to be. BPS.(Maximum Speed of the 1. UART) This is where some. The communications program. DCE to DTE speeds. However they see 9. KBPS, 1. 4. 4 KBPS etc and think it is your modem speed. This is very. much like PK- ZIP but the software in your modem compresses and decompresses. When set up correctly you can expect compression ratios of 1: 4 or. If we were. transferring that text file at 2. K (DCE- DCE), then when the modem. KBPS between computers and. DCE- DTE speed of 1. KBPS. Thus this is why the DCE- DTE should. Lets say. for example its on a new 3. KBPS modem then we may get a maximum 2. BPS transfer between modem and UART. If you only have a 1. BPS tops, then you would be missing out on a extra bit of. Buying a 1. 6C6. 50 should fix your problem with a maximum transfer. BPS. These are. MAXIMUM compression ratios. In some instances if you try to send a already. If this. occurs try turning. This should be fixed on newer modems. Some files. compress easier than others thus any file which compresses easier is. Sooner or later data is. Flow control has two basic. Hardware or Software. Xon is normally indicated by the ASCII 1. ASCII 1. 9 character is used for Xoff. The modem will only have a small. Xoff character to. Once the modem has room for more. Xon character and the computer sends more data. This. type of flow control has the advantage that it doesn't require any more. TD/RD lines. However on slow links. It uses two. wires in your serial cable rather than extra characters transmitted in your. Thus hardware flow control will not slow down transmission times. Xon- Xoff does. When the computer wishes to send data it takes active. Request to Send line. If the modem has room for this data, then the. Clear to Send line and the computer. If the modem does not have the room then it will not. Clear to Send. Its the little. Most cards will have the UART's. The 8. 25. 0 series, which includes the 1. UARTS are the most commonly found type in your PC. Later we will look at. The only two differences. On the 8. 25. 0 Pin 2. Pin 2. 9 was not. UARTs. These are Transmit Ready. Receive Ready which can be implemented with DMA (Direct Memory Access). Mode 0 supports single. DMA where as Mode 1 supports Multi- transfer DMA. This mode is selected when the FIFO. Bit 0 of the FIFO Control Register or When the. FIFO buffers are enabled but DMA Mode Select = 0. RXRDY will go inactive high when no more characters are. Receiver Buffer. TXRDY will be active low when there are no. Transmit Buffer. It will go inactive high after the. Transmit Buffer. In. Mode 1, RXRDY will go active low when the trigger level is reached or when. Time Out occurs and will return to inactive state when no more. FIFO. TXRDY will be active when no characters. Transmit Buffer and will go inactive when the FIFO. Transmit Buffer is completely Full. That includes TD, RD, RI, DCD, DSR. CTS, DTR and RTS which all interface into your serial plug, typically a. D- type connector. Therefore RS2. 32 Level Converters (which we talk about in. These are commonly the DS1. Receiver and the DS1. PC has +1. 2 and - 1. The. RS2. 32 Converters will convert the TTL signal into RS2. Logic Levels. The frequency of this input should equal the receivers baud rate * 1. Pin 1. 0RDReceive Data. Pin 1. 1TDTransmit Data. Pin 1. 2CS0. Chip Select 0 - Active High. Pin 1. 3CS1. Chip Select 1 - Active High. Pin 1. 4n. CS2. Chip Select 2 - Active Low. Pin 1. 5n. BAUDOUTBaud Output - Output from Programmable Baud Rate Generator. Frequency = (Baud Rate x 1. Pin 1. 6XINExternal Crystal Input - Used for Baud Rate Generator Oscillator. Pin 1. 7XOUTExternal Crystal Output. Pin 1. 8n. WRWrite Line - Inverted. Pin 1. 9WRWrite Line - Not Inverted. Pin 2. 0VSSConnected to Common Ground. Pin 2. 1RDRead Line - Inverted. Pin 2. 2n. RDRead Line - Not Inverted. Pin 2. 3DDISDriver Disable. This pin goes low when CPU is reading from UART. Can be connected to Bus Transceiver in case of high capacity data bus. Pin 2. 4n. TXRDYTransmit Ready. Pin 2. 5n. ADSAddress Strobe. Used if signals are not stable during read or write cycle. Pin 2. 6A2. Address Bit 2. Pin 2. 7A1. Address Bit 1. Pin 2. 8A0. Address Bit 0. Pin 2. 9n. RXRDYReceive Ready. Pin 3. 0INTRInterrupt Output. Pin 3. 1n. OUT2. User Output 2. Pin 3. 2n. RTSRequest to Send. Pin 3. 3n. DTRData Terminal Ready. Pin 3. 4n. OUT1. User Output 1. Pin 3. 5MRMaster Reset. Pin 3. 6n. CTSClear To Send. Pin 3. 7n. DSRData Set Ready. Pin 3. 8n. DCDData Carrier Detect. Pin 3. 9n. RIRing Indicator. Pin 4. 0VDD+ 5 Volts. Table 2 : Pin Assignments for 1. A UART. The UART requires a Clock to run. If you look at your serial card a. MHZ or a 1. 8. 4. MHZ Crystal. This clock. Programmable Baud Rate Generator which directly. For this an external connection mast be made from. Baud. Out) to pin 9 (Receiver clock in.) Note that the clock signal. Baudrate * 1. 6. Data. PDF format so you will need Adobe Acrobat Reader to. Texas Instruments has released. UART which has 6. Byte FIFO's. Data Sheets for the TL1. C7. 50 are. available from the Texas Instruments Site. It contains no scratch register. The 8. 25. 0A was an improved version of the 8. AThis UART is faster than the 8. Looks exactly the same to software than 1. BVery similar to that of the 8. UART. 1. 64. 50. Used in AT's (Improved bus speed over 8. Operates comfortably at 3. KBPS. Still quite common today. This was the first generation of buffered UART. It has a 1. 6 byte buffer, however it doesn't work and is replaced with the 1. A. 1. 65. 50. AIs the most common UART use for high speed communications eg 1. K & 2. 8. 8. K Modems. They made sure the FIFO buffers worked on this UART. Very recent breed of UART. Contains a 3. 2 byte FIFO, Programmable X- On / X- Off characters and supports power management. Produced by Texas Instruments. Contains a 6. 4 byte FIFO. Part Two : Serial Port's Registers (PC's)Name Address. IRQCOM 1 3. F8 4. COM 2 2. F8 3. COM 3 3. E8 4. COM 4 2. E8 3. Table 3 : Standard Port Addresses. Above is the standard port addresses. These should work for most P. C's. If. you just happen to be lucky enough to own a IBM P/S2 which has a. IRQ's. Each address will take up 2 bytes. The. following sample program in C, shows how you can read these locations to obtain. This is how the. UART is able to have 1. DLAB stands for Divisor Latch Access Bit. When DLAB. is set to '1' via the line control register, two registers become available. UART incorporates a divide by 1. Assuming we had the 1. MHZ clock signal, that would. UART capable of. transmitting and receiving at 1. Bits Per Second (BPS).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
August 2017
Categories |