Suggestion for Doughman replacement text

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Suggestion for Doughman replacement text

3,403 Views
jmhill
Contributor I
Hello;

I regularly teach an embedded microprocessor course in the spring and have been happy with Doughman's Programming the Motorola M68HC12 Family ISBN: 0929392671. The problem is that the bookstore here says that Doughman is out of print. The RTC website has some info and a pointer to Amazon.com but available copies appears to be very limited.
http://www.rtcbooks.com/prog_motorola.php

I'd like to know with certainty if Doughman's text is out of print. I'd love to tell the buyer at our bookstore where to buy, say 20 copies for the upcoming spring semester. If Doughman's text is out of print, then I guess I could ask for copyright permission.

In anticipation that I might not be able to get copies of the Doughman text, can you suggest a replacement text? I like the way that Doughman addresses the hardware. I use a separate text that discusses real-time operating system issues.

Thanks;
Jonathan
0 Kudos
6 Replies

503 Views
GordonD
Contributor IV
Jonathan,

As you know, the book is no longer available from RTC Books, however, they have returned the publishing rights to me and I have had the book reprinted. I am currently having additional copies printed and larger quantities will be available within the next couple of weeks. An order can be placed at Amazon.com from MicroDialectsBooks.

Regards,
Gordon
0 Kudos

503 Views
JohnnyP
Contributor III
Gordon: Do you have a list of errors found in your text? I am using it to help port my old HC11 code, and I may have found a couple errors.

Page 361:

"When utilizing any of the port pins as a GPIO, the pin's associated bit in the TIOS register and the associated EDGxB and EDGxA control bits must all contain zeros."

Shouldn't that read OMx and OLx? I set up a test with TIOS=$FO, TCTL3=$FF, and the pins would change when I set and clear PTT8-5, but not when I turned on bits in TCTL1.

Page 430:

"For eight bit conversions, the result is placed in the high order byte of the sixteen bit result register..."

I couldn't read data unless I used the low order bytes, such as ATDD4RL
0 Kudos

503 Views
GordonD
Contributor IV
JohnnyP,

With regards to your question about the timer control bits, the previous paragraph on page 360 states "Even though a timer channel is configured as an input capture, the associated DDR bit can be set, configuring the pin as an output. In this situation, writes to the related bit in the Port T data register will cause input captures to occur if the pin logic is configured to respond to input edges." So the idea is, to prevent unwanted input capture events from occuring when using a PortT pin for GPIO, the EDGxB and EDGxA bit should be zero.

The paragraph at the bottom of page 359 explains that "When the associated timer channel is configured as an output compare, the timer logic forces the I/O pin to become an output regardless of the state of the associated Port T data direction register bit."

The specification for the HC12B32 (the device upon which the book is based) states "These bits contain the left-justified, unsigned result from the ATD conversion." A left justified 8-bit conversion would place the result in the most significant byte of the 16-bit register. Note that if you are using an S12 family device, an option exists (control bit DJM in ATDCTL5) to allow results to be left or right justified, however, the default state of this bit is to have the results left justified.

Hope this helps.

Regards,
Gordon



JohnnyP wrote:
Gordon: Do you have a list of errors found in your text? I am using it to help port my old HC11 code, and I may have found a couple errors.

Page 361:

"When utilizing any of the port pins as a GPIO, the pin's associated bit in the TIOS register and the associated EDGxB and EDGxA control bits must all contain zeros."

Shouldn't that read OMx and OLx? I set up a test with TIOS=$FO, TCTL3=$FF, and the pins would change when I set and clear PTT8-5, but not when I turned on bits in TCTL1.

Page 430:

"For eight bit conversions, the result is placed in the high order byte of the sixteen bit result register..."

I couldn't read data unless I used the low order bytes, such as ATDD4RL

0 Kudos

503 Views
JohnnyP
Contributor III
Gordon:

Thanks for taking your time to answer.

Yes, it's the 9S12C32, and I selected 8 bit res, right justify.

*****

So, if using PTx as GPIO, all the associated bits in TCTL1 or TCTL2, and TCTL3 or TCTL4 should be zero? AND THE TIOSx bit?

I want to use GPIO to set ouput pin PT6, configure TC6 to go low later, without having to wait around for it to happen.

Can't test now, but like this?

;Set PT6
BSET PTT, $40
BSET DDRT, $40
BCLR TIOS, $40
BCLR TCTL1, $30
BCLR TCTL3, $30

; Pin goes low after 10msec
LDD TCNT
ADDD #$1388
STD TC6
BSET TIOS, $40
BSET TCTL1, $20

do more stuff

Message Edited by JohnnyP on 2006-12-2008:14 PM

0 Kudos

503 Views
GordonD
Contributor IV
JohnnyP,

Rather than switching the pin function between GPIO and timer function, your best bet would be to leave the pin configured as an output compare and use the force compare function to set the output pin to a high state and then set up the normal output compare function to drive the pin low 10 mS later. The force compare feature is described beginning at the top of page 368.

Regards,
Gordon





JohnnyP wrote:
Gordon:

Thanks for taking your time to answer.

Yes, it's the 9S12C32, and I selected 8 bit res, right justify.

*****

So, if using PTx as GPIO, all the associated bits in TCTL1 or TCTL2, and TCTL3 or TCTL4 should be zero? AND THE TIOSx bit?

I want to use GPIO to set ouput pin PT6, configure TC6 to go low later, without having to wait around for it to happen.

Can't test now, but like this?

;Set PT6
BSET PTT, $40
BSET DDRT, $40
BCLR TIOS, $40
BCLR TCTL1, $30
BCLR TCTL3, $30

; Pin goes low after 10msec
LDD TCNT
ADDD #$1388
STD TC6
BSET TIOS, $40
BSET TCTL1, $20

do more stuff

Message Edited by JohnnyP on 2006-12-2008:14 PM




0 Kudos

503 Views
Annabooks_sl
Contributor I

Gordon,

 

I have no idea if you are still monitoring this thread, but I am the new owner of Annabooks. I know publication rights have been returned to you, but I am getting inquiries on you book. Any chance you can contact me?

 

Regards,

 

Sean Liming

www.annabooks.com

 

0 Kudos