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
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(;{
LED0_PutVal(!SW1_GetVal());
}
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;{}
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
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
Hi,
What versions of CodeWarrior and Processor Expert do you use?
Best Regards,
Processor Expert Support