Questions tagged [68hc12]

A 16-bit microcontroller family from Freescale Semiconductor

The 68HC12 (6812 or HC12 for short) is a microcontroller family from Freescale (former Motorola) Semiconductor. Originally introduced in the mid 1990s, the architecture is a 16-bit enhancement of the 8-bit Motorola 68HC11. Programs written for the HC11 are usually compatible with the HC12, which has a few extra instructions. The first 68HC12 derivatives had a maximum bus speed of 8MHz and flash memory sizes up to 128 kB.

Around year 2002, the devices known as 68HC12 were gradually replaced by the very similar HCS12, which uses the same CPU core but different hardware peripherals. The name 68HC12 or HC12 (without 'S') nowadays refers to the older, obsolete MCU.

Source: Freescale 68HC12D data sheet/manual

50 questions
1
vote
0 answers

STAB not working in HC12 Assembly

so I've come up with the following code thats calculating the required byte / word offset of an array. org $1000 NROWS db 3 NCOLS db 3 D2ARR_1 db 0, 0, 0, 0, 0, 0, 0, 0, 0 D2ARR_2 dw 0, 0, 0, 0, 0, 0, 0, 0, 0 byteOffset rmb 1 wordOffset rmb…
Belgin Fish
  • 19,187
  • 41
  • 102
  • 131
1
vote
2 answers

Does PuTTy work correctly with ANSI/VT100 escape sequences?

I'm writing a program for a class in HC12 Assembly for the Freescale MC9S12C32 processor. I'm using PuTTy as the terminal attached to the device via serial(-over-USB). For this assignment, we are supposed to use VT100/ANSI escape sequences to move…
Huckle
  • 1,810
  • 3
  • 26
  • 40
1
vote
3 answers

Is it generally possible to uniquely identify an individual MCU (for licensing purposes) (no MAC address available)

I am being asked to enhance the firmware installation program for an MCU (specifically, a Freescale MC9S12E64 - though I don't know if this matters). The purpose of the enhanced installation is to limit the number of times the firmware can be…
Dan Nissenbaum
  • 13,558
  • 21
  • 105
  • 181
1
vote
4 answers

How do I call assembly code from a C file within CodeWarrior?

The professor would like us to program a part of the program using assembly code, and then he would like us to call this code from within a C program, and then jump back to the C program when it is completed. I can't seem to find any documentation…
user702905
  • 71
  • 1
  • 4
1
vote
1 answer

Real time user input echo

I'm trying to create and "elegant" way of displaying in real time what a user inputs into a custom kernel, for a 68hc12, I'm working on. #include "hc12sci.h" #include "iomanip.h" int main() { Hc12Sci hc12sci(sci0,16,36); // serial port, rxlen,…
Lpaulson
  • 109
  • 2
  • 12
1
vote
0 answers

How can I namespace my labels in codewarrior

I have three files, an .asm file and some .inc files. They are both being included with include. In these files there are labels, and I would like to be able to sometimes use the same label in each. For example, if each included file has a loop,…
Ziggy
  • 21,845
  • 28
  • 75
  • 104
1
vote
0 answers

In HC12 can I do (1<<8) in one instruction?

I've noticed that the instruction set has an LSL (logical left shift), which does r << 1 (left shifts the register by 1). I'd like to be able to left shift by an arbitrary number. Do I need to do this in a loop, or is there a single instruction that…
Ziggy
  • 21,845
  • 28
  • 75
  • 104
1
vote
0 answers

Assembly stopwatch on 68HCS12

Hi i'm trying to make a stopwatch in assembly to run on a dragon 12 plus board, i have it set up so the buttons start stop and reset the time, the program runs but it isn't fast enough. I know the problem has to do with latency but i cant figure out…
0
votes
0 answers

8 bit led counter on assembly. How do I increment the counter value, x within this loop?

I need some help with an 8 bit counter in Assembly. I want to map this to I/O portB to be used by the Led. To explain it further what happens is that the counter decrements each time before and loops back until it reaches zero. At the same a value x…
Ryan Paye
  • 21
  • 4
0
votes
1 answer

Assembler HCS12 how does register with index work with TST-instruction?

Hello this is my test code: LDX #$2000 LDY #$1000 LDD #$0000 la: ADDD #1 MOVB 1, X+, 1, Y+ TST -1, X <-- what do I check here? BNE la My question is what do I…
0
votes
1 answer

Difference between decrement and subtraction in 68HC12

I'm using the HC12 chip. We have instructions SUBA and DECA. The way you use SUBA is by subtracting some value (either in memory or a value you specify) from register A. DECA however takes no parameters and just subtracts $01 from register A. So my…
arpanet101
  • 183
  • 1
  • 11
0
votes
1 answer

need help debugging assembly code (HCS 12)

need help debugging, when assembly code goes to my subroutine it is printing out the value of register B instead of the value of register A. Any help is much appreciated. dc.b "Type a character" dc.b 0 ; using zero…
frankH
  • 1
  • 1
0
votes
0 answers

GNU as doesn't accept flag when called from makefile, but OK when manually typed

I am trying to recover a project that I was forced to put on the back burner a few years ago when the M68HC12 was current. I have $1000 invested in prototypes, so don't want to start over with a new chip since it is a proof of concept…
0
votes
0 answers

how to multiply 2 24 bit numbers in assembly

I am trying to multiply 2 24 bit numbers M and N and store the product in p at memory location $1100. The expected output when I do md 1100 should be $07336BF94116 but I am getting 07 1A 48 58 - 41 16 8D 0C - 92 C2 82 85 - 48 B9 79 03 I am not…
Brian Kreidberg
  • 179
  • 1
  • 13
0
votes
1 answer

Assembly Language: Result in accumulator

Can someone help me understand this question that I have on a handout. What is the result in Accumulator A of the following code LDAA #$3B ______________ and ORAA #$23 ______________ I understand that the first one says Load in Accumulator A the…
Val
  • 9
  • 5