EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

hc12 sci PROBLEM

Started by Jessie June 25, 2007
Hi all,


I'm currently using a HC912 EVB board to transmit the data converted
from ADC to SCI and then transmit to the PC, hoping PC will get the
data and display. But it seems nothing is received on PC, although the
D-bug 12 is shown in Hyperterminal, while the program is executed,
only thing I can see is User breakpoint encountered, and none of the
data is received. I tried MS kermit also, same thing happened with a
slightly different detail that in Kermit, PC retries a lot to receive
the packet but end up with failure. Could someone experienced this
give me some advice? Thank a lot!


Jessie

BTW, I also found a response in D-bug 12 shown in hyperterminal, as MG
S, does anyone know what it is supposed to mean?

On Jun 25, 2:07 pm, Jessie <freshfreef...@gmail.com> wrote:
> Hi all, > > I'm currently using a HC912 EVB board to transmit the data converted > from ADC to SCI and then transmit to the PC, hoping PC will get the > data and display. But it seems nothing is received on PC, although the > D-bug 12 is shown in Hyperterminal, while the program is executed, > only thing I can see is User breakpoint encountered, and none of the > data is received. I tried MS kermit also, same thing happened with a > slightly different detail that in Kermit, PC retries a lot to receive > the packet but end up with failure. Could someone experienced this > give me some advice? Thank a lot!
Are you trying to send the data over the same SCI port that D-Bug 12 is using? If so, is that supposed to be possible?
On Jun 25, 5:44 pm, cs_post...@hotmail.com wrote:

> Are you trying to send the data over the same SCI port that D-Bug 12 > is using? > > If so, is that supposed to be possible?
I think you can take over the port, but failing that you can at least send chars to the terminal by calling the proper d-bug12 subroutine that lets you send chars. Look at the d-bug12 PDF for details on its public subroutines.
On Jun 26, 2:16 pm, Eric <englere_...@yahoo.com> wrote:
> On Jun 25, 5:44 pm, cs_post...@hotmail.com wrote: > > > Are you trying to send the data over the same SCI port that D-Bug 12 > > is using? > > > If so, is that supposed to be possible? > > I think you can take over the port, but failing that you can at least > send chars to the terminal by calling the proper d-bug12 subroutine > that lets you send chars. Look at the d-bug12 PDF for details on its > public subroutines.
Thank you very much Eric. That's a very good idea. But what I wanted to do is using SCI as a channel to transmit data converted from ADC to PC and then display it on PC. In other words, PC doesn't need to send data to SCI. The problem of my single SCI subroutine is it's lack of some breakpoints, after I set some software interrupt, it seems to function well.Now I'm testing the program with AD conversion step by step, another long way to go I guess.. Jessie
On Jun 26, 2:36 pm, Jessie <freshfreef...@gmail.com> wrote:

> The problem of my single SCI subroutine is it's lack of > some breakpoints, after I set some software interrupt, it seems to > function well.
Are you waiting for each character to be done, before you try to send another? If you aren't, your code might normally fail by overwriting the output register before it can be sent, but then start working if you add additional things to slow the processor down so that it can't write another character before the previous one has been fully shifted out. Here's a character send routine for an HC9S12NE64 while (!(sciaSR1 & 0x80)) ; //wait while transmit register non-empty sciaDRL=char_to_send;
To cs_post,

Thank you for your advice. Unfortunetely,I'm running asembly code and
I did put a small delay routine when gathering the data to PC. If I
comment the ADC conversion subroutine, the SCI program will function
well, but if I let the ADC conversion program run, the program in
Hyperterminal will just stuck and freeze. I checked my ADC program,
and make sure there's no error. Still trying..

Jessie

Hi all,

Does anybody know if it's better to use SPI other than SCI to display
the result from Analog to digital converter?

Jessie


On Jun 28, 11:56 am, Jessie <freshfreef...@gmail.com> wrote:

> Does anybody know if it's better to use SPI other than SCI to display > the result from Analog to digital converter?
Either is supported just fine by the HC12, so use whichever is supported by what you are talking to. You might want to avoid using the micro as an SPI slave device though - that can be harder to get working than SPI master mode, or SCI.
Hi all,

I gave up the assembly code and use C to program the AD coverter then
using printf() to display on my screen. This time I chose codewarrior
as my compiler, and the program passed comipling without error. While
I use the full simulation s19 file to load to the hc12evb chip, it
always returns the error "can't write target memory". Should I change
the EVB mode to Jump EEPROM  mode or POD mode? I moved the jumper on
W3 to 1, but wierdly, the mode remained in EVB mode. I'm really lost.
Then I checked the chip's name, it's XC68HC912B32, while when I
checked its doc in freescale, it said this chip is not produced any
more. Have someone ever used about this chip and give some advice? I
appreciate any of your help!

Jessie


The 2024 Embedded Online Conference