Tag archives for RS232

Controlling a PIC Microcontroller from a PC Graphical User Interface (GUI)

image-2345
A Graphical User Interface is a man-machine interface device, in which objects to handle are drawn as icons on the screen, so the user can send controls by by a pointing device, usually a mouse or a keyboard. It is always easy and require less skills to operate a device from a visual representations of the workspace (GUI) by simply clicking a mouse or using a keyboard rather than a command line. In this article we are going to design a Graphical User Interface using Microsoft Visual C#. This software could be installed in any computer running windows operating systems. The computer will connect to the microcontroller using an RS232 serial cable. The PIC microcontroller will receive commands from the computer to control devices connected to it such as motors, LEDs etc.

MPLAB® Code Configurator

image-1477
The MPLAB® Code Configurator (MCC) is a user friendly Graphical User Interface (GUI) plug-in tool for MPLAB® X IDE which generates easy to understand C code that is inserted into an MPLAB® X project, based on the settings peripherals configurations and selections made in the Graphical User Interface (GUI). The generated code can be used in any application program. When starting out with a new project using Microchip 8-bit microcontrollers, setup of the configuration and all the peripherals can be time consuming, especially for new projects. The MPLAB® Code Configurator simplifies this down to a series of simple graphical selections from the menus within the MCC.

Digital Clock using PIC Microcontroller Interrupt – XC8

image-155
Real Time Clock and Calendar functions are very important in many projects especially in data logging devices where a real time stamp is required in each record. This clock uses Timer 1 to implement software real time and clock functions. A Real Time clock (Digital Clock) can be made easily by using Timer 1 of a PIC Microcontroller. The Timer1 module exists in most of the series of PIC, this module can be used to easily implement a real-time clock. Instead of an external real-time clock device like a DS1307, an inexpensive 32.768 kHz watch crystal and two 33 pF capacitors are used to complete the circuit. In this application, Timer 1 is clocked by an external crystal (32.768 kHz) connected across RC0 (T1OSO) and RC1 (T1OSI).

Temperature Logger to SD Card with Menu Control – MikroC

image-180
An SD Card can be used to log data continuously over time for various purposes, this project shows the design of a temperature data logger with menu control system. The ambient temperature is read every minute and stored in a file on an SD card. When the program starts, the user is given three options: Saving the temperature readings to a new file on an SD card, Appending the temperature readings to an existing file or Sending all the saved file contents to a PC The user will have to choose one option and then press enter to start logging data. This menu only accessible once when the program starts, if the user wants to choose another option, he/she has to restart the program by pressing the reset button.

USB Communication Device Class with PIC Microcontroller – MikroC

image-329
The CDC device class code is "0x02, this class defines various communications over USB. The CDC class can be used to emulate the RS232 serial port (COM Port) and thus creating an easy solution to migrate the application from an old RS232 to the Universal Serial Bus (USB) interface without implementing many changes especially to the PC software. The device will create a virtual COM. The current MikroC Pro for PIC version 6.0.0 does not have a built in USB CDC library in the compiler, but you can download the USB Device Library from LIBSTOCK. This library supports the USB HID Class, the USB CDC Class and the USB Mass Storage Device Class. The file you are going to download has an .mpkg extension. You need the package manager to integrate this USB library into the MikroElekronika compilers. You can download the latest package manager from MikroElekronika website.

USB Serial Communication with PIC Microcontroller – Flowcode

image-369
Many computers especially portable ones do not have a serial port (COM Port) anymore. When a connection to a Personal Computer (PC) is required, a USB is the choice. The Universal Serial Bus (USB) is the widely used interface in electronic consumer products today. Most of electronic devices have at least one USB port on them, this include PCs, cameras, GPS devices, printers and so on. In this article we are going to learn how to set up a serial communication between a microcontroller and a PC using a USB port by creating a virtual COM Port. Some PIC18 microcontrollers support USB interface directly. For example, the PIC18F25K50, PIC18F4450 and PIC18F4550 microcontrollers just to name a few all have a full-speed compatible USB interface that allows communication between a host PC and the microcontroller. The USB bus is a very complex protocol. Flowcode provides a component for USB Serial ,The USB Serial device is used to stream data between a microcontroller and a PC.

PIC Microcontroller Communication with RS232 Serial Bus – MikroC

image-352
RS232 serial communication is one of the oldest communication where data is sent or received one bit at a time. This protocol can easily be used to communicate between a PC and various devices supporting this type of protocol like PIC microcontrollers, GPS, GSM modem etc. While other interfaces like Ethernet, FireWire, and USB all send data as a serial stream, the term "serial port" usually identifies hardware more or less compliant to the RS-232 standard, intended to interface with a modem or with a similar communication device. MikroC Pro for PIC

Creating a Serial Port Interface with C#

image-101
A serial port interface is a Graphical User Interface program that runs on a personal computer and can be used to connect to a microcontroller via a serial connection. In this article a detailed step by step description with source code on how to create a simple Serial Port Graphical User Interface (GUI) using Microsoft Visual C# is outlined. From the toolBox on the left-hand side, under the Components sub-section, drag and drop SerialPort Control on the form and it shall appear below it. This control will enable us to send or receive data through the COM Port (Serial port) of the PC.

RS232 Serial Communication with PIC Microcontroller – Flowcode

image-371
RS232 serial communication is one of the oldest communication where data is sent or received one bit at a time. This protocol can easily be used to communicate between a PC and various devices supporting this type of protocol like PIC microcontrollers, GPS, GSM modem etc. While other interfaces like Ethernet, FireWire, and USB all send data as a serial stream, the term "serial port" usually identifies hardware more or less compliant to the RS-232 standard, intended to interface with a modem or with a similar communication device. The Universal Asynchronous Receiver/Transmitter (UART) controller is the key component of the serial communications between a device and a PC or between devices. UART is also a common integrated feature in most microcontrollers today which is useful for communicating serial data (text, numbers, etc.) to your PC. In this article we're going to learn how to use the RS232 communication with Flowcode.