3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

How to use the Dragon Rider 500 with your AVR Dragon

Step 10RSS Reader using Serial Connection and LCD

RSS Reader using Serial Connection and LCD
«
  • dragon_rss_schematic.png
  • IMG_0376.JPG
I'm continuing to play around with this development board. This time I spent part of an afternoon developing an RSS readion (mostly on the python side of things). I don't think it warrants its own instructable so I'm adding it on here.



Hardware


We are using the Dragon Rider 500 as a development board. This provides all of the hardware you need (assuming you have all of the add-on kits). That being said you certainly can do this with your own hardware setup:
  • ATmega8 microcontroller (or any that has a USART and enough pins for all connections
  • A way to program the microcontroller (I use the AVR Dragon)
  • MAX232 chip for the serial communications
  • DB9 connector
  • HD44780 LCD screen
  • Crystal (I used an 8MHz crystal)
  • Assorted capacitors and resistors

A schematic is provided below.

On the Dragon Rider we will need to use some creativity to Route the connections. Normally Port D could be connected directly to the LCD header. This is not the case here because the USART needed for the serial connection uses PD0 and PD1. Furthermore, Port B cannot be used because PB6 and PB7 are in use for the external crystal.

Pictured below is my solution to this problem. I plug in a ribbon cable to the headers for the LCD, Port B and Port D, then use jumper wires to make the proper routes. Don't forget to hook up voltage and ground to the LCD header.

Software


The software for this project comes in two parts, the firmware for the microcontroller and the python script for scraping the RSS feeds and sending them over the serial connection.

AVR Firmware
I'm using Peter Fleury's LCD library again (http://jump.to/fleury). It's powerful and concise, versatile, and easy to alter for your hardware setup. If you look at the header file attached (lcd.h) you will see that I'm running in 4-bit mode with Port D as the data bits, and Port B as the control bits.

The concept of this firmware is pretty simple:
  • Once powered up the microcontroller displays "RSS Reader" and then waits for serial data.
  • Each byte of serial data received causes a buffer of 16 chars to shift left and add the byte to the buffer, then display the buffer.
  • Three special commands are accepted by the microcontroller: 0x00, 0x01, and 0x02. These are clear screen, move to line 0, and move to line 1 respectively.

Python Scrypt
I wrote a pyton script to scrape the RSS data and send it over the serial connection. This requires the python module "pyserial" which you will probably have to install on your system to get this to work.

The RSS feed can be configured at the top of the pyton file. Notice that you need to enter a name for the feed as well as the feed url. There are three examples there, I'm certain you can follow those for the proper syntx.

Making it all work
  • Assemble the hardware
  • Program the microcontroller (dragon_rss.hex can be used if you don't want to compile this yourself). Fuse settings for ATmega8 using an 8 MHz crystal: lfuse= 0xEF hfuse=0xD9
  • Power up the Dragon Rider and make sure the serial cable is plugged in (LCD should read: "RSS Reader")
  • Execute the python program (python serial_rss.py)
  • Enjoy
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
41
Followers
6
Author:barney_1