Problem with HCS12E128 and Processor Expert

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

Problem with HCS12E128 and Processor Expert

4,545 Views
jmcoreymv
Contributor I
I've got a Softec demo board using the HCS12E128 and I'm having an issue when I use the Processor Expert beans on a 16-bit port.  Specifically when I use the PortAD as a GPIO port and I assign BitIO beans to it.  If I assign a BitIO bean to PAD04, and then just write my code as normal it wont work.  We found a way to fix it by going into cpu.c and the bitbean header file and changing all references from the PortAD from Hi to Lo.  So like DDRADLo has to be changed to DDRADHi or DDRAD, and the rest of the registers must be switched as well.  I have to do this by hand everytime processor expert regenerates the code.  Does anyone know of a fix for this?
Labels (1)
Tags (1)
0 Kudos
Reply
6 Replies

956 Views
jmcoreymv
Contributor I
From reading the datasheet, it says that PORTAD0 should contain PORTAD[15:8] and PORTAD1 should contain PORTAD[7:0].  Isn't PORTADLo the same thing as PORTAD0?  I'm not sure why its not working, but its not working for about twenty different people.  I've tried to download the new version of CW off the website but it just has me fill out a request form (which I've done 3 times) and I've never got a response.
0 Kudos
Reply

956 Views
jmcoreymv
Contributor I
I tried to send an email to the above address but it was denied because of the attachment.  I have included the sample project with this post.  Thanks!
 
Email Text:

Thanks for helping me out.  Attached is a project I created which use two BitIO beans.  One bean is an output LED bean and the other is a SW input bean.  All it does is turn on the LED when the switch is pressed.  I have included all the generated code and it will not work how it is included. 

To fix it, I have to go into cpu.c and modify the registers ATDDIEN1,PIEADLo,PPSADLo,PERADLo, and DDRADLo.  The Lo and the 1 have to be removed or replaced by a Hi and a 0 for it to work properly.  I also have to go into SW1.h and modify the GetVal() macro and get rid of the Lo on that register too.

Another less major issue is that everytime I regenerate the code from processor expert (besides changing those registers above back) is that it removes my user generated code in the main() for loop.

 I was also able to replicate this problem when I used ByteIO on the 16-bit port too.  My entire class is having the same issue as me (Professor included).  We are using the Softec Demo board with HCS12E128 processor.

Message Edited by jmcoreymv on 04-21-200610:18 AM

Message Edited by jmcoreymv on 04-21-200610:19 AM

 

TestProgram.zip

Message Edited by t.dowe on 2009-10-22 10:02 AM
0 Kudos
Reply

956 Views
ProcessorExpert
Senior Contributor III

Unfortunately we don't have Softec Demo board, but we I tried your project with Adapt9S12E128 demo board from Technological Arts. No problem with registers as you described was found again, the LED turned on when the switch pressed. Please check Softec demo board setting to find probable reason of your problem.

Note:Your user code shouldn't be written to 'Processor Expert end of main rountine' section, but above it not to be remove it after generation, see example.

void main(void)
{
 /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
 PE_low_level_init();
 /*** End of Processor Expert internal initialization.                    ***/

 /* Write your code here */
  for(;:smileywink:{
     
   LED0_PutVal(!SW1_GetVal());
   
 }

 /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
 for(;:smileywink:{}
 /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/

0 Kudos
Reply

956 Views
jmcoreymv
Contributor I
I am using CodeWarrior IDE 5.5.1272
CW Plugin IDE 3.62
Processor Expert 2.95 for the HCS12

Message Edited by jmcoreymv on 04-19-200609:30 AM

0 Kudos
Reply

956 Views
ProcessorExpert
Senior Contributor III

I tested your problem on HW with CW3.1/PE2.95 and with newer release CW4.5/PE2.96 and no problem with Lo and Hi registers was found. Is it possible to send a project demonstrating the problem to support@processorexpert.com? I will look at all project and beans setting and I will try to help you.

Best Regards, Processor Expert Support

 

0 Kudos
Reply

956 Views
ProcessorExpert
Senior Contributor III

Hi,

What versions of CodeWarrior and Processor Expert do you use?

Best Regards,

Processor Expert Support

 

0 Kudos
Reply