<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CP2104 Archives - CyberBlogSpot</title>
	<atom:link href="https://cyberblogspot.com/tag/cp2104/feed/" rel="self" type="application/rss+xml" />
	<link>https://cyberblogspot.com/tag/cp2104/</link>
	<description>Not just another blogspot site</description>
	<lastBuildDate>Tue, 24 Jan 2023 07:12:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>

<image>
	<url>https://cyberblogspot.com/wp-content/uploads/2018/08/cropped-iphone-iphone3gs-32x32.jpg</url>
	<title>CP2104 Archives - CyberBlogSpot</title>
	<link>https://cyberblogspot.com/tag/cp2104/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Enable Serial Monitor on Digispark ATtiny85</title>
		<link>https://cyberblogspot.com/how-to-enable-serial-monitor-on-digispark-attiny85/</link>
					<comments>https://cyberblogspot.com/how-to-enable-serial-monitor-on-digispark-attiny85/#comments</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 18 Jan 2023 01:14:31 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Arduino IDE]]></category>
		<category><![CDATA[ATtiny85]]></category>
		<category><![CDATA[CH304]]></category>
		<category><![CDATA[COM Port]]></category>
		<category><![CDATA[CP2104]]></category>
		<category><![CDATA[Digispark]]></category>
		<category><![CDATA[Digispark ATtiny85]]></category>
		<category><![CDATA[Digispark ATtiny85 Development Board]]></category>
		<category><![CDATA[FTDI]]></category>
		<category><![CDATA[PL2303]]></category>
		<category><![CDATA[Serial Monitor]]></category>
		<category><![CDATA[USB]]></category>
		<category><![CDATA[USB Interface]]></category>
		<category><![CDATA[USB-to-Serial Converter]]></category>
		<category><![CDATA[USB-to-Serial TTL Converter]]></category>
		<category><![CDATA[USB-to-UART Converter]]></category>
		<guid isPermaLink="false">https://cyberblogspot.com/?p=5739</guid>

					<description><![CDATA[<p>The Serial Monitor in Arduino IDE is an indispensable tool for debugging purposes. However, although a Digispark ATtiny85 development board has a USB interface, the Serial Monitor does not work with it. The main reason is that the USB interface in the Digispark board is not a serial COM port. The second reason is that&#8230;&#160;<a href="https://cyberblogspot.com/how-to-enable-serial-monitor-on-digispark-attiny85/" rel="bookmark">Read More &#187;<span class="screen-reader-text">How to Enable Serial Monitor on Digispark ATtiny85</span></a></p>
<p>The post <a href="https://cyberblogspot.com/how-to-enable-serial-monitor-on-digispark-attiny85/">How to Enable Serial Monitor on Digispark ATtiny85</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>The Serial Monitor in Arduino IDE is an indispensable tool for debugging purposes.  However, although a Digispark ATtiny85 development board has a USB interface, the Serial Monitor does not work with it.  The main reason is that the USB interface in the Digispark board is not a serial COM port.  The second reason is that the ATtiny85 chip does not have a UART port.  And third, the Digispark board lacks a UART to USB bridge circuitry to translate UART signals to USB signals.  In this article, we will take a look at how to enable the Serial Monitor when using a Digispark ATtiny85 development board.</p>



<p>To enable the Arduino IDE Serial Monitor on a Digispark ATtiny85 board, connect a USB-to-Serial converter.  Then use the SoftwareSerial library in the Arduino IDE to create a UART port on the ATtiny85 chip.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter-fritzing-bb.png"><img fetchpriority="high" decoding="async" width="802" height="542" src="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter-fritzing-bb.png" alt="Picture of Fritzing breadboard diagram showing how to connect the Digispark ATtiny85 board to a USB to serial converter to enable the serial monitor when working with Digispark ATtiny85" class="wp-image-5845" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter-fritzing-bb.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter-fritzing-bb-300x203.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter-fritzing-bb-768x519.png 768w" sizes="(max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 1.  Fritzing Breadboard Diagram of Digispark ATtiny85 with a USB-to-Serial Converter</figcaption></figure></div>


<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="has-text-align-center">For Digispark ATtiny85 pinout guide, kindly see <a href="https://cyberblogspot.com/digispark-attiny85-pinout-and-configuration/" target="_blank" rel="noreferrer noopener">Digispark ATtiny85 Pinout and Configuration</a>.</p>
</blockquote>



<p></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter.png"><img decoding="async" width="1002" height="477" src="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter.png" alt="Schematic diagram for connecting the Digispark ATtiny85 board to a USB to UART converter to enable the serial monitor of the Arduino IDE." class="wp-image-5754" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter.png 1002w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter-300x143.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter-768x366.png 768w" sizes="(max-width: 1002px) 100vw, 1002px" /></a><figcaption class="wp-element-caption">Figure 2.  Schematic Diagram of Digispark ATtiny85 and USB-to-Serial Converter Connection </figcaption></figure></div>


<p></p>



<h2 class="wp-block-heading">Step by Step Guide For Serial Monitor</h2>



<p><strong>STEP 1 &#8211; Connect a USB-to-Serial Converter</strong></p>



<p>First, connect a USB-to-serial converter to the Digispark ATtiny85 board as shown in Figure 1 and Figure 2.  </p>



<p>There are many inexpensive USB-to-serial converters on the Internet.  Examples of USB-to-serial converters are shown below in Figure 3.  These converters are sometimes referred to as USB-to-serial TTL converters or USB-to-UART converters.  Also, the converters use a variety of chips, hence, they may be referred to by their chip names.  Some of the popular USB-to-serial chip names that you may encounter are FTDI, CP2104, CH304, and PL2303.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/usb-to-serial-converters-jpg.webp"><img decoding="async" width="502" height="402" src="https://cyberblogspot.com/wp-content/uploads/2023/01/usb-to-serial-converters-jpg.webp" alt="Picture of the different types of USB-to-serial converter used for activating the serial monitor on Digispark ATtiny85 when working with Arduino IDE" class="wp-image-5849" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/usb-to-serial-converters-jpg.webp 502w, https://cyberblogspot.com/wp-content/uploads/2023/01/usb-to-serial-converters-300x240.webp 300w" sizes="(max-width: 502px) 100vw, 502px" /></a><figcaption class="wp-element-caption">Figure 3.  USB-to-Serial Converters</figcaption></figure></div>


<p></p>



<p><strong>STEP 2 &#8211; Install the USB-to-Serial Converter Device Driver</strong></p>



<p>Download and install the device driver for your USB-to-serial converter.  Because USB-to-serial converters use different chips, you need to search the internet for the device driver for your particular USB-to-serial converter.</p>



<p>You can do a quick test if you have the right device driver installed.  Open the Arduino IDE and go to the Tools/Port menu.  You should see an additional port instead on only COM1 on the Serial Ports list when you plug in your USB-to-serial converter.  Please see Figure 4.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-port-list.png"><img loading="lazy" decoding="async" width="802" height="520" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-port-list.png" alt="Screenshot of the Arduino IDE showing the serial COM ports list." class="wp-image-5851" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-port-list.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-port-list-300x195.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-port-list-768x498.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 4.  Arduino IDE Showing Serial Ports List</figcaption></figure></div>


<p></p>



<p><strong>STEP 3 &#8211; Install the Board Core ATTinycore by Spence Konde</strong></p>



<p>Although we may use the original Digistump AVR board core, I prefer to use the ATTinyCore as it supports almost all of the ATtiny line of AVR chips.  Additionally, the ATTinyCore gives us the option to program the ATtiny85 in several ways: no bootloader, Optiboot, and Micronucleus (Digispark) modes.  If you need help in installing the ATTinyCore, please see <a href="https://cyberblogspot.com/how-to-install-attinycore-on-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Install ATTinyCore on Arduino IDE</a>.</p>



<p><strong>STEP 4 &#8211; Use Software Serial to Create UART Ports on ATtiny85</strong></p>



<p>Open the Arduino IDE and upload the sketch shown below.  If you need help in uploading the sketch using the board core ATtinyCore, you may visit <a href="https://cyberblogspot.com/how-to-program-digispark-attiny85-board-with-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Program Digispark ATtiny85 Board with Arduino IDE</a>.</p>



<p><strong>IMPORTANT NOTE</strong><br>Before hitting the Upload button to install the sketch, unplug <strong>both</strong> USB cables for the Digispark board and the USB-to-serial converter.  Plug in the USB cable for the Digispark board when prompted by the Arduino IDE.  When the sketch upload is done, unplug the USB cable from the Digispark board.  Connect the USB cable for the USB-to-serial converter and proceed to STEP 5 for testing the Serial Monitor. </p>



<pre class="EnlighterJSRAW">/* cyberblogspot.com 15Jan2023 */

#include &quot;SoftwareSerial.h&quot;

SoftwareSerial mySerial(1, 0);  //RX, TX  PB1, PB0

void setup() { 
  mySerial.begin(19200);
  
  mySerial.println(&quot;Change baud rate to 19200&quot;);
  mySerial.println(&quot;Type something and press ENTER&quot;);
}

void loop() {
  if (mySerial.available()){
    mySerial.println(mySerial.readString());
  }
}</pre>



<p></p>



<p>The sketch above needs no explanation.  Simply include the library header file for the SoftwareSerial library.  You do not have to download the SofwareSerial library as it should come with the ATtinyCore board core installation.</p>



<p>Regarding the code creating the SoftwareSerial object in line 5, </p>



<p>SoftwareSerial mySerial(1, 0);  //RX, TX  PB1, PB0</p>



<p>you may use any two (2) available ATtiny85 ports available.  In this case, I used PB1 for RX (receiver) and PB0 for TX (transmitter).</p>



<p><strong>STEP 5 &#8211; Test the Serial Monitor</strong></p>



<p>After uploading the sketch to the Digispark ATtiny85 board, unplug the USB cable from the Digispark board.  Plug in the USB cable for the USB-to-serial converter. </p>



<p>Then, select the correct COM port for your USB-to-serial converter in the Arduino IDE &#8220;Tools/Port&#8221; menu.  Test the program and you should now be able to use the Serial Monitor on the Digispark ATtiny85 board.</p>



<h2 class="wp-block-heading">References on How to Enable Serial Monitor on Digispark ATtiny85</h2>



<p><a href="https://en.wikipedia.org/wiki/USB-to-serial_adapter#:~:text=Most%20commonly%20the%20USB%20data,RS423%20adapters%20are%20less%20common." target="_blank" rel="noreferrer noopener">USB-to-serial adapter </a> &#8211; Wikipedia article on USB to Serial Converter<br><a href="https://cyberblogspot.com/how-to-install-arduino-ide-on-windows-10/" target="_blank" rel="noreferrer noopener">How to Install Arduino IDE on Windows 10</a><br><a href="https://cyberblogspot.com/how-to-install-attinycore-on-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Install ATTinyCore on Arduino IDE</a><br><a href="https://cyberblogspot.com/how-to-use-arduino-as-isp-programmer/" target="_blank" rel="noreferrer noopener">How to Use Arduino as ISP Programmer</a><br><a href="https://cyberblogspot.com/how-to-program-attiny85-with-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Program ATtiny85 with Arduino IDE</a><br><a href="https://cyberblogspot.com/digispark-attiny85-pinout-and-configuration/" target="_blank" rel="noreferrer noopener">Digispark ATtiny85 Pinout and Configuration</a><br><a href="https://cyberblogspot.com/how-to-program-digispark-attiny85-board-with-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Program Digispark ATtiny85 Board with Arduino IDE</a><br><a href="https://cyberblogspot.com/digispark-usb-device-not-recognized/" target="_blank" rel="noreferrer noopener">Digispark USB Device Not Recognized</a><br><a href="https://cyberblogspot.com/how-to-use-at-09-ble-with-arduino-and-smartphone/" target="_blank" rel="noreferrer noopener">How to Use AT-09 BLE with Arduino and Smartphone</a></p>
<p>The post <a href="https://cyberblogspot.com/how-to-enable-serial-monitor-on-digispark-attiny85/">How to Enable Serial Monitor on Digispark ATtiny85</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cyberblogspot.com/how-to-enable-serial-monitor-on-digispark-attiny85/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
