Newbie question.

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

Newbie question.

3,866 Views
seang
Contributor I
So I'm a student. We learn to program the HC12 but stay with me as this really is an 8 bit thread.

In lab we have this super hefty development board. If you're going to answer this question you know what I'm talking about. They are huge; they've got 7 segment displays, LEDS, and most importantly, a lovely USB connection which makes loading the HC12 with the s19 file extremely easy.

Summer is coming up and I have this job where I work about 6 hours/day. Which leaves me plenty of time to...build a simple robot. I plan on using an HC08.

The primary question I have is: If I buy a DIP HC08 from say digikey, how the heck do I program it? It seems buying (or building) a development board like we have in lab is a bit excessive (and probably a little expensive) so what am I to do? I suppose I could build a much simpler board, but I have no idea how to do that, either.

Message Edited by seang on 2007-03-0704:09 AM

Labels (1)
0 Kudos
23 Replies

1,087 Views
seang
Contributor I
i see thanks

What is this BDM thing? Can I get an overview of that? Is it just a simple development board? I see on the schematic it intefaces with the MONO8. Does this mean I'll have to build both of them?
0 Kudos

1,087 Views
peg
Senior Contributor IV
Hi seang,
 
MON08 is the programme/debug interface for HC05 and HC08 families.
It needs some circuitry or an"adapter" to be built like you have seen for the JB8.
These _normally_ talk to the PC via serial port
 
BDM is the programming/debug interface for 9S08 and S12 families.
It requires a more complicated "adapter" to function.
These normally talk to the PC over the USB port.
But it is much more powerful.
You can buy one from www.pemicro.com or build the TBDML for S12 or the OSBDM for S08.
 
As the BDM interface is much better and the 9S08 devices are much better it can be argued that a beginner starting out now should just jump straight in to 9S08 and forget the older HC08.
 
This would probably be even more relevant to you with your previous S12 experience.
However it costs a little more to get started with the BDM.
 
0 Kudos

1,087 Views
Balk
Contributor II
Generally speaking, I believe the original question related to the best/easiest/most effective way of implementing an HC08 in a robot hobby project.
Although the idea of a development board was mentioned, I don't think that was the focus of the post.

So why has the discussion descended into the nitty gritty of USB to serial converters, and
the merits of current software, as opposed to older code?

To often on these forums, the original issue is tossed out the window so that a few contributors can post information that - for the most part - is irrelevant.
0 Kudos

1,087 Views
mke_et
Contributor IV
Hi Saluti...

"But in the case of the serial protocol use for programming the HC08 devices, the fault is neither the USB driver nor the interface program; It is simply the fact that the BREAK (ten zero's) signal causes problems with the serial communication. "

You know, I've heard that before. Especially in the automotive hack arena where people are using USB-serial cables to interface to OBD-II, and I do have to admit that some cables work better than others. But the standard trick is to just set a super-slow baud rate and transmit a 00 byte... Are you saying that wouldn't work?

What is it about the MON08 programming that requires a special break sequence?

As to the BDM... With the MON08 you have limited step and run capability, but with a BDM part it seems to be MUCH more powerful in what you can do with debug. But to be fair, part of my perception on that may be that the BDM interface I'm familiar with is for a 9S12DP256 part, and the MON08 part I'm familiar with is the KX8.

Mike
0 Kudos

1,087 Views
peg
Senior Contributor IV
Hi Mike,
 
The problem is that the MPU produces the BREAK and the PC has to recognise it.
So there is no oportunity to modify the BREAK.
And the available software won't go past this step if it is not recieved.
 
0 Kudos

1,087 Views
seang
Contributor I
I downloaded the zip file for the tbdml. Right now this is looking pretty good to me because it is well-documented. I have a question though. How come in the pdf file (tbdml_manual_15.pdf), they use the HC908? Isn't that an 8 bit uC? Isn't the whole TBDML idea supposed to be for 16 bit uCs only?

Message Edited by seang on 2007-03-0802:49 AM

0 Kudos

1,087 Views
P_EMark
Contributor III
Seang:

I noticed that you mentioned you're a student. I just thought I'd mention that P&E provides a very generous discount to Students -- 10% off all hardware, and 90% off all software.

We also have a few HC(S)08 development boards you can check out.

You can see our homepage here. Our stuff is not "free", however you may find that your time is better spent developing your robot rather than developing development tools. :smileyhappy: (though, in terms of a hobby, developing development tools can be pretty fun!!)

Regards,
Mark
P&E
0 Kudos

1,087 Views
mke_et
Contributor IV


peg wrote:
Hi Mike, The problem is that the MPU produces the BREAK and the PC has to recognise it.So there is no oportunity to modify the BREAK.And the available software won't go past this step if it is not recieved.

Regards
Peg


Alright, but the implication here is that there is no other way to pick up and detect that occurance. Are you also saying that USB-serial cables don't support framing errors?

By the way, has anyone else noticed that the 'Quote Post' doesn't work? It seems to always be pulling quotes from the wrong message. I've also seen my messages numbered wierd too, like 1,2,3,5,6,7,4

Mike
0 Kudos

1,087 Views
peg
Senior Contributor IV
Hi Mike
 


mke_et wrote:



Alright, but the implication here is that there is no other way to pick up and detect that occurance. Are you also saying that USB-serial cables don't support framing errors?


Mike

I think you are missing the point here. Of course you can make it work the problem is using standard hardware/software often it doesn't. These things are supposed to give you a serial port on a computer that doesn't have one that works just like one that does. Fact is they don't (its impossible!). Also every different one falls over differently. When you have writtten your magic driver that fixes all this for every different one be sure to protect it, it will be worth a lot of money! (BTW this is impossible as well)
 
 
On another point, I don't like these split/hijacked post either, but it happens (I am guilty often).
BUT, It works much better if people would reply to the correct post. Make sure you are viewing the post you actually want to reply to when you press "Reply".

 
0 Kudos

1,087 Views
joerg
Contributor II
Hi seang
I would like to come back to the original question! If you want to build a robot, i think the first thing is to do some homework. How should you robot look like? I mean robots could be build like the R2D2 or simple like a bug with two motors an two sensors. If you know the limits i think we are able to help to choose the right MPU (family, type, ...). Choosing the MPU, and build the robot around, seems to me like build the car around a motor you found elsewhere.

Saluti (Salutes) Joerg
0 Kudos

1,087 Views
seang
Contributor I
This message is in response to joerg;

Yes I'm looking to build a simple 2 motor moving robot with a few sensors. Nothing too fancy. Not too much more than that, but I'd like a little bit of 'headroom' just in case I get ambitious.

Man I don't know if I'm dumb or what. I feel like every other thread on this board has been taken care of in about 3 posts. Sorry for all this trouble and thank you guys very much!
0 Kudos

1,087 Views
bigmac
Specialist III
Hello Seang,
 
I think the more general questions, such as you originally posted, usually generates much longer threads than more specific questions, because "everyone" has an opinion, and is more prepared to express it.  Obviously there will also be greater interest from "third parties".
 
For your application, you will need to decide on how much I/O you really need.  I assume from your original post that you would prefer to use a device available in DIP (or perhaps SDIP), to simplify the prototyping, and perhaps to use a prototype with point-to-point hand wiring.  If you need to go beyond 16 pins, your choice is much more limited in this respect.
 
For 16 pin DIP you have the possibility of -
HC9S08QG8 with BDB programming & debug.
HC908QB8 with MON08 programming & debug.
 
Both these devices have quite similar functional capabilities.
 
Beyond 16 pins, I am not aware of any HC9S08 devices available in DIP, so you might need to incorporate an existing DEMO board within your prototype, to avoid the effort of a PCB layout to handle the SM package.
 
Within the HC908 family, a few of the devices are available with higher pin count DIP or SDIP, but will be more complicated to debug using the MON08 interface.
 
If you need more I/O than a 16-pin device can support, there is also a possibility of adopting I/O expansion methods using additional shift register devices, driven by the SPI module within the MCU.  But I/O access will be somewhat slower using this method.
 
Regards,
Mac
 
 
0 Kudos

1,087 Views
Balk
Contributor II
Now that the focus has been brought back to the original question - ROBOTS - I would again suggest that you look for a ready-to-program HC(S)08 module. Many of these modules come with a 6 pin BDM interface. This interface allows the connection of the BDM hardware, which facilitates debugging/programming.
The 3 components you will need are as follows:
1) HC(S)08 module
2) BDM Programmer (available from PE micro)
3) Code Warrior 5.1 (I believe a version of this may be downloaded free, from the freescale site - not sure though).
0 Kudos

1,087 Views
peg
Senior Contributor IV
Hi seang,
 
That's correct! They use a 8-bit MPU to implement the BDM interface adapter between a PC and a 16-bit target device.
You build this thing using an 8-bit device in order to programme debug something else that you built that uses an S12 device.
 
0 Kudos

1,087 Views
seang
Contributor I
thanks alot for all the help guys. I still haven't decided what I'm going to do yet, but I do have one quick question on the MONO8 schematic shown in the datasheet. Why is there both an oscillator and crystal, and a switch between them. Aren't they essentially the same thing?

thanks again for all your help and I'll continue researching the given options.
0 Kudos

1,087 Views
Balk
Contributor II
Seang,
you are right - trying to build your own development board will take a lot of time and can potentially take up your entire summer if you haven't tried it before. I would suggest that you obtain a pre-built HC08 module, complete with memory, peripherals, I/O lines etc. Many of these modules also come with convenient interfaces (USB, RS232) to program the HC08.

The following website will be very helpful:
http://elmicro.com/hc08web/index.html

I believe Axiom for example, has HC08 modules already built that can be obtained for $100.
Good luck with the robot.
0 Kudos

1,087 Views
joerg
Contributor II
Hi Seang,
i think building up your own board is not that difficult, since some of the devices are in a DIL case. The only thing to consider is how to program it. The HC08 devices are using a simple serial interface, but be aware that you MUST have a real serial port on your PC. Since USB converters are causing mostly trouble. The HCS08 devices need a BDM (like OSBDM08+E) but they are easyer to debug and easier to interface in general. If you need schematics on HC08 and HCS08 you may look at my home page, where most the manuals are containing the schematics. If you don't find the one you need ask!

My homepage:

Saluti Joerg
0 Kudos

1,087 Views
mke_et
Contributor IV


joerg wrote:
... but be aware that you MUST have a real serial port on your PC. Since USB converters are causing mostly trouble.



I'm sorry, but this is part of the problem.

There is NOTHING wrong with USB interfaces. Or USB to serial interfaces.

That is, if the software that is driving the USB-serial interface is worth anything.

Yes, there IS some damaged software out there that only works on 'real' serial ports. But 99% the problem can be tracked down to one of 2 issues.

1) The software author wrote the code BEFORE there use 'virtual' serial ports for greater than COM1 and COM2. There may be nothing wrong with the serial port as such. Just that the software is 10+ years out of date with current technology. In these cases not only will you have trouble with USB-serial interfaces, but you probably also have serious issues with ANY and ALL serial interfaces that are 'beyond' the original COM1 and/or COM2 spec of the original PC-XT. That means PC-Cards and even add on cards. And even with some machines that DO have COM1 and COM2.

2) The software author wrote code using tools that limit what they can do with com ports and just hasn't upgraded. Writing programs with something like Turbo Basic... Or worse!

In both the above cases it's NOT the USB-serial issue, it's the programmer not knowing what to do issue.

To be honest, there IS an issue with USB-Serial usage that can turn around and bite you on the lips. USB devices can be more aggressive with power management and that can be a problem. For example, I have some stuff that uses DTR and other modem control lines. In practice, I was using DTR to hold power to a 1-wire device (a counter) and if I let the device go idle, my counter would reset and loose it's count. But once I built an exteral 'mux box' to talk to multiple devices with one port, and the mux box had it's own power supply that didn't turn off with power management, then the problem went away. Oh, and my software works fine at ANY com port, even up above COM100. (There are real simple tricks to use high numbered com ports, and if you hear a software writer say it doesn't work, then question the REST of what that writer tries to tell you!)

As to the original posters question... realize there are some '08 parts that support BDM. If you choose one of them, then you can pretty much use the same setups and tools for the 12 on your '08 project. My last '08 project I used the MON08 interface, and it's not bad, but not close at all to the BDM setup I use with the '12. Just for the interface connections... In my case, I made my '08 board so that it had .156" card edge fingers and I just 'drop in' the card to a connector to program/debug it. It's only a credit card size, so that was a simple option, especially since I used a real simple '08. If I had to do anything more complex at all, I'm choose an '08 variant that supported BDM.

Mike
0 Kudos

1,087 Views
joerg
Contributor II
Hi
first to seang's question: Could you please specify the schematics you are referring of!
My programmer and a lot of data sheets i know are using only on clock source. If yo do not use a "hightech" programmer, the clock source needs to be chosen for the baud rate used; i.e. 4.915 Mhz for 4800 baud.

Now to mke_et:
I fully agree that, if some software is not working with a USB converter, it i mostly the program that does cause the fault. But in the case of the serial protocol use for programming the HC08 devices, the fault is neither the USB driver nor the interface program; It is simply the fact that the BREAK (ten zero's) signal causes problems with the serial communication. After hours of testing and debugging (even with hightech logic analysers ...) and about four different USB chips, i can only say: buy a MONLINK08 or have a real serial port (with the possibility to disable the FIFO's) on your PC.

Good luck!

Saluti Joerg
0 Kudos

1,087 Views
seang
Contributor I
http://www.freescale.com/files/microcontrollers/doc/data_sheet/MC68HC908JB8.pdf?srch=1

page 165

I don't understand why there needs to be 2 oscillators.
0 Kudos