Sunday, February 23, 2025

What is a ADC(Analog To Digital Converter)?


Figure 1: from https://www.arrow.com/en/research-and-events/articles/engineering-resource-basics-of-analog-to-digital-converters
It shows how the analog signal in blue is turn to digital signal in red.


    It is quite common that a microcontroller has ADC converter. For further details, you can always search the datasheet of microcontroller. You can get it from below website for example. Look for the section Analog to Digital Converter in the datasheet. You can see the ADC registers under the section.

https://ww1.microchip.com/downloads/en/DeviceDoc/doc2467.pdf

    For example of the ECG machine, after the sensor data (voltage) is transmitted to the microcontroller through port, the analog signal is convert to digital number so that it can be further process or output the result in LCD/screen etc. 














Saturday, February 22, 2025

What is a port? (Computer/Microcontroller)

Ports are physical connectors that allow a computer/microcontroller to communicate with external devices.

Ex: In a simple ECG device, the sensor's output is transmit through the circuits to the port of microcontroller. The analog signal is further process in the microcontroller. 


Microcontroller

https://gbembedded.wordpress.com/2015/10/26/avr-io-ports/

As see in the above URL, the port of a microcontroller can be configure as below.

Example:

Interfacing one LED to PORTC and one button to PORTD and when the button is pressed, the LED will glow.

Steps for programming:

  1. Configure inputs and outputs by using DDRx register.
  2. Setting pins as low or high by using PORTx register.
  3. Read the Pin value by using PINx register and perform the operation.
#include <avr/io.h>
#include <util/delay.h>

int main(void)
{
DDRC=0x01;
DDRD=0x00;
PORTC=0x00;
PORTD=0x00;
while(1)
{
PORTC=0x01;
if (PIND & 0x01)
{
PORTC=0x00;
_delay_ms(100);

}

}
}

Figure 1: Coding taken from https://gbembedded.wordpress.com/2015/10/26/avr-io-ports/

Figure 2: Picture taken from https://www.flowcode.co.uk/courses/itm/index.php?n=PIC16F1937Architecture.PORTC







Thursday, February 20, 2025

What is Operating System Processes?


An application running on a typical operating system is best described as a process. Many processes may be active at the same time. Only one process can actually be running at a time.
 
Multitasking is a fundamental feature of modern operating systems, allowing multiple applications to run concurrently on a single computer. Process scheduling is the method by which the OS determines which processes, or applications, are given access to the system's resources at any given time. The OS uses a scheduler to allocate CPU time to each process, switching rapidly between them to give the illusion of simultaneous execution. This is known as time-sharing. 

To make things easier to understand, you can think of Xiao Mi phone, where the operating system is the Android OS, and the apps you install on the phone is the applications. The applications is take care by the processes. 
You can see example in your house laptop. Processes is call task also. 

In Window, go to Task Manager, you can see the running apps and running background processes. 



References: 

  1. https://brainly.com/question/38505647
  2. https://www.tutorchase.com/answers/ib/computer-science/how-does-the-os-handle-the-execution-of-multiple-applications


Tuesday, February 18, 2025

What is Physical and Logical Filesystem?

Physical files contain the actual data that is stored in the storage. (Ex: device's solid-state drive (SSD), hard-disk drive (HDD) or other media.)

Logical files do not contain data. They contain a description of records that are found in one or more physical files. Each logical drive is assigned its own drive letter and can be formatted with a file system to store data. Logical drives are created through a process called partitioning. Partitioning involves dividing a physical drive into multiple sections, each of which can be assigned as a separate logical drive. This can be done using various disk management tools or utilities provided by the operating system, such as Disk Management in Windows. 



Figure 1: 'Disk Management' in Window Operating System

References:

1. https://www.ibm.com/docs/en/i/7.4?topic=program-physical-files-logical-files

2. https://www.techtarget.com/searchstorage/definition/file-system

3. https://www.lenovo.com/us/en/glossary/logical-drive/

Saturday, February 15, 2025

What is Filesystem in Operating System?

 A file system is a structure used to organize and manage files on a storage device by an operating system.

Window use NTFS (New Technology File System) as its default filesystem up to Window 11 so far. It offers advanced features like file permissions, encryption, compression, and journaling[1]. 

A journaling file system is a file system that keeps track of changes not yet committed to the file system's main part by recording the intentions of such changes in a data structure known as a "journal," which is usually a circular log [2].


Figure 1: Figure showing window using file system NTFS.


References

1. https://www.kingston.com/en/blog/personal-storage/understanding-file-systems

2. https://eng.libretexts.org/Bookshelves/Computer_Science/Operating_Systems/Linux_-_The_Penguin_Marches_On_(McClanahan)/04%3A_Managing_Linux_Storage/4.04_Journaling_File_Systems  

What is Operating System?

Operating system is the programming that control the microprocessor for our house computer. However, operating system programming is usually more complex than the programming for a small microcontroller. We call this programming as firmware rather than software.


Examples of operating system are Window operating system and Linux operating system.

Window operating system has a Graphic User Interface which is more easy to use.

Linux operating system mostly has a Command Line Interface which might be more challenging to use for a common user.


Figure 1: Window operating system Graphic User Interface
Figure taken from https://www.computerworld.com/article/1614472/hands-on-with-windows-11-first-impressions.html



Figure 2: Linux operating system command line interface.
Figure taken from https://www.geeksforgeeks.org/linux-operating-system-cli-command-line-interface-and-gui-graphic-user-interface/








Friday, February 14, 2025

What Is a Microcontroller?

A microcontroller is like a CPU of our house computer. The microcontroller contains registers which can be program into different functions. 


In our computer, 

To open the Registry Editor: 
  1. Search for it in the Start menu
  2. Use the keyboard shortcut +R, type regedit and press Enter

For Microcontroller, we can see the available registers from the datasheet. If is a common microcontroller, you might be able to search for the datasheet on internet.

For example, one of the PIC microcontroller have datasheet as below.

https://ww1.microchip.com/downloads/en/devicedoc/35007b.pdf


Figure 1: Pin Diagram from Datasheet search online
Microcontroller image is from https://my.rs-online.com/web/p/microcontrollers/1772131