Archive for the ‘Axiom’ Category

5/24: Safe Interrupt Enable / Disable

Axiom, HC12ShawnNo Comments

Having trouble switching from cooperative tasking? One of the easiest oversights is your “sei” and “cli” sections.

The diagram below shows how you can run into problems within the critical sections of code. In this example when the memory allocation ends the interrupts are enabled with “cli” removing the critical section around the linked list manager. Once this happens RTI ISR fires and switches in thread 2. This example shows thread 2 popping an item from this list breaking the flow inside of thread 1.

Read the rest of this entry »

4/29: Threading

Axiom, HC12ShawnNo Comments

Threading allows functions to execute concurrently. The example below shows two threads switching between running and sleeping. As the RTI ISR executes it takes the current process off the schedule (list of processes) and switches in the next process on the schedule. Once all processes have been removed from the schedule the “Scheduler” steps in and creates a new schedule.

Read the rest of this entry »

4/7: HC12 Read String or Char

Axiom, HC12Shawn2 Comments

Use this to read a string on the HC12. What this function does is check to see if there is an available character in the HC12’s Serial Communication Interface Port 0 Data Register. If you need to use this function with 9bit values the function needs to be adjusted to incorporate SC0DRH. Similarity if you would like to use Port 1 change SC0 to SC1.

UPDATE: I added the single char version because thats more basic.
Read the rest of this entry »

12/30: MON12 Jump Table

Axiom, HC12ShawnNo Comments

This is the jump table from the CML12S-DP256 v2.7F. Use this if you want to access MON12 functionality inside of your programs.

Read the rest of this entry »

12/20: HC12 Build you’r own Character

Axiom, HC12ShawnNo Comments

Using code from the manufacturer Axiom and several data sheets to figure out what they are talking about I finally found how to send your own character to the CGRAM (Character Generator RAM).

Read the rest of this entry »