<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://socialledge.com/sjsu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kammce</id>
		<title>Embedded Systems Learning Academy - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://socialledge.com/sjsu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kammce"/>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php/Special:Contributions/Kammce"/>
		<updated>2026-04-04T06:10:11Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.1</generator>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:Git_icon.svg.png&amp;diff=44621</id>
		<title>File:Git icon.svg.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:Git_icon.svg.png&amp;diff=44621"/>
				<updated>2018-05-03T03:45:51Z</updated>
		
		<summary type="html">&lt;p&gt;Kammce: test&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;test&lt;/div&gt;</summary>
		<author><name>Kammce</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=MP3_Player&amp;diff=40624</id>
		<title>MP3 Player</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=MP3_Player&amp;diff=40624"/>
				<updated>2017-12-10T23:57:41Z</updated>
		
		<summary type="html">&lt;p&gt;Kammce: /* Functional Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Summary ==&lt;br /&gt;
The goal of this project is to create a fully functional MP3 music player using SJOne Microcontroller board as the source for music and control.&lt;br /&gt;
MP3 files will be present on an SD card. SJOne board reads these files and transfers data to a audio decoding peripheral for generating music.&lt;br /&gt;
User would be able to use player controls (start/stop/pause) for playing MP3 songs and view the track information on a display.&lt;br /&gt;
 &lt;br /&gt;
== Block Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File : Mp3_player_block_diagram.png|center|frame|]]&lt;br /&gt;
&lt;br /&gt;
== Project Requirements ==&lt;br /&gt;
=== Non-Functional Requirements: ===&lt;br /&gt;
* Should be dynamic. &lt;br /&gt;
** As in, you should be able to add more songs and play them&lt;br /&gt;
* Should be accurate.&lt;br /&gt;
** Audio should not sound distorted, &lt;br /&gt;
** Audio should not sound slower or faster when running on your system.&lt;br /&gt;
* Should be user friendly.&lt;br /&gt;
** User should be able to figure out how to use the device without a user manual.&lt;br /&gt;
** Product must be packaged in some enclosure. No wires can be vision for the project.&lt;br /&gt;
&lt;br /&gt;
=== Functional Requirements ===&lt;br /&gt;
# System must use the SJOne on board SD card to read MP3 audio files.&lt;br /&gt;
# System must communicate to an external MP3 decoder &lt;br /&gt;
# System must allow users to control the MP3 player (You may use the onboard buttons for this)&lt;br /&gt;
## User must be able to play and pause of song &lt;br /&gt;
## user must be able to select a song&lt;br /&gt;
# System must use an external display to show a menu providing the following information: &lt;br /&gt;
## Current playing song&lt;br /&gt;
## Information about current playing song&lt;br /&gt;
## Menu showing how to select a different song&lt;br /&gt;
## (Not all of the above need to be shown on the same display)&lt;br /&gt;
# System software must separated into tasks. EX: Display task, MP3 Read Task, Controller Task etc...&lt;br /&gt;
# System software must be thread safe always.&lt;br /&gt;
# System software must use OS structures and primitives where applicable.&lt;br /&gt;
# System software may only utilize 50% or less CPU&lt;br /&gt;
&lt;br /&gt;
=== Prohibited Actions: ===&lt;br /&gt;
# System MAY NOT use an external SD card reader embedded into MP3 device. YOU MAY use an external SD card reader if your SD card reader is broken&lt;br /&gt;
# Use of any external libraries (specifically Arduino) that drive the hardware you intent to use. You must make the drivers from scratch for every part you make.&lt;br /&gt;
&lt;br /&gt;
=== Permitted Action: ===&lt;br /&gt;
# You may use the internal buttons for controlling the MP3 player.&lt;br /&gt;
# You may use the 7-segment display and LEDs above buttons for debugging but not as the main menu.&lt;/div&gt;</summary>
		<author><name>Kammce</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=MP3_Player&amp;diff=40623</id>
		<title>MP3 Player</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=MP3_Player&amp;diff=40623"/>
				<updated>2017-12-10T23:25:39Z</updated>
		
		<summary type="html">&lt;p&gt;Kammce: /* Permitted Action: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Summary ==&lt;br /&gt;
The goal of this project is to create a fully functional MP3 music player using SJOne Microcontroller board as the source for music and control.&lt;br /&gt;
MP3 files will be present on an SD card. SJOne board reads these files and transfers data to a audio decoding peripheral for generating music.&lt;br /&gt;
User would be able to use player controls (start/stop/pause) for playing MP3 songs and view the track information on a display.&lt;br /&gt;
 &lt;br /&gt;
== Block Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File : Mp3_player_block_diagram.png|center|frame|]]&lt;br /&gt;
&lt;br /&gt;
== Project Requirements ==&lt;br /&gt;
=== Non-Functional Requirements: ===&lt;br /&gt;
* Should be dynamic. &lt;br /&gt;
** As in, you should be able to add more songs and play them&lt;br /&gt;
* Should be accurate.&lt;br /&gt;
** Audio should not sound distorted, &lt;br /&gt;
** Audio should not sound slower or faster when running on your system.&lt;br /&gt;
* Should be user friendly.&lt;br /&gt;
** User should be able to figure out how to use the device without a user manual.&lt;br /&gt;
** Product must be packaged in some enclosure. No wires can be vision for the project.&lt;br /&gt;
&lt;br /&gt;
=== Functional Requirements ===&lt;br /&gt;
# System must use the SJOne on board SD card to read MP3 audio files.&lt;br /&gt;
# System must communicate to an external MP3 decoder &lt;br /&gt;
# System must allow users to control the MP3 player (You may use the onboard buttons for this)&lt;br /&gt;
## User must be able to play and pause of song &lt;br /&gt;
## user must be able to select a song&lt;br /&gt;
# System must use an external display to show a menu providing the following information: &lt;br /&gt;
## Current playing song&lt;br /&gt;
## Information about current playing song&lt;br /&gt;
## Menu showing how to select a different song&lt;br /&gt;
## (Not all of the above need to be shown on the same display)&lt;br /&gt;
# System software must separated into tasks. EX: Display task, MP3 Read Task, Controller Task etc...&lt;br /&gt;
# System software must be thread safe always.&lt;br /&gt;
# System software must use OS structures and primitives where applicable.&lt;br /&gt;
&lt;br /&gt;
=== Prohibited Actions: ===&lt;br /&gt;
# System MAY NOT use an external SD card reader embedded into MP3 device. YOU MAY use an external SD card reader if your SD card reader is broken&lt;br /&gt;
# Use of any external libraries (specifically Arduino) that drive the hardware you intent to use. You must make the drivers from scratch for every part you make.&lt;br /&gt;
&lt;br /&gt;
=== Permitted Action: ===&lt;br /&gt;
# You may use the internal buttons for controlling the MP3 player.&lt;br /&gt;
# You may use the 7-segment display and LEDs above buttons for debugging but not as the main menu.&lt;/div&gt;</summary>
		<author><name>Kammce</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=MP3_Player&amp;diff=40622</id>
		<title>MP3 Player</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=MP3_Player&amp;diff=40622"/>
				<updated>2017-12-10T23:25:11Z</updated>
		
		<summary type="html">&lt;p&gt;Kammce: /* Prohibited Actions: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Summary ==&lt;br /&gt;
The goal of this project is to create a fully functional MP3 music player using SJOne Microcontroller board as the source for music and control.&lt;br /&gt;
MP3 files will be present on an SD card. SJOne board reads these files and transfers data to a audio decoding peripheral for generating music.&lt;br /&gt;
User would be able to use player controls (start/stop/pause) for playing MP3 songs and view the track information on a display.&lt;br /&gt;
 &lt;br /&gt;
== Block Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File : Mp3_player_block_diagram.png|center|frame|]]&lt;br /&gt;
&lt;br /&gt;
== Project Requirements ==&lt;br /&gt;
=== Non-Functional Requirements: ===&lt;br /&gt;
* Should be dynamic. &lt;br /&gt;
** As in, you should be able to add more songs and play them&lt;br /&gt;
* Should be accurate.&lt;br /&gt;
** Audio should not sound distorted, &lt;br /&gt;
** Audio should not sound slower or faster when running on your system.&lt;br /&gt;
* Should be user friendly.&lt;br /&gt;
** User should be able to figure out how to use the device without a user manual.&lt;br /&gt;
** Product must be packaged in some enclosure. No wires can be vision for the project.&lt;br /&gt;
&lt;br /&gt;
=== Functional Requirements ===&lt;br /&gt;
# System must use the SJOne on board SD card to read MP3 audio files.&lt;br /&gt;
# System must communicate to an external MP3 decoder &lt;br /&gt;
# System must allow users to control the MP3 player (You may use the onboard buttons for this)&lt;br /&gt;
## User must be able to play and pause of song &lt;br /&gt;
## user must be able to select a song&lt;br /&gt;
# System must use an external display to show a menu providing the following information: &lt;br /&gt;
## Current playing song&lt;br /&gt;
## Information about current playing song&lt;br /&gt;
## Menu showing how to select a different song&lt;br /&gt;
## (Not all of the above need to be shown on the same display)&lt;br /&gt;
# System software must separated into tasks. EX: Display task, MP3 Read Task, Controller Task etc...&lt;br /&gt;
# System software must be thread safe always.&lt;br /&gt;
# System software must use OS structures and primitives where applicable.&lt;br /&gt;
&lt;br /&gt;
=== Prohibited Actions: ===&lt;br /&gt;
# System MAY NOT use an external SD card reader embedded into MP3 device. YOU MAY use an external SD card reader if your SD card reader is broken&lt;br /&gt;
# Use of any external libraries (specifically Arduino) that drive the hardware you intent to use. You must make the drivers from scratch for every part you make.&lt;br /&gt;
&lt;br /&gt;
=== Permitted Action: ===&lt;br /&gt;
# You may use the internal buttons for controlling the MP3 player.&lt;br /&gt;
# You may use the 7-segment display and buttons for debugging but not as the main menu.&lt;/div&gt;</summary>
		<author><name>Kammce</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=MP3_Player&amp;diff=40316</id>
		<title>MP3 Player</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=MP3_Player&amp;diff=40316"/>
				<updated>2017-11-12T23:14:18Z</updated>
		
		<summary type="html">&lt;p&gt;Kammce: /* Project Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Summary ==&lt;br /&gt;
The goal of this project is to create a fully functional MP3 music player using SJOne Microcontroller board as the source for music and control.&lt;br /&gt;
MP3 files will be present on an SD card. SJOne board reads these files and transfers data to a audio decoding peripheral for generating music.&lt;br /&gt;
User would be able to use player controls (start/stop/pause) for playing MP3 songs and view the track information on a display.&lt;br /&gt;
 &lt;br /&gt;
== Block Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File : Mp3_player_block_diagram.png|center|frame|]]&lt;br /&gt;
&lt;br /&gt;
== Project Requirements ==&lt;br /&gt;
=== Non-Functional Requirements: ===&lt;br /&gt;
* Should be dynamic. &lt;br /&gt;
** As in, you should be able to add more songs and play them&lt;br /&gt;
* Should be accurate.&lt;br /&gt;
** Audio should not sound distorted, &lt;br /&gt;
** Audio should not sound slower or faster when running on your system.&lt;br /&gt;
* Should be user friendly.&lt;br /&gt;
** User should be able to figure out how to use the device without a user manual.&lt;br /&gt;
** Product must be packaged in some enclosure. No wires can be vision for the project.&lt;br /&gt;
&lt;br /&gt;
=== Functional Requirements ===&lt;br /&gt;
# System must use the SJOne on board SD card to read MP3 audio files.&lt;br /&gt;
# System must communicate to an external MP3 decoder &lt;br /&gt;
# System must allow users to control the MP3 player (You may use the onboard buttons for this)&lt;br /&gt;
## User must be able to play and pause of song &lt;br /&gt;
## user must be able to select a song&lt;br /&gt;
# System must use an external display to show a menu providing the following information: &lt;br /&gt;
## Current playing song&lt;br /&gt;
## Information about current playing song&lt;br /&gt;
## Menu showing how to select a different song&lt;br /&gt;
## (Not all of the above need to be shown on the same display)&lt;br /&gt;
# System software must separated into tasks. EX: Display task, MP3 Read Task, Controller Task etc...&lt;br /&gt;
# System software must be thread safe always.&lt;br /&gt;
# System software must use OS structures and primitives where applicable.&lt;br /&gt;
&lt;br /&gt;
=== Prohibited Actions: ===&lt;br /&gt;
# System MAY NOT use an external SD card reader embedded into MP3 device. YOU MAY use an external SD card reader if your SD card reader is broken&lt;br /&gt;
# ''Will add more things as they pop up ...''&lt;br /&gt;
&lt;br /&gt;
=== Permitted Action: ===&lt;br /&gt;
# You may use the internal buttons for controlling the MP3 player.&lt;br /&gt;
# You may use the 7-segment display and buttons for debugging but not as the main menu.&lt;/div&gt;</summary>
		<author><name>Kammce</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=MP3_Player&amp;diff=40315</id>
		<title>MP3 Player</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=MP3_Player&amp;diff=40315"/>
				<updated>2017-11-12T23:12:46Z</updated>
		
		<summary type="html">&lt;p&gt;Kammce: /* Project Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Summary ==&lt;br /&gt;
The goal of this project is to create a fully functional MP3 music player using SJOne Microcontroller board as the source for music and control.&lt;br /&gt;
MP3 files will be present on an SD card. SJOne board reads these files and transfers data to a audio decoding peripheral for generating music.&lt;br /&gt;
User would be able to use player controls (start/stop/pause) for playing MP3 songs and view the track information on a display.&lt;br /&gt;
 &lt;br /&gt;
== Block Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File : Mp3_player_block_diagram.png|center|frame|]]&lt;br /&gt;
&lt;br /&gt;
== Project Requirements ==&lt;br /&gt;
=== Non-Functional Requirements: ===&lt;br /&gt;
* Should be dynamic. &lt;br /&gt;
** As in, you should be able to add more songs and play them&lt;br /&gt;
* Should be accurate.&lt;br /&gt;
** Audio should not sound distorted, &lt;br /&gt;
** Audio should not sound slower or faster when running on your system.&lt;br /&gt;
* Should be user friendly.&lt;br /&gt;
** User should be able to figure out how to use the device without a user manual.&lt;br /&gt;
&lt;br /&gt;
=== Functional Requirements ===&lt;br /&gt;
# System must use the SJOne on board SD card to read MP3 audio files.&lt;br /&gt;
# System must communicate to an external MP3 decoder &lt;br /&gt;
# System must allow users to control the MP3 player (You may use the onboard buttons for this)&lt;br /&gt;
## User must be able to play and pause of song &lt;br /&gt;
## user must be able to select a song&lt;br /&gt;
# System must use an external display to show a menu providing the following information: &lt;br /&gt;
## Current playing song&lt;br /&gt;
## Information about current playing song&lt;br /&gt;
## Menu showing how to select a different song&lt;br /&gt;
## (Not all of the above need to be shown on the same display)&lt;br /&gt;
# System software must separated into tasks. EX: Display task, MP3 Read Task, Controller Task etc...&lt;br /&gt;
# System software must be thread safe always.&lt;br /&gt;
# System software must use OS structures and primitives where applicable.&lt;br /&gt;
&lt;br /&gt;
=== Prohibited Actions: ===&lt;br /&gt;
# System MAY NOT use an external SD card reader embedded into MP3 device. YOU MAY use an external SD card reader if your SD card reader is broken&lt;br /&gt;
# ''Will add more things as they pop up ...''&lt;br /&gt;
&lt;br /&gt;
=== Permitted Action: ===&lt;br /&gt;
# You may use the internal buttons for controlling the MP3 player.&lt;br /&gt;
# You may use the 7-segment display and buttons for debugging but not as the main menu.&lt;/div&gt;</summary>
		<author><name>Kammce</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=CAN_BUS_Tutorial&amp;diff=40048</id>
		<title>CAN BUS Tutorial</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=CAN_BUS_Tutorial&amp;diff=40048"/>
				<updated>2017-10-12T23:13:24Z</updated>
		
		<summary type="html">&lt;p&gt;Kammce: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== CAN BUS ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt; This article is under construction &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
CAN BUS (Controller Area Network) is a very deterministic BUS heavily used in the automotive industry.  It is a half-duplex BUS, that operates using a pair of differential signals.  Typically, the speed standards are 100K, 250K, 500K or 1Mbit.&lt;br /&gt;
&lt;br /&gt;
CAN BUS may have several tens of controllers on the same BUS and you can typically go relatively long distances such as 10 meters without compromising the speed or reliability.  The message id of each message can address other nodes on a CAN BUS (more on this later).&lt;br /&gt;
&lt;br /&gt;
=== CAN BUS Frame ===&lt;br /&gt;
A CAN frame may contain 50-114 bits which includes data bits like message id, the real payload (0-8 bytes), and some CRC bytes.  After the hardware captures the CAN frame, it stores it into a simpler frame that contains frame information, message id, and the data bytes.&lt;br /&gt;
&lt;br /&gt;
A CAN frame may contain one of two message id types :&lt;br /&gt;
*  11-bit&lt;br /&gt;
*  29-bit&lt;br /&gt;
&lt;br /&gt;
    | Frame Information            | Message ID   | 0-8 bytes |&lt;br /&gt;
    | RTR, Msg ID Type, Byte Count | 11 or 29-bit | 0-8 bytes |&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*  RTR : Remote transmission frame&lt;br /&gt;
*:  This bit indicates to the destination that an empty message is being sent.&lt;br /&gt;
*:  You can consider this &amp;quot;PING&amp;quot; or a signal to send something back to the source&lt;br /&gt;
*  Message ID Type&lt;br /&gt;
*:  This bit (when 1) indicates it is a 29-bit ID or else an 11-bit ID&lt;br /&gt;
*  Data bytes&lt;br /&gt;
*:  The payload can be zero bytes, or up to full 8 bytes in a CAN frame.&lt;br /&gt;
&lt;br /&gt;
=== Message ID ===&lt;br /&gt;
A message ID of a CAN frame is very unique in the sense that it is used as a priority on the physical BUS.  '''A lower message ID has higher priority''' since logical 0s are dominant and they override logical 1s on the BUS.  This is a key feature of the CAN BUS because you can guarantee that your message will get across above everyone else if it has the highest priority.&lt;br /&gt;
&lt;br /&gt;
Another property of the message id is that each node on a CAN bus MUST acknowledge a chosen message id for a message to be successful.  If a message is not acknowledged, retransmissions will take place by the hardware, which can eventually lead to &amp;quot;BUS-OFF&amp;quot; state as given by the CAN specifications.&lt;br /&gt;
&lt;br /&gt;
=== Transceiver ===&lt;br /&gt;
Unlike other BUSes that can be up and running without any external hardware, CAN BUS '''REQUIRES''' a voltage transceiver that converts logical Rx/Tx pins into a single differential pair wire that is hooked up on the CAN BUS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Multi-node CAN BUS ==&lt;br /&gt;
Before the CAN BUS is used in an application, it helps to know some basic characteristics of the BUS :&lt;br /&gt;
*  No two nodes shall send the same message ID&lt;br /&gt;
*:  Doing so will cause two nodes to cause collisions on the BUS, since arbitration will not take place.&lt;br /&gt;
*  No two nodes shall acknowledge the same message ID&lt;br /&gt;
*:  Doing so will cause two nodes to acknowledge the same packet.&lt;br /&gt;
&lt;br /&gt;
So knowing the above requirements, there is a dilemma for us:&lt;br /&gt;
*  How can two nodes send a message to another node using the same message id ?&lt;br /&gt;
&lt;br /&gt;
=== Message ID Design ===&lt;br /&gt;
What we can do is split the message id into separate fields so each node on a CAN bus can address any other node:&lt;br /&gt;
&lt;br /&gt;
    | 4-bit destination id | 4-bit source id | 3-bit message id |&lt;br /&gt;
&lt;br /&gt;
What we have done now is added the capability that multiple nodes can speak to each other, and whoever has the lowest source id has the highest priority on the CAN BUS.  So suppose that we are a &amp;quot;lights controller&amp;quot; on a vehicle's CAN BUS, then we can specify the following standard :&lt;br /&gt;
*  Lights Controller ID: 5&lt;br /&gt;
*  Message ID : 1 = Lights command&lt;br /&gt;
*  Message ID : 2 = Clear Faults&lt;br /&gt;
&lt;br /&gt;
With this in mind, we would tell our CAN controller to accept the following range of all message ids:&lt;br /&gt;
    | 0101 | xxxx | xxx |&lt;br /&gt;
Therefore, our CAN acceptance filter is 0x280 - 0x2FF.  If we do this, anyone can send us a message, and no two nodes will send the same message id.  Likewise, we can send a response message back to anyone using a unique message id.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OBDII ==&lt;br /&gt;
OBDII standard uses CAN BUS to communicate to the ECU.  You can connect a CAN controller to an OBDII port easily by using an [https://www.sparkfun.com/products/10087 OBDII to Serial] cable.  Since this kind of cable doesn't convert the CAN voltage signals to logical signals that a microcontroller can understand, you would also need an MCP2561 based transceiver which would allow your controller to be interfaced to an OBDII port. &lt;br /&gt;
&lt;br /&gt;
The block diagram would be as follows :&lt;br /&gt;
    | Car's computer --&amp;gt; CAN BUS --&amp;gt; (OBDII Port) --&amp;gt; MCP2561 --&amp;gt; Your CAN controller |&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== CAN on LPC17xx ==&lt;br /&gt;
LPC17xx or the '''SJ-One Board''' has two CAN controllers and the Sourceforge development package' projects contain the CAN driver.  Therefore, you can connect to two separate CAN BUSes, however, some of the internal hardware is shared between the two CAN controllers.  Note that a CAN controller needs to setup its filters such that it can generate ACKs and accept the chosen messages when another controller sends the specific CAN messages.  The LPC17xx CAN allows you to setup your CAN acceptance filters in one of several ways :&lt;br /&gt;
*  FullCAN message reception&lt;br /&gt;
*  Standard (11-bit) ID list&lt;br /&gt;
*  Standard ID range (low to high)&lt;br /&gt;
*  Extended (29-bit) ID list&lt;br /&gt;
*  Extended ID range (low to high)&lt;br /&gt;
&lt;br /&gt;
Also note that the space for these filters are limited to 2Kb internal RAM, however, this is enough to setup 512 individual 29-bit addresses or 1024 standard message IDs.  Generally, if you exhaust this space, you are doing something wrong or your CAN BUS protocol is badly designed.&lt;br /&gt;
&lt;br /&gt;
=== LPC FullCAN ===&lt;br /&gt;
Using FullCAN is one of the ways to setup a CAN message acceptance filter, and you have to know the exact id of each message.  The LPC FullCAN is a way for us to specify specific message IDs and these messages are stored straight to RAM without our software getting interrupted!  This is a neat away to automatically accept and store messages without using CPU cycles.  There exist a means to test if the HW has updated a specific message and you can even get interrupt notifications for up to first 64 FullCAN messages.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Filters ===&lt;br /&gt;
The hardware filters (apart from FullCAN) provide second means of accepting specific message ids.  Furthermore, you can also specify a range, for example, you can program it to accept all messages from standard 11-bit id range 0x100 to 0x200.  The CPU can or will get interrupted upon accepting a message, and then your software can queue or process the incoming message.  The hardware filter also provide a way to setup 29-bit message id acceptance filter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DBC ===&lt;br /&gt;
http://www.socialledge.com/sjsu/index.php?title=DBC_Format&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
=== External Resources ===&lt;br /&gt;
*  LPC2000 CAN BUS Appnote&lt;br /&gt;
*: [[File:CAN_AN10674.pdf]]&lt;br /&gt;
*  Keil CAN BUS Primer&lt;br /&gt;
*: [[File:CAN_keil_primer_v2.pdf]]&lt;br /&gt;
*  Microchip CAN BUS Appnote&lt;br /&gt;
*: [[File:CAN_microchip_appnote.pdf]]&lt;br /&gt;
*  TI CAN Bus tutorial&lt;br /&gt;
*: [http://www.ti.com/lit/an/sloa101a/sloa101a.pdf CAN Bus]&lt;/div&gt;</summary>
		<author><name>Kammce</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=Embedded_System_Tutorial_UART&amp;diff=39770</id>
		<title>Embedded System Tutorial UART</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=Embedded_System_Tutorial_UART&amp;diff=39770"/>
				<updated>2017-09-27T03:05:14Z</updated>
		
		<summary type="html">&lt;p&gt;Kammce: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The objective of this lesson is to understand UART, and use two boards and setup UART communication between them.&lt;br /&gt;
&lt;br /&gt;
'''UART''' stands for '''U'''niversal '''A'''synchronous '''R'''eceiver '''T'''ransmitter.  There is one wire for transmitting data, and one wire to receive data.   A common parameter is the baud rate known as &amp;quot;bps&amp;quot; which stands for '''b'''its '''p'''er '''s'''econd.  If a transmitter is configured with 9600bps, then the receiver must be listening on the other end at the same speed.&lt;br /&gt;
&lt;br /&gt;
UART is a serial communication, so bits must travel on a single wire.  If you wish to send a '''char''' over UART, the char is enclosed within a '''start''' and a '''stop''' bit, so to send 8-bits of '''char''' data, it would require 2-bit overhead; this 10-bit of information is called a '''UART frame'''.  Let's take a look at how the character 'A' is sent over UART.  In ASCII table, the character 'A' has the value of 65, which in binary is: 0100-0001.  If you inform your UART hardware that you wish to send this data at 9600bps, here is how the frame would appear on an oscilloscope :&lt;br /&gt;
[[File:uart_tutorial_frame.jpg|center|frame|UART Frame of 'A']]&lt;br /&gt;
&lt;br /&gt;
A micrcontroller can have multiple UARTs in its hardware, and usually UART0 is interfaced to a &amp;quot;USB to serial&amp;quot; converter chip which is then connected to your computer.  In this exercise, you will write a driver for UART-2 and attempt to communicate between two boards.&lt;br /&gt;
&lt;br /&gt;
I encourage you to fully read this article first, and here is a video about the UART0 tutorial.  This is a FAST PACED video, so learn to pause the video and look over your LPC user manual frequently :)  '''Note that I forgot to configure the PINSEL registers, which are covered by this tutorial below.'''&lt;br /&gt;
*  [https://www.youtube.com/watch?v=RU_NUPprx2Y UART Driver Video]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== UART Pins ==&lt;br /&gt;
Before you write a UART software driver, you need to understand the physical constraints and identify the UART pins on your processor.  A GPIO (general purpose input output) is a multi-purpose pin, and certain pins are used for certain functions.  For example, P0.0 and P0.1 on your LPC17xx processor can be used for an LED (output), a switch (input), or as UART transmitter and receive signals.  We will configure the microcontroller's internal MUX (multiplexor) to connect internal UART to external pins.&lt;br /&gt;
&lt;br /&gt;
[[File:tutorial_uart_pinsel.png|center|Find RXD2 and TXD2 of UART2]]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
[[File:tutorial_gpio_mux.png|center|Example MUX that we need to configure for a PIN selection]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Clock System &amp;amp; Timing ==&lt;br /&gt;
A crystal drives a processor clock, and it is usually less than 20Mhz.  A processor usually uses a &amp;quot;PLL&amp;quot; or &amp;quot;phased-lock-loop&amp;quot; to generate a faster clock than the crystal.  So, you could have a 4Mhz clock, and the PLL can be used to internally multiply the clock to provide 48Mhz to the processor.  The same 48Mhz is then fed to processor peripherals, and sometimes you have a register that can divide this higher clock to slower peripherals that may not require a high clock rate.  Remember that lower clock speed means lower power consumption.&lt;br /&gt;
&lt;br /&gt;
9600bps means that one bit takes 1/9600 = 104uS (micro-seconds) per bit.  The idea is that we want to divide the peripheral clock to UART hardware by a number that yields roughly 104uS per bit.  The '''Software Driver''' section goes over how to configure your UART driver to divide the clock to yield the desired baud rate.&lt;br /&gt;
&lt;br /&gt;
[[File:uart_tutorial_clock.jpg|center|frame|Example clock system of LPC17xx]]&lt;br /&gt;
&lt;br /&gt;
== Hardware Design ==&lt;br /&gt;
There is not much hardware design other than to locate UART-2 pins on your processor board and connecting these wires to the second board.  Each pin on a microcontroller may be designed to provide specific feature.  So the first thing to do is identify which physical pins can provide UART-2 signals.&lt;br /&gt;
&lt;br /&gt;
After you identify the physical pins, you would connect these pins to the second board.  '''Remember that your TX pin should be connected to second board's RX pin''' and vice versa.  Connecting two TX pins together will damage your processor.  After you connect the Rx/Tx pairs together, you also need to connect the '''ground''' wire of two boards together.  Not connecting the ground reference together is essentially like asking the other board &amp;quot;How far is my hand from the ground&amp;quot; when the ground reference is missing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Software Driver ==&lt;br /&gt;
[[File:uart_tutorial_overview.jpg|center|frame|UART chapter summary]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| &lt;br /&gt;
The UART chapter on LPC17xx has a really good summary page on how to write a UART driver.  '''Read the register description of each UART register to understand how to write a driver.'''  This tutorial gives away answers but unless you spend 1-2 hours reading the UART chapter, you will forget this knowledge.  The datasheet shows many registers but remember that for a simple driver, we will not need interrupts so you can skip the sections that talk about the UART interrupts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
Writing a uart initialization routine is simple except that some registers require a special setup to access them.  In the sample code below, we power up UART0, and use the PINSEL register to configure the Rx/Tx Uart pins as the pin functionality.  Finally, we just set the divider to achieve 9600bps.  The exception here is that we have to read the datasheet carefully which states that the '''DLM''' and the '''DLL''' registers are only accessible if the '''DLAB''' bit is set at the '''LCR''' register.&lt;br /&gt;
&lt;br /&gt;
Notice that four registers have the same address.  The UART divider registers are only accessible if DLAB bit is 1; this was done to protect accidental change of baud rate.  Furthermore, notice that the CPU is intelligent enough to know if you are accessing the RX or the TX register based on if the register is being read or written.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void uart0_init(void)&lt;br /&gt;
{&lt;br /&gt;
    LPC_SC-&amp;gt;PCONP |= (1 &amp;lt;&amp;lt; 3);       // Enable power to UART0&lt;br /&gt;
    LPC_SC-&amp;gt;PCLKSEL0 &amp;amp;= ~(3 &amp;lt;&amp;lt; 6);&lt;br /&gt;
    LPC_SC-&amp;gt;PCLKSEL0 |=  (1 &amp;lt;&amp;lt; 6);   // Uart clock = CPU / 1&lt;br /&gt;
&lt;br /&gt;
    LPC_PINCON-&amp;gt;PINSEL0 &amp;amp;= ~(0xF &amp;lt;&amp;lt; 4); // Clear values&lt;br /&gt;
    LPC_PINCON-&amp;gt;PINSEL0 |= (0x5 &amp;lt;&amp;lt; 4);  // Set values for UART0 Rx/Tx&lt;br /&gt;
&lt;br /&gt;
    LPC_UART0-&amp;gt;LCR = (1 &amp;lt;&amp;lt; 7);	// Enable DLAB&lt;br /&gt;
    /* See the formula picture to get more info.&lt;br /&gt;
     * Default values of fractional dividers simplifies the equation&lt;br /&gt;
     * Warning: You need to set DLM/DLL correctly, but if divider is small enough, it will fit inside DLL&lt;br /&gt;
     */&lt;br /&gt;
    LPC_UART0-&amp;gt;DLM = 0;&lt;br /&gt;
    LPC_UART0-&amp;gt;DLL = CPU_CLOCK / (16 * 9600) + 0.5);&lt;br /&gt;
&lt;br /&gt;
    LPC_UART0-&amp;gt;LCR = 3;         // 8-bit data&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| [[File:uart_tutorial_dlab.jpg|center|frame|DLAB bit to access registers]]&lt;br /&gt;
  [[File:uart_tutorial_formula.jpg|center|frame|Baud rate formula]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
char uart0_putchar(char out)&lt;br /&gt;
{&lt;br /&gt;
    LPC_UART0-&amp;gt;THR = out;&lt;br /&gt;
    while(! (LPC_UART0-&amp;gt;LSR &amp;amp; (1 &amp;lt;&amp;lt; 6)));&lt;br /&gt;
    return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
To send a char over UART, the code looks incredibly easy; just two lines!  It is supposed to be very easy because the UART hardware is supposed to handle the UART frame, and send start bit, followed by 8-data bits, and a stop bit by simply writing the '''THR''' register.  The moment you write this register, the hardware will start shifting bits out of the wire.  The while loop is present because after you write the '''THR''' register, we want to wait until hardware is done sending the bits out of the wire otherwise writing the same register again will corrupt the on-going transfer.&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Advanced Design ==&lt;br /&gt;
What you've done so far is wrote a polling UART driver.  If you used 9600bps, and sent 1000 characters, your processor would basically enter a &amp;quot;busy-wait&amp;quot; loop and spend 1040ms to send 1000 bytes of data.  You can enhance this behavior by allowing your &amp;lt;code&amp;gt;uart_putchar()&amp;lt;/code&amp;gt; function to enter data to a queue, and return immediately, and you can use the &amp;quot;THRE&amp;quot; or &amp;quot;Transmitter Holding Register Empty&amp;quot; interrupt indicator to remove your busy-wait loop while you wait for a character to be sent.&lt;br /&gt;
&lt;br /&gt;
== Assignment ==&lt;br /&gt;
* &amp;lt;b&amp;gt;Assignment Outline&amp;lt;/b&amp;gt;&lt;br /&gt;
*: Form 2 people teams for this assignment.&lt;br /&gt;
*: Write a driver for UART2 or UART3&lt;br /&gt;
*: Do not use the pre-built driver or Uart2/3 class&lt;br /&gt;
*: Connect your UART to your partner's UART (to his board)&lt;br /&gt;
*: Prove that you can send/receive data across multiple boards.&lt;br /&gt;
*: Upload Logic Analyzer Screenshot for the UART Frame.&lt;br /&gt;
* &amp;lt;b&amp;gt;Extra Credit&amp;lt;/b&amp;gt;: &lt;br /&gt;
*: Use Uart interrupt to queue the received data to avoid polling.  You just need to enable UART RX interrupt and then hookup an interrupt callback to do the receive.&lt;br /&gt;
* &amp;lt;b&amp;gt;Steps&amp;lt;/b&amp;gt;&lt;br /&gt;
*: Locate the physical pins for a UART that is not already used by your board&lt;br /&gt;
*: Configure the PINSEL to use the pins for UART Rx/Tx&lt;br /&gt;
*: Initialize your UART at any baud rate&lt;br /&gt;
*: Write uart_putchar(char) and uart_getchar() functions&lt;br /&gt;
*: Interface your UART with someone else's board, and test the communication.&lt;/div&gt;</summary>
		<author><name>Kammce</name></author>	</entry>

	</feed>