Sign in

username:

password:



Not a member?

Search m68hc11



Search tips

Subscribe to m68hc11



m68hc11 by Keywords

27c256 | 4K81H | 68HC11A1 | 68HC11P1 | 68hc24 | 68HC711E9 | 68HC811 | 8255 | A2D | ADC | ADC12138 | Am85C30 | BRCLR | Buffalo | CMOS | EEPROM | EPROM | Ethernet | EVB | EVBU | HC11E1 | HC11E9 | HC711E9 | Horray | ImageCraft | IRQ | Keypad | LCD | MC68HC11D0FN | MC68HC11E1CFU3 | MC68HC11F1 | MC68HC711E9 | MC68HC711E9CFN2 | Microcore11 | Microstamp11 | Minikit | NVRAM | PSD | PSD8xx | PSD9xx | PT1000 | RS232 | RTS | RXD | SPI | SRAM | TXD | Watchdogs | XIRQ

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | | help with pcbug11

help with pcbug11 - garry_sharpe - Jun 27 1:22:00 2004

Im pretty new to all this and so far have only been using Buffalo.
Had a 5 min crash course on pcbug11 and b'strap mode of MC68HC11E9
which will be examined on tomorrow.

Simple program written in Buffalo, ( make a led on portc flash and
output a char to the screen every loop or flash of led )is working
fine. here i am not using 'outa' instead reading 'scsr' then writing
to 'scdr'.This works fine in Buffalo.

Load the same program into pcbug11 (in b'strap mode and
'mm 1035 >$10' etc) and either starting program by 'G B600' or
shorting TxD to RxD (pins 2-3 of RS232 connector)then reconnecting
the RS232 cable,the program runs as the led flashes, but there is no
characters being output to the screen,Instead the command prompt
appears again.

Stupid question, How can i get the chars to output to the screen when
using pcbug11 ? Am i missing something stupid ?





(You need to be a member of m68hc11 -- send a blank email to m68hc11-subscribe@yahoogroups.com )


Re: help with pcbug11 - Mark Schultz - Jun 27 9:11:00 2004

--- In , "garry_sharpe" <garry_sharpe@y...>
wrote:
> Im pretty new to all this and so far have only been using Buffalo.
> Had a 5 min crash course on pcbug11 and b'strap mode of MC68HC11E9
> which will be examined on tomorrow.
>
> Simple program written in Buffalo, ( make a led on portc flash and
> output a char to the screen every loop or flash of led )is working
> fine. here i am not using 'outa' instead reading 'scsr' then
> writing to 'scdr'.This works fine in Buffalo.
>
> Load the same program into pcbug11 (in b'strap mode and
> 'mm 1035 >$10' etc) and either starting program by 'G B600' or
> shorting TxD to RxD (pins 2-3 of RS232 connector)then reconnecting
> the RS232 cable,the program runs as the led flashes, but there is
> no characters being output to the screen,Instead the command
> prompt appears again.
>
> Stupid question, How can i get the chars to output to the screen
> when using pcbug11 ? Am i missing something stupid ?

What sort of target hardware are you running this test program on?
One thing that occurs to me is that there is at least one subtle
difference (I think...?) between running a program under BUFFALO vs.
using bootstrap mode. Actually, two relevant differences. First,
BUFFALO will set up the SCI for you - it initializes BAUD, SCCR1,
and SCCR2 such that the SCI runs at 9600bps (w/8 MHz xtal), so
a 'lazy' programmer can get by with simply doing the SCSR read/SCDR
write that you mention. However, the bootstrap mode does not work
quite as conveniently. While the boostrap loader DOES do some SCI
configuration before passing control to your program, it does NOT
set the BAUD register in such a way as to run at 9600bps. Also (2nd
point), I think that BUFFALO configures Port D to run in normal
push/pull output mode, whereas the bootloader sets SPCR.DWOM=1,
enabling the Port D 'wire-OR' (open drain) mode. In this mode, the
high-side drivers for Port D outputs are disabled, allowing Port D
outputs to SINK current but not SOURCE it. For the SCI to function
correctly in this mode, you need a pull-up resistor (nom. 4.7K) on
PD1 (TxD). If your hardware incorporates a MAX232/MAX202 or similar
RS232 transciever, you *might* be able to get away without the
pullup because these parts have integral weak pullups on the logic-
level-side of the RS232 output drivers. (100K-400K, as I recall).

The first thing you should do is to modify your test code such that
it explicity initializes at least the BAUD register to your desired
value ($30 is typical for 9600bps w/8 MHz xtal). It would also be
prudent (but perhaps not absolutely necessary) to explicitly
initialize SCCR1 and SCCR2 as well. You might also try explicitly
setting SPCR.DWOM=0. Note that were you running your application in
a 'standalone' environment; that is, from internal ROM or external
memory immediately out of RESET, as opposed to running under BUFFALO
or from bootstrap mode, initialization of all the SCI registers
(BAUD, SCCR1, SCCR2) as well as the DDRD register would be
MANDATORY. The state of these registers immediately out of RESET is
such that the SCI is completely disabled.



______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



(You need to be a member of m68hc11 -- send a blank email to m68hc11-subscribe@yahoogroups.com )

Re: Re: help with pcbug11 - Garry Sharpe - Jun 29 6:17:00 2004



Mark Schultz <> wrote:
--- In , "garry_sharpe" <garry_sharpe@y...>
wrote:
> Im pretty new to all this and so far have only been using Buffalo.
> Had a 5 min crash course on pcbug11 and b'strap mode of MC68HC11E9
> which will be examined on tomorrow.
>
> Simple program written in Buffalo, ( make a led on portc flash and
> output a char to the screen every loop or flash of led )is working
> fine. here i am not using 'outa' instead reading 'scsr' then
> writing to 'scdr'.This works fine in Buffalo.
>
> Load the same program into pcbug11 (in b'strap mode and
> 'mm 1035 >$10' etc) and either starting program by 'G B600' or
> shorting TxD to RxD (pins 2-3 of RS232 connector)then reconnecting
> the RS232 cable,the program runs as the led flashes, but there is
> no characters being output to the screen,Instead the command
> prompt appears again.
>
> Stupid question, How can i get the chars to output to the screen
> when using pcbug11 ? Am i missing something stupid ?

What sort of target hardware are you running this test program on?
One thing that occurs to me is that there is at least one subtle
difference (I think...?) between running a program under BUFFALO vs.
using bootstrap mode. Actually, two relevant differences. First,
BUFFALO will set up the SCI for you - it initializes BAUD, SCCR1,
and SCCR2 such that the SCI runs at 9600bps (w/8 MHz xtal), so
a 'lazy' programmer can get by with simply doing the SCSR read/SCDR
write that you mention. However, the bootstrap mode does not work
quite as conveniently. While the boostrap loader DOES do some SCI
configuration before passing control to your program, it does NOT
set the BAUD register in such a way as to run at 9600bps. Also (2nd
point), I think that BUFFALO configures Port D to run in normal
push/pull output mode, whereas the bootloader sets SPCR.DWOM=1,
enabling the Port D 'wire-OR' (open drain) mode. In this mode, the
high-side drivers for Port D outputs are disabled, allowing Port D
outputs to SINK current but not SOURCE it. For the SCI to function
correctly in this mode, you need a pull-up resistor (nom. 4.7K) on
PD1 (TxD). If your hardware incorporates a MAX232/MAX202 or similar
RS232 transciever, you *might* be able to get away without the
pullup because these parts have integral weak pullups on the logic-
level-side of the RS232 output drivers. (100K-400K, as I recall).

The first thing you should do is to modify your test code such that
it explicity initializes at least the BAUD register to your desired
value ($30 is typical for 9600bps w/8 MHz xtal). It would also be
prudent (but perhaps not absolutely necessary) to explicitly
initialize SCCR1 and SCCR2 as well. You might also try explicitly
setting SPCR.DWOM=0. Note that were you running your application in
a 'standalone' environment; that is, from internal ROM or external
memory immediately out of RESET, as opposed to running under BUFFALO
or from bootstrap mode, initialization of all the SCI registers
(BAUD, SCCR1, SCCR2) as well as the DDRD register would be
MANDATORY. The state of these registers immediately out of RESET is
such that the SCI is completely disabled. Thanks for your input Mark, greatly appreciated.

Problem solved....

I had already re-initialised everything in my source code rather than relying on the bootloader to do it for me (probably should have mentioned that in my original posting). So I was confident that the problem wasnt in the code however by chance, after you mentioned the max232, ( and having accidently bought 2 of them when building my trainer ), I replaced the existing max232 and the problem was solved. I dont know enough about it all as yet to be able to explain what was going wrong, but replacing it got me going again anyway.

Once again thanks for the time you spent trouble shooting for me, greatly appreciated

cheers Yahoo! Groups SponsorADVERTISEMENT ---------------------------------
Yahoo! Groups Links

To ---------------------------------
Find local movie times and trailers on Yahoo! Movies. [Non-text portions of this message have been removed]




(You need to be a member of m68hc11 -- send a blank email to m68hc11-subscribe@yahoogroups.com )