LED Marquee – Part 2

Soo. First update goes:

k-ww tipped me off how to read the am27c256 EPROM chip on the controller and this post is about my try to this exact thing.

To read it i need a MCU with 15 adress lines and 8 data lines. For this i used a Atmel ATmega32 and my STK500 board.

Hooked-up it looks like this:

led4_l

 

led5_l

As of now my code is as follows:

#define F_CPU 3686400UL

#include <avr/io.h>
#include “uart.h”
#include <util/delay.h>

int main()
{
char tegn = 0x00;
uint16_t output = 0;

//Init
DDRA = 0xFF;
DDRB = 0xFF;
DDRC = 0x00;

PORTA = 0x00;
PORTB = 0x00;

InitUART(9600, 8);

while(1)
{
PORTA = output;
PORTB = (output >> 8);
if(output == 0b1000000000000000)  //I have to blocks of debug-code in here as the output to the serial line seems strange somehow.
{
SendChar(‘1′);
SendChar(‘5′);
SendChar(‘b’);
SendChar(‘i’);
SendChar(‘t’);
}
if(output == 0b0000000000000000)
{
SendChar(‘1′);
SendChar(‘6′);
SendChar(‘b’);
SendChar(‘i’);
SendChar(‘t’);
}
output++;

_delay_us(50);

tegn = PINC;
SendChar(tegn);
}
}

Some of my problems with this is that it newer sends the “16bit” message and not always the “15bit” one :?

For further debugging i hooked up my Logic16 logic analyzer:

led6_l

And got this output:

led7

I’d really appreciate if you can help me figure out what is “off” here!
IE to me it seems that the IC is sent 0b10001100 at T=60ms but sends 0b01000010 (0x42) to the PC…
Note that the parallel data and the serial data is off by almost a whole data packet off course.

Anyway. Off to bed. I’ve been at work all night :shock:

 

 

Leave a Reply