Skip to content

A data transmission program for the Microchip ATmega328P microcontroller

License

Notifications You must be signed in to change notification settings

rakane/Data-Transmission

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Transmission

Author: Ryan Kane

Data transmission program for the ATmega328P microcontroller, including a transmitter and receiver. The program is uploaded using a microchip SNAP In-circuit Debugger/Programmer, and the code is written in the MPLAB X IDE. The ATmega328P is connected using SPI mode, and the pin connections to the SNAP are as follows:

Project Structure

.
|---- assets              # README assets
|---- header.h          # Header file
|---- main.c              # Main driver program
|---- transmitter.c    # Transmitter program
|---- receiver.c         # Receiver program
|---- README          # README
|---- LICENSE           # LICENSE

Circuit Diagram

The pin labels correspond to the Arduino pins, but are in the same location. Refer to the ATmega328P Datasheet for the pinout

Circuit Diagram

SNAP to ATmega328P pin out

SNAP ATmega328P
VTG (pin 2) VCC (pin 7)
GND (pin 3) GND (pin 8)
MISO (pin 4) PB4 (pin 18)
SCK (pin 5) PB5 (pin 19)
NRESET (pin 6) PC6 (pin 1)
MOSI (pin 7) PB3 (pin 17)

Communication protocol

In the code, the constant TRANSMIT is used to set the ATmegs328P as the transmitter or receiver. One ATmega is used as the transmitter, and one as the receiver. The data framing is show as below, using 2 stop bits, no parity bit, and sends the most significant bit first: Data Framing Helpful article and image source

The message sent by the transmitter is "Hello". When this is read by the receiver, this should be this sequence of LEDS if connected to PORTD (left is most significant bit):

'H': 01001000

H as an 8-bit binary number

'E': 01000101

E as an 8-bit binary number

'L': 01001100

L as an 8-bit binary number

'L': 01001100

L as an 8-bit binary number

'O': 01001111

O as an 8-bit binary number

About

A data transmission program for the Microchip ATmega328P microcontroller

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages