PORTD problem  MC13213

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

PORTD problem  MC13213

3,405 Views
allenrubis
Contributor I
Hi,

I can't compile if I enable portD (PTD7,PTD6,PTD5). Other ports are okey

here is my code

#include /* for EnableInterrupts macro */
#include "derivative.h" /* include peripheral declarations */
#include "MC9S08GT60.h"

#define PC0 PTCD_PTCD0
#define PC1 PTCD_PTCD1
#define PC2 PTCD_PTCD2
#define PC3 PTCD_PTCD3
#define PC4 PTCD_PTCD4
#define PC5 PTCD_PTCD5
#define PC6 PTCD_PTCD6
#define PC7 PTCD_PTCD7
#define PE0 PTED_PTED0
#define PE1 PTED_PTED1
#define ON 1
#define OFF 0
#define UP 1
#define DOWN 0

#define PD5 PTDD_PTDD5
#define PD6 PTDD_PTDD6
#define PD7 PTDD_PTDD7
#define PB0 PTBD_PTBD0
#define PB1 PTBD_PTBD1
#define PB2 PTBD_PTBD2
#define PB3 PTBD_PTBD3







void MCU_init(void); /* Device initialization function declaration */

void main(void) {

MCU_init(); /* call Device Initialization */




PTCDD=0xff;
PC0=OFF;
PC1=OFF;
PC2=ON;
PC3=ON;
PC4=ON;
PC5=ON;
PC6=ON;
PC7=ON;

PTEDD=0x03;
PE0=ON;
PE1=ON;

PTDDD=0xff;
PD5=OFF;
PD6=OFF;
PD7=OFF;

PTBDD=0x0F;
PB0=ON;
PB1=ON;
PB2=ON;
PB3=ON;


SOPT = 0x73; /* Turn off the watchdog. */

TPM1SC = 0x00;

for(;:smileywink: {
/* __RESET_WATCHDOG(); by default, COP is disabled with device init. When enabling, also reset the watchdog. */
} /* loop forever */
/* please make sure that you never leave main */
}




My Error
pls see attached.
Labels (1)
0 Kudos
7 Replies

571 Views
bigmac
Specialist III
Hello Allen,
 
The problem would seem to be that bits 5, 6 and 7 of port D are undefined (do not exist) for the MC9S08GT60 device.
 
Regards,
Mac
 
0 Kudos

571 Views
peg
Senior Contributor IV
Hi,
 
Mac, I believe you are incorrect here:
 
See my comments in this thread:
 
I believe that all GB/GT devices except the GT16A and GT8A have all the full GB60 functionality and register set, just not all the actual pins. Only GT8/16A has the registers trimmed down to suit the pins.
Although I'm still hoping someone that actually knows or can find out will confirm this.
 
Regards
Peg
 
Ah! After another look I think you (Mac) are saying that the header file does not have the defines for these register bits and that is causing the OP's problem. Whether they actual exist or not is immaterial in this case. If they do exist as the datasheets seem to say then why doesn't CW's headers define them even though they don't have pins???

Message Edited by peg on 2006-12-2709:15 PM

0 Kudos

571 Views
bigmac
Specialist III
Hello Peg,
 
Yes, the original query was a compile problem using the GT60 as the derivative.
 
As seems to be the case, the GT60 may not be entirely appropriate to the MC13213 device if more I/O is accessible by the latter device.  I am not sure whether later upgrades of CW do have header files specifically for the MC13213.  If not, it might be more appropriate to use the GB60 header file, or even to slightly modify an existing header file to suit.
 
Regards,
Mac
 
0 Kudos

571 Views
allenrubis
Contributor I
Thanks.
0 Kudos

571 Views
allenrubis
Contributor I

Hi,

I downloaded some firmware such as Test Mode App on your website and I also have a reference design MC13213SRB module. Also, I have my own project using mc13213 same design as with reference only without some peripherals (USB,Serial and memory). The difference is that my design is single ended (rf front-end) as compared with the reference its double ended (external switch). The test mode app configured for external switch. I would like to use the internal switch for test mode app.

What will I edit in the test mode app program (see attached file.)? I need to transfer the PA from PA1 to PA2.

I edited the MC13192_hw_config.c

SPIDrvWrite(0x07,0x0B80); /* Enable CLKo in Doze */

What else should I edit to tranform the firmware to single ended RF (Internal switch)?

THanks,
Allen RUbis

Test_Mode_App.zip

Message Edited by t.dowe on 2009-10-20 01:36 PM
0 Kudos

571 Views
allenrubis
Contributor I
Why is it used in the mc13213 datasheet? What processor family should i use in mc13213?
0 Kudos

571 Views
peg
Senior Contributor IV
Hi allenrubis,
 
Use smac_MC9S08GB60.h instead of the GT one. It has the full register defines.
Port D is fully connected in these devices. Bits 0, 1 and 3 internally and the rest externally.
 
Regards
Peg
 
0 Kudos