Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

codewarrior hc12 simulation problem

Status
Not open for further replies.

asic1984

Full Member level 5
Joined
Nov 15, 2003
Messages
257
Helped
4
Reputation
8
Reaction score
1
Trophy points
1,298
Activity points
2,340
code warrior ddra

hi

i tried this code in the codewarrier but when simulating it didnot make what it should do

the program simply just make porta output high
Code:
#define _REG_BASE        0
#define _P(off)         *(unsigned char volatile *)(_REG_BASE + off)
#define   PORTA    _P(0x00)
#define   DDRA	   _P(0x02)

void main(void) {
	/* include your code here */
    
 
	DDRA=0xff;
	PORTA=0xff;
}

put in simulation no values are sent to porta or even ddra

thanks for help
 

abdalla

Member level 4
Joined
Mar 22, 2006
Messages
79
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Activity points
1,802
ddra codewarrior

u can try this

#define _REG_BASE 0
#define PORTA 0x00
#define DDRA 0x02

void main(void) {
/* include your code here */


DDRA=0xff;
PORTA=0xff;
}


secondly HOW did u know that it didn`t work?
I see that the simplest way to see the output to see the address 0x00 in the memory windows
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top