=20=20
Hi All,
=20=20=20
I had written a simple C program for M68HC711E9 Controller using Freeware=
GCC version 3.3.6. Also i compiled using GCC with vectors.c file and Linke=
r file memory.x
=20=20=20
I generated the .S19 using GCC compiler and flashed it to 68HC711E9 using=
EVBplus2 development Board. But the C Code is not working, its not display=
ing the LED in Port B.
=20=20=20
The C Code and Memory.x (Linker command file) is as below: Please tell me=
is there any problem in C code or Linker command file (memory.x) or What m=
ight have caused the problem that LED is not blinking..?
=20=20=20
C code:
=20=20=20
#define REGISTER unsigned char
#define REG_BASE 0x1000
#define PORTA *(( REGISTER volatile *)(REG_BASE + 0x00))
#define PORTB *((REGISTER volatile *)(REG_BASE + 0x04))
#define M6811_PORTC *((REGISTER volatile *)(REG_BASE + 0x03))
#define M6811_DDRC *((REGISTER volatile *)(REG_BASE + 0x07))
#define M6811_PORTD *((REGISTER volatile *)(REG_BASE + 0x08))
#define M6811_DDRD *((REGISTER volatile *)(REG_BASE + 0x09))
#define PORTE *((REGISTER volatile *)(REG_BASE + 0x0A))
#define M6811_OPTION *((REGISTER volatile *)(REG_BASE + 0x39))
#define M6811_TMSK2 *((REGISTER volatile *)(REG_BASE + 0x24))
#define M6811_CONFIG *((REGISTER volatile *)(REG_BASE + 0x3F))
#define M6811_PACTL *((REGISTER volatile *)(REG_BASE + 0x26))=20=20
=20=20=20
#define OC1M *((unsigned char volatile *)0x100C)
#define OC1D *((unsigned char volatile *)0x100D)
=20=20
#define ADCTL *((unsigned char volatile *)0x1030)=20=20=20
#define TCTL2 *((unsigned char volatile *)0x1021)=20=20
=20
#define BPROT *((unsigned char volatile *)0x1035)=20=20=20
#define TCTL1 *((unsigned char volatile *)0x1020)
#define TFLG1 *((unsigned char volatile *)0x1023)
#define TFLG2 *((unsigned char volatile *)0x1025)
#define CONFIG *((unsigned char volatile *)0x103F)
#define COPRST *((unsigned char volatile *)0x103A)
#define RAMSTARTADDR ((unsigned char volatile *)0x0000)
#define RAMENDADDR ((unsigned char volatile *)0x0100)
int __attribute__((noreturn)) main (void);
void _start (void);
=20=20=20
main()
{
int rdata=3D0,wdata=3D0;
int loopi=3D0;
volatile unsigned char *PointerToRam;
_/*Set the Regsiters of 68hc11 */
M6811_OPTIonfiltered=3D 0xB3; _/* Update OPTION Register, RQ=3DNEG=
.EDGE, STOP DLY, COP=3D1.048 Sec., A/D Confiltered=3D ON*/
M6811_TMSK2 =3D 0xC3; _/* Update OPTION Register,Set TCNT CLKS=3D8 u=
S, TOF & RTC IRQ's ON*/
M6811_CONFIG =3D M6811_CONFIG & 0xE0;
=20=20
M6811_PACTL =3D 0x8A;=20=20
=20=20
M6811_DDRC &=3D 0x00;
M6811_PORTD =3D 0x24;
M6811_DDRD=3D 0x3C;
PORTB &=3D 0x00;
while(RAMSTARTADDR !=3D RAMENDADDR)
*RAMSTARTADDR =3D 0x00;
RAMSTARTADDR++;
while(1)
{
=20=20
PORTB |=3D 0x20;
}=20=20
}
=20=20
void _start()
{
=20
__asm__ __volatile__ ("lds #0x01FF");
__asm__ __volatile__ ("bra main");
}
=20=20=20
-------------------------------------------------------------------------=
-----------------------------
=20=20=20
Memory.x:
MEMORY
{
page0 (rwx) : ORIGIN =3D 0x0000, LENGTH =3D 256
text (rx) : ORIGIN =3D 0xE000, LENGTH =3D 12287
eeprom : ORIGIN =3D 0xB600, LENGTH =3D 512
data : ORIGIN =3D 0x0000, LENGTH =3D 256
vector : ORIGIN =3D 0xFFC0, LENGTH =3D 64
}
_/* Setup the stack on the top of the data internal ram (not used). */
PROVIDE (_stack =3D 0x01FF-1);
PROVIDE (_io_ports =3D 0x1000);
_/* PROVIDE (_vectors_addr =3D 0xffc0); */
=20=20=20
=20=20=20=20
---------------------------------
Here=92s a new way to find what you're looking for - Yahoo! Answers=20
=20=09=09=09=09
---------------------------------
Here=92s a new way to find what you're looking for - Yahoo! Answers=20
[Non-text portions of this message have been removed]
=20
=20

(You need to be a member of m68hc11 -- send a blank email to m68hc11-subscribe@yahoogroups.com )
Rakesh Krishnan wrote:
>
>
> Hi All,
>
> I had written a simple C program for M68HC711E9 Controller using
> Freeware GCC version 3.3.6. Also i compiled using GCC with vectors.c
> file and Linker file memory.x
Your question is really about a specific toolset, not the processor.
I suggest you post over on the GCC for MC68HC11 mail echo. People
over there are more likely to be able to help you.
Also, I suggest that you not post three times the same message. It's
annoying.
To try to give you some response which is related to the '11,
are you sure you are booting into the proper mode? If you boot
in expanded mode, then you don't have a PORTB.
[snip]
Mike
--
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!

(You need to be a member of m68hc11 -- send a blank email to m68hc11-subscribe@yahoogroups.com )