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
0
votes
0 answers

Sprintf not working with dragon12-light board(C)

I'm trying to program a Dragon12-Light board to display information to a PC through Cool Term terminal software, however I can't seem to get the sprintf function to work properly. The goal is to send information from the temperature sensor and…
Joe
  • 1
0
votes
1 answer

HCS12 embedded: counter timer and calculated output compare values

I'm having trouble with timer output compare interrupts on the HCS12. The problem seems to be that I'm writing calculated values to the output compare registers rather than immediates, ie... OCval = x + y ; ldd OC1, OCval ; // what I need to do ldd…
BruceV
  • 117
  • 2
  • 10
0
votes
0 answers

Assembly - Number of elements in register B HCS12

I've spent at least a week looking for references regarding this issue and I have to say I'm starting to give up. I can't seem to be able to find any notion regarding the number of elements in an array stored in register B on a HCS12. The memory…
Klorine
  • 1
  • 1
0
votes
1 answer

Proper convention for handling the stack when managing parameters and the return address

What is the best way to handle having the return address of a calling function on top of any parameters that have been placed in the stack when you need to access parameters 'below' it in the stack? I am using the S12 Motorola/Freescale processor.…
acampb311
  • 333
  • 4
  • 11
0
votes
1 answer

reversing the direction of a bar chart in C

I want to programme my own version of a variometer to represent the climb and sink in metres/second. The values are displayed on to a LCD module screen. The climb and sink values are scaled down from a potentiometer that I can rotate to change the…
user_1
  • 45
  • 1
  • 3
  • 8
0
votes
1 answer

Assembly language, don't understand the instruction codes and memory locations

I'm studying for a test in my digital design class and I don't understand some things. Here is the worksheet with the answers on it, I understand the PC address for each instruction. What I don't understand is on b, where it says where does the…
0
votes
2 answers

Scaling down a range of numbers in C

I am reading values from a potentiometer that I can rotate to produce a range of numbers from 0-1023. I want to be able to display these numbers in terms of a horizontal bar graph on an LCD screen. The LCD screen is 20 blocks wide so the 0-1023…
user_1
  • 45
  • 1
  • 3
  • 8
0
votes
3 answers

How to scale a number/range of numbers in c

I want to be able to display the altitude in ft ranging from 0ft to 20000ft on my LCD module. The numbers are read from a potentiometer that I can rotate to change the values. At the moment the potentiometer displays from 0 to 1023 but I need to…
user_1
  • 45
  • 1
  • 3
  • 8
0
votes
0 answers

prompting a user to press a certain key in c

I am using icc12 (ImageCraft) and a hc6812 microcontroller. I want to prompt the user to press the zero key on the LCD keypad for the next menu to appear on the LCD display. I can't seem to get my code to do this. ( zero key pressed =…
user_1
  • 45
  • 1
  • 3
  • 8
0
votes
1 answer

undefined symbols in .o file

I am using icc12 to make a project that contains three files: .s file containing a series of subroutines in assembly language .h file with a list of the functions .c program containing my main code where I call upon my subroutines My issue is that…
user_1
  • 45
  • 1
  • 3
  • 8
0
votes
1 answer

calculating delay cycles for hcs12

I try to calculate number of instruction cycles and delay cycles for HCS12. I have some information about HCS12 The HCS12 uses the bus clock (E clock) as a timing reference. The frequency of the E clock is half of that of the onboard clock…
0
votes
2 answers

Change on code size when using far pointers in C

I work in the department of a software company that deals mainly in automotive network design. We write network protocol stacks in C, mainly. Recently, I was assigned a project which required the use of Freescale's HC12 controller. Originally…
an4s
  • 161
  • 1
  • 10
0
votes
0 answers

converting string to int assembly

I have been trying to write the code for hours. My algorithm is that read the string char-by-char, subtract #$30, which means '0' and hold it in a address. Hold another random address in which is filled by 0. Then until end of the string, multiply…
0
votes
1 answer

simple for loop and sum

I'm trying to learn HCS12 assembly language but there are no enough examples on the internet. I've tried to write a code but there is no success. I'm stuck. It's not absolutely homework. Can someone write it in HCS12 assembly language with comments?…
user4134614
0
votes
1 answer

What's the right way to add even or odd numbers in this assembly code

For example I have a file (codes.txt) with these code nums CODE1 fcc "3392236" CODE2 fcc "1234550" CODE3 fcc "7654361" CODE4 fcc "1212223" CODE5 fcc "1233211" CODE6 fcc "1232343" Next, a subroutine called readCode_Driver which job is…
answerSeeker
  • 2,692
  • 4
  • 38
  • 76