QG4/8 Quick Start Guide here

cancel
Showing results for 
Search instead for 
Did you mean: 

QG4/8 Quick Start Guide here

33,730 Views
hightech
Contributor I
Here is the QG4/8 Quick Start Tips for everyone.  Your feedback is welcome.
 
MC9S08QG4-8_Quick_Start_Tips1.pdf
Message Edited by dkindler on 2009-08-19 11:13 PM
Labels (1)
0 Kudos
31 Replies

227 Views
General
Contributor I

Really nice datum  it is! 

Thanks for sharing!

Regards,

General

0 Kudos

227 Views
GrungeRey
Contributor I

I bought a DEMO9S08QG8 kit.

I wonder If I can used the BDM_PORT to program other king of MCU?

Like the QG4 or might be other kind of core family?

0 Kudos

227 Views
peg
Senior Contributor IV

Hello and welcome to the fora, GrungeRey.

 

Yes you can do this as long as you avoid the latest versions of Codewarrior that specifically disable this ability.

 

Refer to this post to see how to modify new versions to allow this.

0 Kudos

227 Views
GrungeRey
Contributor I
Thanks Peg,
0 Kudos

227 Views
Mike2
Contributor I

Hi All,

I'm new to this forum and hope I,m on the correct one, if not please direct me.

My comp is running'XP' and I'm using CW.V5 special edition, not registered, single user.

I have previously used the GT16 chip many times and programmed over 10K in assembler

without problem. Now I am trying to use the DemoQG8 board with the USB interface.

Big problems, I can program up to 1K (a previous project) with no problems, the current project 3.4K assembly (not yet complete)

but ready for some run tests is perfectly o/k in FCS mode, switching to PE Multilink, comms = O/K, program flash?

YES, goes through all the motions and returns flash programmed and verified! Program window closes, debug opens,

source,data,procedure, windows are empty, the memory window shows all Zero from E000 (reset entry) The assembly window (reset to zero) has no relevance to the source code. I can open the source code window which is correct, but I understand this is a read only file. I'm pretty sure the chip is blank.

Question, why can I program a 16k GT16 using a (homebuilt) mono8 interface with as much code as I like and yet not a QG8 (3.5K assembly) with the demoQG8 board?

Do I need to register the product CW.V5 This was downloaded from the WWW a couple of years ago and so I have no registration key anyway.

Or am I simply missing somethig in the settings panel?

I will be most grateful for any help.

Regards.  Mike.

 

 

 

 

0 Kudos

227 Views
Mike2
Contributor I

My Apologies to you all,

After studying the .map and the .prm files I found the problem (7 days later)!

I obviously write code from the reset entry point but place text files used for the LCD etc at the top of memory,

Out of the way of any code. I had missed the fact that the flash programming registers  where up there preceding the vectors!

 I had overwritten the flash registers with my own text code. What an idiot. 

After moving the text files down by 32 bytes all now works well, I can program and debug the chip.

To Peg if your watching, I am using your suggested BDM link from the DemoQG8 board to my target board (another forum)

BDM compatibility I seem to recall. 

It works well and I am able to Debug and track the real application, thanks for the advise. 

Again my apologies to you all for wasting your time due to my own stupidity.

Best wishes and thanks,

Mike2.

0 Kudos

227 Views
bigmac
Specialist III

Hello Mike,

 

If you use the standard, CW supplied include file for the specific device, the value of ROMEnd is defined, in this case:

ROMEnd:  equ   $0000FFAD

.

The file derivative.inc, which is automatically created by  the CW new project wizard, does include the appropriate file.

You might then use the following method, which should apply for any HCS08 device you happen to use:

 

LCD_DATASIZE equ xxxx 

 

  ORG   ROMEnd - LCD_DATASIZE

  dc.b  "LCD text start",0

  etc

.

Writing inappropriate value to some of the non-volatile registers might cause your program to malfunction.  However, I cannot see the mechanism by which the flash programming would not be completed.  Programming the NV registers is part of the normal programming procedure.

 

Regards,

Mac

 

0 Kudos

227 Views
Mike2
Contributor I

Hello Mac,

Thanks for your response and the code tips (now in use). Makes much better sense than my own.

[ Text:  Equ  xxxx ] Followed by 24 messages, then figure out how much memory I need!

I have again looked at the N.V register summary, I was overwriting FFAO through FFDO.

FFCO through FFCF = rom_1, it was not defined, so that may have caused a problem? I think

the problem was overwriting FFAE through FFBF, the N.V registers, More than likely I had changed the

trim bits and the flash security bits? But this would seem to indicate that the N.V registers where programmed

first? Resulting in my case, in a blank chip, although the Multilink programming routine indicated " flash erased, programmed and verified, ready for debug" but the chip was blank! Perhaps a bug in cw-v5? or more likely my own lack of understanding.

I don't know, I can only say that since I moved the text code down to a new Equ the problem is solved.

Thanks again for your help Mac,

Regards Mike.

0 Kudos

227 Views
fiction
Contributor I
Hi Hightech,
i am a newbie to Freescale i have the following Demo board (9S08QG8) has anyone have a schematic diagram for this Dev board or where can i get it. 
Also great doc...
thanks
 
0 Kudos

227 Views
peg
Senior Contributor IV
Hi fiction,
 
I think what you are after can be found here:
 
 
0 Kudos

227 Views
fiction
Contributor I
Hi Peg,
Its exactly what i needed...
Thank you greatly.....  
0 Kudos

227 Views
allenrubis
Contributor I
Do you have start guide for mc13213 - MC9S08GT60 MCU
Thanks,
Allen
0 Kudos

227 Views
airswit
Contributor III
will it be okay to hook the AC line right to a digital input through a resistor, as suggested in the guide? also, will it detect the negative->positive crossing as well? i am wondering if i can do this on my main processor (MCF5213) rather than use dedicated zero cross circuitry. I'm wondering, also, whether it would be safer/easier/more accurate to put the ac line on an A/D input, and use a zero crossing function (built in on the MCF5213) to see when it crosses zero. any help appreciated!

Trevor
0 Kudos

227 Views
airswit
Contributor III
could you maybe include something about how to use this as a keypad controller? i.e. debouncing, and maybe using it for a matrix keypad controller? I havn't started with this controller yet, but I wouldn't mind using this rather then a dedicated keypad controller.

The guide is pretty good though, gave me a nice quick intro to what these little guys can do!
0 Kudos

227 Views
peg
Senior Contributor IV

Hi,

Still chasing some matrix keypad info, huh.

I use one based on the example in M68HC05AG/AD Rev. 1, don't know if its still here as I have one made from a tree.

Its part of the full application which is a home thermostat. Doesn't use KBI but may help you to get started with some basic concepts (Oh dear there is that word again).

Regards Peg

 

0 Kudos

227 Views
airswit
Contributor III
wow, that is actually pretty easy to accomplish. however, is there perhaps a way to do it so that the whole process doesn't take 100ms, or so? what i mean is that, is there some way to be able to execute other code while the keys are being debounced? I think i can find 8 pins on my main processor (MCF5213) to set up a keypad interface, but i have more important things to do, also. I was thinking of maybe setting up a PIT to scan the keys every so often, but don't want to sit in the ISR for 1/10 of a second!

p.s. thanks for the link, peg!

Message Edited by airswit on 05-13-200602:17 PM

0 Kudos

227 Views
irob
Contributor V

airswit wrote:
wow, that is actually pretty easy to accomplish. however, is there perhaps a way to do it so that the whole process doesn't take 100ms, or so?

p.s. thanks for the link, peg!


Peg, I'd like to find that sample code myself, but couldn't find any "x68HC05Ax" anywhere on Freescale, or Google for that matter. Can you post a link to that datasheet?

airswit, I'm not sure how involved the keypad scanner code is, but perhaps you could use a looping state machine instead of an ISR. The advantage of the FSM is that you can slice up all the debounce and logic timing. I find FSMs to be much easier to debug too. You'll always know where your program is if something goes wrong.
0 Kudos

227 Views
peg
Senior Contributor IV

Hi Rob,

As I said the link is the top shelf of my bookcase, but I found this on the C8A page:

http://www.freescale.com/files/microcontrollers/doc/ref_manual/M68HC05AG.pdf

I did not wait for it to download though.

The delays aren't a problem in my application although I am using 15ms which was discovered to work OK accidently. A calculation mistake to change the sample code to suit my bus freq. gave this and it was not discovered until many years later when I changed the product from 05C8A to 08GP32 with a new bus freq. that required the delay to be recalculated. So I just kept the wrong delay. I am using good quality Rafi keyswitches though.

Regards Peg

 

Message Edited by peg on 05-16-200608:25 AM

0 Kudos

227 Views
airswit
Contributor III
is it possible to use the development board to program the 8 pin devices (rather than have to buy the bdm cable)?

also, i don't think it is, but is it possible to use another micro (MCF5213) to program one of these micros, without having to write a ton of software?
0 Kudos

227 Views
Boost
Contributor I
Hi, I'm new to this wonderful hobby and am having an issue with the ACMP function for a QG8 based application. Using Hitec's Q.S. ACMP code sample, when compiling, I get: ERROR,C1815, Unasigned variable (or typename).associated with ADC_val_H and ADC_val_L. As a newbie, Im sure there is a simple fix for this error. Would apreciate assistance to this matter. Also need to configure an output control line from the comparater using a pressure sensor on the +In side. Thank You for any help on this. 
 
I am also having the same problem that New kidd is having is there a fix?
 
 

Message Edited by Boost on 04-19-200612:28 PM

0 Kudos