USB08 eval board problems

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB08 eval board problems

1,926 Views
irob
Contributor V
Hello all, I'm having some very basic issues with my USB08 board.  Here's the sample code I'm trying to get working:

Code:
  LED1_DDR = 1;  LED2_DDR = 1;  LED3_DDR = 1;  BUTTON1_DDR = 0;  BUTTON2_DDR = 0;  BUTTON3_DDR = 0;  POCR_PAP = 1;     // turn on Port A pullups  LED1 = ON;  Delay(0x1000);  LED1 = OFF;  LED2 = ON;  Delay(0x1000);  LED2 = OFF;    LED3 = ON;  Delay(0x1000);  LED3 = OFF;  for (;;)  // main loop  {    if (BUTTON1 == CLOSE)   // mode switch depressed—    {      button1_flag = 1;           // button1 successfully pressed      LED1 = ON;    }    else    {      button1_flag = 0;           // button1 successfully released      LED1 = OFF;    }    if (BUTTON2 == CLOSE)   // mode switch depressed–    {      button2_flag = 1;           // button2 successfully pressed      LED2 = ON;    }    else    {      button2_flag = 0;           // button2 successfully released      LED2 = OFF;    }    if (BUTTON3 == CLOSE)   // mode switch depressed˜    {      button3_flag = 1;           // button3 successfully pressed      LED3 = ON;    }    else    {      button3_flag = 0;           // button3 successfully released      LED3 = OFF;    }  } // end for() loop

I define the buttons and LEDs as such:
Code:
#define BUTTON1         PTA_PTA4#define BUTTON2         PTA_PTA5#define BUTTON3         PTA_PTA6#define BUTTON1_DDR     DDRA_DDRA4#define BUTTON2_DDR     DDRA_DDRA5#define BUTTON3_DDR     DDRA_DDRA6

#define LED1      PTD_PTD0
#define LED2      PTD_PTD1
#define LED3      PTD_PTD2

#define LED1_DDR  DDRD_DDRD0
#define LED2_DDR  DDRD_DDRD1
#define LED3_DDR  DDRD_DDRD2

 What I'm seeing is that none of the LEDs are working on this board.  I have sample code from the manufacturer that does in fact work, so I know the board is good.  I can program the board with their code and with mine, so that's not an issue.

Also, I can confirm that the Port A pullup register code isn't working.  If I look at the first switch port bit, PTA4 on the scope, it's floating low.  If I hook up my own external pullup resistor, I can see the switch S1 work as expected.  Yet, my LEDs are illuminating.

I have a working clock at OSC2.

It's like this code isn't compiling right.  Any thoughts?


Labels (1)
0 Kudos
4 Replies

421 Views
peg
Senior Contributor IV
Hi Rob,

A few questions to get started:
Is this an Electronikladen board?
JB8?
Do the LED's flash once each then don't respond to the switches or never come on?

0 Kudos

421 Views
irob
Contributor V
Sorry for my lack of details.  Yes, this is the Electronikladen eval board.  It's the JB8 28-pin SO package.

With my code programmed in the chip, the LEDs don't blink at all on startup.  But I know that the board itself and its LEDs and switches are functional since I can program the original factory demo code back into the chip and watch the LEDs blink in response to button presses.

So I'm assuming that something in my general device init is just wrong.  Very curious.

I'm accustomed (read: spoiled) to the MC9S08 family, so jumping into this device is new to me.  Makes me wish Freescale's new S08 with integrated USB were out sooner!
0 Kudos

421 Views
peg
Senior Contributor IV
Hi Rob,

Well I would suggest that you are never even executing this code.
To turn the LED on you just set the DDR bit and clear the port bit.
There is no alternate function on these pins to get in the way.
There is only drive current options, all of which should give you _some_ LED illumination.

0 Kudos

421 Views
irob
Contributor V


Well I would suggest that you are never even executing this code.

You would be right.  Very silly mistake -- I wasn't actually running the init portion.  Duh!
0 Kudos