SBasic on 68HC912B32 HC12 derivative

Mar 14, 2006 0 Replies

Hi:



I am trying to get SBasic code to work on the 68HC912B32 HC12. I am simply trying to set the first 4 bits of port b high and the last 4 bits low. I am using a DC volt meter to measure the high and low voltage on the port. Unfortunately, it never works and I get the following errors.



When loading the .S19 file via hyper terminal and running it initially I get the following error:



BDLC Exception PC SP X Y D = A:B CCR = SXHI NZVC



0101 00F6 FC60 0000 82:6D 1000 0010
0101 EC46 LDD 6,Y

If I run the code again without resetting I do not receive the error. At times, it also does not do it on the first run. Not sure what that indicates.



Here is my Sbasic code:



const portb = $1002



main: ' Main Program Label



do pokeb portb, $f0 loop



end ' End of Main Program Label



I am using the following command line to create HC12 assembler code:



sbasic /m6812 /i /c0800 >.asm



I have to set the code begin at $800, because the default b600 does not work on my EVB. When programming straight in assembler I always used



800. The /i option is necessary to prevent creating of an interrupt vector table, which the 68H912B32 does not like. I am using the as12.exe compiler to create the .S19 file.

If anyone is programming this particular chip/EVB using SBasic, I would appreciate any help/pointes you might have to get this to start working. I am planning to use SBasic for my future coding, but if I can't even get something as simple as this to work, then I will stay away from it.



Thanks for your help!



Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required