CW & PE init of non-bonded I/O

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

CW & PE init of non-bonded I/O

Jump to solution
1,475 Views
PaulBreneman
Contributor I
Hello,

I'm using CW 6.1 & PE 3.01 for the MC9S08SH8_16.  On the 16-pin version of that chip, port C (C0-C3) is not connected to actual pins.

Here is what the data sheet PDF says: To avoid extra current drain from floating input pins, the reset initialization routine in the application program should either enable on-chip pull-up devices or change the direction of unused pins to outputs so they do not float. When using the 16-pin devices, the user must either enable on-chip pullup devices or change the direction of non-bonded port C pins to outputs so the pins do not float.

Maybe in the future PE could add this capability on the CPU bean Properties page?

In the meantime, should I add the init code to the CPU bean "Build Options" page in one of the three "User initialization" strings.  Any suggestions of which to use and what to add?

Thanks,
Paul Breneman
http://www.BrenemanLabs.com

Labels (1)
Tags (1)
0 Kudos
1 Solution
457 Views
ProcessorExpert
Senior Contributor III

The possibility to initialize unused and non-bonded pins has been added to the new version of the Processor Expert (PE 3.02 for the CW 6.1). Service pack with Processor Expert 3.02 should be available within two weeks.

 

Possible workaround for PE 3.01 or older for initialization of the unbonded pins is to use the "User code after PE initialization" string list. The property "User code after PE initialization" allows you to specify your own initialization code. This code will be placed to the end of the _EntryPoint function located in the CPU module. Please note that at this point the stack pointer is not initialized therefore it is not possible to call any functions. Example of your code is: setReg8Bits(PTCDD, 0x0F);.

 

Simpler workaround is to use the code setReg8Bits(PTCDD, 0x0F) in the main function. Using the "User code after PE initialization" property is not necessary.

 

Best Regards

Vojtech Filip

Processor Expert Support Team

UNIS

View solution in original post

0 Kudos
2 Replies
458 Views
ProcessorExpert
Senior Contributor III

The possibility to initialize unused and non-bonded pins has been added to the new version of the Processor Expert (PE 3.02 for the CW 6.1). Service pack with Processor Expert 3.02 should be available within two weeks.

 

Possible workaround for PE 3.01 or older for initialization of the unbonded pins is to use the "User code after PE initialization" string list. The property "User code after PE initialization" allows you to specify your own initialization code. This code will be placed to the end of the _EntryPoint function located in the CPU module. Please note that at this point the stack pointer is not initialized therefore it is not possible to call any functions. Example of your code is: setReg8Bits(PTCDD, 0x0F);.

 

Simpler workaround is to use the code setReg8Bits(PTCDD, 0x0F) in the main function. Using the "User code after PE initialization" property is not necessary.

 

Best Regards

Vojtech Filip

Processor Expert Support Team

UNIS

0 Kudos
457 Views
PaulBreneman
Contributor I
Sounds good.  Thanks!

0 Kudos