EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

HCS12 microcontroller question

Started by panfilero February 9, 2007
Hello, I just got a MC9S12NE64 microcontoller and a development board,
and I've been trying to access my microcontroller through the
hyperterminal on my computer but have been having a really hard time.
I couldn't find any serial port driver files for this MCU, but had
some for a MC9S12C32 which i tried to modify to use with my MCU... my
code compiles on codewarrior and loads into my MCU but.... I can't get
it to show anything on the hyperterminal.... I was wondering if anyone
could tell me what steps I need to take to do this serial
communication with my MCU, or if anyone knows of any good resources or
websites where i could find driver files for this?  My ultimate goal
is to control a programmable power supply through the serial port of
my MCU, so I'm trying to get familiar with the serial port by
accessing it through a hyperterminal....

any help or suggestions would be greatly appresicated,
thank you
Joshua

panfilero wrote:
> Hello, I just got a MC9S12NE64 microcontoller and a development board, > and I've been trying to access my microcontroller through the > hyperterminal on my computer but have been having a really hard time. > I couldn't find any serial port driver files for this MCU, but had > some for a MC9S12C32 which i tried to modify to use with my MCU... my > code compiles on codewarrior and loads into my MCU but.... I can't get > it to show anything on the hyperterminal.... I was wondering if anyone > could tell me what steps I need to take to do this serial > communication with my MCU, or if anyone knows of any good resources or > websites where i could find driver files for this? My ultimate goal > is to control a programmable power supply through the serial port of > my MCU, so I'm trying to get familiar with the serial port by > accessing it through a hyperterminal....
There is more than one development board for that processor. I don't remember if the SCI can be used as a UART, but the processor has plenty of oomph to do bit banging. Are there no hints or code examples in the accompanying literature? Look for a configuration register. That might point you in the right direction. There has to be some way to start the thing up. Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
First check the serial cable. Do you get an echo when pins 2&3 are shorted?

SFC

"Jerry Avins" <jya@ieee.org> schreef in bericht 
news:9ZSdnQtLh8-k1lDYnZ2dnUVZ_tOmnZ2d@rcn.net...
> panfilero wrote: >> Hello, I just got a MC9S12NE64 microcontoller and a development board, >> and I've been trying to access my microcontroller through the >> hyperterminal on my computer but have been having a really hard time. >> I couldn't find any serial port driver files for this MCU, but had >> some for a MC9S12C32 which i tried to modify to use with my MCU... my >> code compiles on codewarrior and loads into my MCU but.... I can't get >> it to show anything on the hyperterminal.... I was wondering if anyone >> could tell me what steps I need to take to do this serial >> communication with my MCU, or if anyone knows of any good resources or >> websites where i could find driver files for this? My ultimate goal >> is to control a programmable power supply through the serial port of >> my MCU, so I'm trying to get familiar with the serial port by >> accessing it through a hyperterminal.... > > There is more than one development board for that processor. I don't > remember if the SCI can be used as a UART, but the processor has plenty of > oomph to do bit banging. Are there no hints or code examples in the > accompanying literature? > > Look for a configuration register. That might point you in the right > direction. There has to be some way to start the thing up. > > Jerry > -- > Engineering is the art of making what you want from things you can get. > &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
"panfilero" <panfilero@gmail.com> schreef in bericht 
news:1171079852.040173.284510@q2g2000cwa.googlegroups.com...
> Hello, I just got a MC9S12NE64 microcontoller and a development board, > and I've been trying to access my microcontroller through the > hyperterminal on my computer but have been having a really hard time. > I couldn't find any serial port driver files for this MCU, but had > some for a MC9S12C32 which i tried to modify to use with my MCU... my > code compiles on codewarrior and loads into my MCU but.... I can't get > it to show anything on the hyperterminal.... I was wondering if anyone > could tell me what steps I need to take to do this serial > communication with my MCU, or if anyone knows of any good resources or > websites where i could find driver files for this? My ultimate goal > is to control a programmable power supply through the serial port of > my MCU, so I'm trying to get familiar with the serial port by > accessing it through a hyperterminal.... > > any help or suggestions would be greatly appresicated, > thank you > Joshua >
panfilero wrote:

> Hello, I just got a MC9S12NE64 microcontoller and a development board, > and I've been trying to access my microcontroller through the > hyperterminal on my computer but have been having a really hard time. > I couldn't find any serial port driver files for this MCU, but had > some for a MC9S12C32 which i tried to modify to use with my MCU... my > code compiles on codewarrior and loads into my MCU but.... I can't get > it to show anything on the hyperterminal.... I was wondering if anyone > could tell me what steps I need to take to do this serial > communication with my MCU, or if anyone knows of any good resources or > websites where i could find driver files for this? My ultimate goal > is to control a programmable power supply through the serial port of > my MCU, so I'm trying to get familiar with the serial port by > accessing it through a hyperterminal.... > > any help or suggestions would be greatly appresicated, > thank you > Joshua >
Generally there aren't good drivers for the little embedded processors like this -- the ones that you get from the chip manufacturers are written by kids fresh out of school who have little practical experience. If they're useful at all they're good to learn how the peripheral works, but they're not good for a driver that you can integrate into a larger application. So what to do? Check your cable, as SFC has suggested. Check the voltages coming out of the board to make sure they're RS-232 compliant. Assuming your cable is good, look through the driver that you have, and your chip manual, CAREFULLY. Peripherals on microprocessors have gotten very flexible, which means that they're very complex to program. Most of them have what I like to call "screw the processor bits" -- there will be at least one bit in a seemingly unrelated register that you have to set to make things work. These magic bits are often found in the on-board timer section (to get a clock to your peripheral), or the pin-driver section (to get the signals out), or the CPU interrupt section (to get an interrupt out to the CPU). Were I having trouble with this sort of thing I would first try to get the thing to send out test characters, one by one, without even thinking of using interrupts. I'd hook the thing up to a terminal program, sure, but I'd also hook it up to a scope, logic analyzer, or logic probe to make sure that the output was at least wiggling. A scope is very useful here, because in one swoop it tells you that the voltages are OK or not, that the pins are wiggling or not, and that the baud rate is correct or not. Once I had it working in transmit then I would address receive and interrupts. (Note that normally I just dive in to trying to get it working interrupts and all, but I often have to backtrack). Good luck -- serial comms is generally something that has you tearing your hair out for a while, then suddenly starts working. If you're lucky, it'll even start working correctly. Generally once you do get it working it'll work forever, though. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html
I'm pretty new to microcontrollers, how do I short the serial and get
it to echo?   The development board I got is the: CME-12NE64-DEV
here's a link to it: http://www.axman.com/?q=node/257
it has 2 serial ports, i thought i would connect them both to them
computer in order to communicate with my chip through the
hyperterminal.....  I got some code from this guy's web site: http://
users.ece.utexas.edu/~valvano/index.html
and tried to modify it a bit to work with my MCU, and I get it to
compile and run... but can't get anything to happen on the
hyperterminal..... I'm wondering if I have to fonfigure the other
serial port somehow, maybe it's not outputting.... If I set serial
port 1 on codewarrior to load my MCU with the program, I was thinking
I could plug the other serial port into com 2 on my computer and have
hyperterminal set up on com 2, to recieve and transfer data.... I
don't know if I'm thinking about this correctly.

thanks
Joshua

panfilero wrote:
> I'm pretty new to microcontrollers, how do I short the serial and get > it to echo? The development board I got is the: CME-12NE64-DEV > here's a link to it: http://www.axman.com/?q=node/257 > it has 2 serial ports, i thought i would connect them both to them > computer in order to communicate with my chip through the > hyperterminal..... I got some code from this guy's web site: http:// > users.ece.utexas.edu/~valvano/index.html > and tried to modify it a bit to work with my MCU, and I get it to > compile and run... but can't get anything to happen on the > hyperterminal..... I'm wondering if I have to fonfigure the other > serial port somehow, maybe it's not outputting.... If I set serial > port 1 on codewarrior to load my MCU with the program, I was thinking > I could plug the other serial port into com 2 on my computer and have > hyperterminal set up on com 2, to recieve and transfer data.... I > don't know if I'm thinking about this correctly. > > thanks > Joshua >
Pins 2 and 3 are the transmit and receive pins. If you short them together, and the cable is working, then the computer will be talking to itself. It's a good test to make sure that everything up to the board is in working order -- if there's something wrong on the host side any work you do on the target board side is wasted effort. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html

Tim Wescott wrote:

> panfilero wrote: > >> I'm pretty new to microcontrollers, how do I short the serial and get >> it to echo?
Another embedded engineer needs his diapers changed...
>> > Pins 2 and 3 are the transmit and receive pins. If you short them > together, and the cable is working, then the computer will be talking to > itself. > > It's a good test to make sure that everything up to the board is in > working order -- if there's something wrong on the host side any work > you do on the target board side is wasted effort.
And don't forget to connect it to the power... Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Tim Wescott wrote:
> panfilero wrote: > >> I'm pretty new to microcontrollers, how do I short the serial >> and get it to echo?
... snip ...
> > Pins 2 and 3 are the transmit and receive pins. If you short > them together, and the cable is working, then the computer will > be talking to itself. > > It's a good test to make sure that everything up to the board is > in working order -- if there's something wrong on the host side > any work you do on the target board side is wasted effort.
He may also have to jump the appropriate supervisory signals, depending on the software configuration, such as RTS to DTR, etc. A properly wired single connector is handy. Excessive cross post cut back in follow-ups. -- <http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt> <http://www.securityfocus.com/columnists/423> "A man who is right every time is not likely to do very much." -- Francis Crick, co-discover of DNA "There is nothing more amazing than stupidity in action." -- Thomas Matthews
Tim Wescott wrote:
> panfilero wrote: >> I'm pretty new to microcontrollers, how do I short the serial and get >> it to echo? The development board I got is the: CME-12NE64-DEV >> here's a link to it: http://www.axman.com/?q=node/257 >> it has 2 serial ports, i thought i would connect them both to them >> computer in order to communicate with my chip through the >> hyperterminal..... I got some code from this guy's web site: http:// >> users.ece.utexas.edu/~valvano/index.html >> and tried to modify it a bit to work with my MCU, and I get it to >> compile and run... but can't get anything to happen on the >> hyperterminal..... I'm wondering if I have to fonfigure the other >> serial port somehow, maybe it's not outputting.... If I set serial >> port 1 on codewarrior to load my MCU with the program, I was thinking >> I could plug the other serial port into com 2 on my computer and have >> hyperterminal set up on com 2, to recieve and transfer data.... I >> don't know if I'm thinking about this correctly. >> >> thanks >> Joshua >> > Pins 2 and 3 are the transmit and receive pins. If you short them > together, and the cable is working, then the computer will be talking to > itself. > > It's a good test to make sure that everything up to the board is in > working order -- if there's something wrong on the host side any work > you do on the target board side is wasted effort.
You short the same two pins on the terminal side to make it loop back. If both board and terminal work separately but they don't work together, first make sure the baud rates are the same, then that the "common" ground is really common. Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;

The 2024 Embedded Online Conference