LCD registers and JTAG

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am starting a project using a meag169PA to drive a custom LCD display, and obviously, I'd like to use the built-in LCD driver, but a couple of issues have surfaced.

1. I use the LCD driver register names in Studio 7, but I get errors when I build, saying that those register names (LCDCRB, LCDFRR, LCDCD1, etc. ) aren't recognized. I have to think that there must be an additional #include file that has these register definitions, but I have no idea what it is or where it might be. Looking online has proven to be fruitless. AVR app note for Butterfly does not show actual code - just flowcharts.

2. When I bring up the device programming dialog, I am given the choice of ISP or JTAG interface for the mega169 and AVR Dragon combination I'm using. I have both headers on my board, and both work to set/clear fuses, etc. I have SPI and JTAG bits enabled. However, when I try to debug, I get a dialog that says I need to choose a debug platform, so I select AVR Dragon, and when I select the interface dialog, I get ISP, HVpp, and debugWire. There is no JTAG option. What am I missing here?

This is my initial code:

#include    <stdlib.h>
#include    <avr/io.h>
#include    <stdint.h>
#include    <avr/eeprom.h>
#include    <avr/pgmspace.h>
#include    <avr/interrupt.h>

 Here's the portion that gives me errors:

 

    LCDCRB = 0b00110000; // LCD uses sys clock, 1/2 bias,1:4 DC, seg 0-12
    PRR &= 0b11101111;
    LCDFRR = (1<<LCDCD2) | (1<<LCDCD1);
    /* Set segment drive time to 125 µs and output voltage to 3.3 V*/
    LCDCCR = (1<<LCDDC1) | (1<<LCDCC3) | (1<<LCDCC2) | (1<<LCDCC1);
    /* Enable LCD, default waveform and no interrupt enabled */
    LCDCRA = (1<<LCDEN);

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Never mind! My old eyes did not see that I had specified an ATmega168PA instead of ATmega169PA. I repent in dust and ashes...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Probably you have the wrong chip selected in the project properties, it happened the same here until I changed the chip to the M169, then I can select JTAG

 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So you already fixed it... wink

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:

So you already fixed it... wink

Yes, I obviously need to use a larger font size, as the characters just seem to get smaller and blurrier each year! Actually, I do have an issue with my right eye that causes distortion and somewhat blurred vision - the left eye is OK, but when they try to work together, my brain can' reconcile the two different images and I just see fuzzily!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That sounds familiarlaugh had cataract surgery on one eye a few yeas ago, then I had the other eye done last year but the 2 eyes don't sees to align well anymore under some circumstances without my glasses.

 

At times I will see 2 images on top of each other but the glasses fixes that.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:
So you already fixed it... wink 

davetelling wrote:
Yes

So mark the solution - see Tip #5

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...