EmbeddedRelated.com
Forums

Interrupts

Started by nathan_b_a July 7, 2005

On Jul 7, 2005, at 6:40 AM, nathan apps wrote:

> So this is why I was asking about Interrupts. The IRQ interrupt
> vector is located in $FFF2, so when you make the IRQ line low, the
> data contained in this address is inserted into the program counter
> and is used as the address for the next instruction. So if the data
> located at $FFF2 is in ROM, then how do you change it?

Summary of all the other replies:
- Either use a one-time-programable part and write the vector table
as part of your code.
- Or use a part configured for Expanded Mode and place your code
(including vector table) in an external EPROM.
- Or if using a part which has the Buffalo monitor ROM image you
would consult the Buffalo docs for setting IRQ vectors.

The 68HC11 is intended as a dedicated embedded MCU. Only a rare
exceptional application would have RAM in the vector table space. Its
a Catch-22 situation, if the vector table was in RAM then how would
the CPU know how to start running your code out of RESET?

If one absolutely must revector an IRQ during operation then point
that IRQ at a "jmp (ramlocation)" and put the variable address of
your IRQ service routine in ramlocation (believe this is how the
Buffalo monitor ROM does it). And make darn sure the vector is not
used until after you have ramlocation initialized to something sane.

--
David Kelly N4HHE, dkelly@dkel...
========================================================================
Whom computers would destroy, they must first drive mad.


Hi everyone

Ok, I think I understand my question now.

Here it is.

I have a program that works in ROM, I used the THRISM11 simulator to write and test this program. Now, I want to transfer the program I wrote on my simulator into a real 68hc11, should I:

A) Get someone????? to program the ROM of a 68hc11 with my program

or

B) Put it in the chip another way (such as EEPROM)

What way is the fatsest/easiest/cheapest and if it is to program the ROM who can do this in Australia?

Thanks very much for your help

Kind regards

Nathan

David Kelly <dkelly@dkel...> wrote:

On Jul 7, 2005, at 6:40 AM, nathan apps wrote:

> So this is why I was asking about Interrupts. The IRQ interrupt
> vector is located in $FFF2, so when you make the IRQ line low, the
> data contained in this address is inserted into the program counter
> and is used as the address for the next instruction. So if the data
> located at $FFF2 is in ROM, then how do you change it?

Summary of all the other replies:
- Either use a one-time-programable part and write the vector table
as part of your code.
- Or use a part configured for Expanded Mode and place your code
(including vector table) in an external EPROM.
- Or if using a part which has the Buffalo monitor ROM image you
would consult the Buffalo docs for setting IRQ vectors.

The 68HC11 is intended as a dedicated embedded MCU. Only a rare
exceptional application would have RAM in the vector table space. Its
a Catch-22 situation, if the vector table was in RAM then how would
the CPU know how to start running your code out of RESET?

If one absolutely must revector an IRQ during operation then point
that IRQ at a "jmp (ramlocation)" and put the variable address of
your IRQ service routine in ramlocation (believe this is how the
Buffalo monitor ROM does it). And make darn sure the vector is not
used until after you have ramlocation initialized to something sane.

--
David Kelly N4HHE, dkelly@dkel...
========================================================================
Whom computers would destroy, they must first drive mad.
---------------------------------
YAHOO! GROUPS LINKS ---------------------------------

---------------------------------
Sell on Yahoo! Auctions - No fees. Bid on great items.





Hi Nathan,

Unless you have a good reason to use a HC11, I would look at
using a flash based micro. Some of these have very cheap ways
to program the device, using the serial port. They don't need
special programming voltages and have many other neat features.

Some more details about what your trying to do would help list
members help you choose a device. In most cases the flash
chips will be faster, use less power and cheaper too.

Were in Australia are you ?

Regards,
Darren Moore
> -----Original Message-----
> From: m68HC11@m68H...
> [mailto:m68HC11@m68H...] On Behalf Of nathan apps > Hi everyone
>
> Ok, I think I understand my question now.
>
> Here it is.
>
> I have a program that works in ROM, I used the THRISM11
> simulator to write and test this program. Now, I want to
> transfer the program I wrote on my simulator into a real
> 68hc11, should I:
>
> A) Get someone????? to program the ROM of a 68hc11 with my program
>
> or
>
> B) Put it in the chip another way (such as EEPROM)
>
> What way is the fatsest/easiest/cheapest and if it is to
> program the ROM who can do this in Australia?
>
> Thanks very much for your help
>
> Kind regards
>
> Nathan




Hi Darren

The only reason I wanted to use the 68HC11 was because I just spent a semester at university learning about computer hardware. The first half of the semester was spent on plds, and then in the second half we touched on micro controllers, in particular the 68hc11.

A friend of mine wants me to design a micro controller for his clock tower. The mechanical clock in this tower has a micro switch in it that sends an electrical pulse once every hour. This signal is to be recorded by a micro controller, and then used to send a signal to a relay to dong the bell. The micro controller is responsible for keeping track of the time, and with the aid of input switches, determining when to send a signal to the relay.

So, because I am reasonable familiar with the 68HC11 and its assembly language, I thought I would use it.

I have already written and tested the code for the 68Hc11 in the free simulator that came with our textbook - THRISM11. But when it came to transferring this code to the microprocessor, things became difficult. Bah.

I live in Sydney Australia.

Kind regards

Nathan

Darren <djmoore@djmo...> wrote: Hi Nathan,

Unless you have a good reason to use a HC11, I would look at
using a flash based micro. Some of these have very cheap ways
to program the device, using the serial port. They don't need
special programming voltages and have many other neat features.

Some more details about what your trying to do would help list
members help you choose a device. In most cases the flash
chips will be faster, use less power and cheaper too.

Were in Australia are you ?

Regards,
Darren Moore
> -----Original Message-----
> From: m68HC11@m68H...
> [mailto:m68HC11@m68H...] On Behalf Of nathan apps > Hi everyone
>
> Ok, I think I understand my question now.
>
> Here it is.
>
> I have a program that works in ROM, I used the THRISM11
> simulator to write and test this program. Now, I want to
> transfer the program I wrote on my simulator into a real
> 68hc11, should I:
>
> A) Get someone????? to program the ROM of a 68hc11 with my program
>
> or
>
> B) Put it in the chip another way (such as EEPROM)
>
> What way is the fatsest/easiest/cheapest and if it is to
> program the ROM who can do this in Australia?
>
> Thanks very much for your help
>
> Kind regards
>
> Nathan
---------------------------------
YAHOO! GROUPS LINKS ---------------------------------

---------------------------------
Sell on Yahoo! Auctions - No fees. Bid on great items.




Hi Nathan,

I understand your reasons to stick with the HC11, and you
are one of many that find it hard to make the jump.

BUT, other then some of your time, to move to say a HC08
device is very easy, and for the most part you can use the
HC11 code. The HC980GP32 is a very popular HC08, and should
be easy to get hold of. I would have a look at the data
online at Freescale, there is free software, assembler and
programmer available from P&E. You can build the small
amount of required programming circuit for it, or buy one.

This device can run from a 32.768khz crystal, so timing
seconds will be very easy, the PLL can boost that to
8Mhz. It has heaps of flash and RAM, you could also use
the free version of the Metrowerks software and program
in C if you like also.

Regards,
Darren Moore

PS I'm in Melbourne. > -----Original Message-----
> From: m68HC11@m68H...
> [mailto:m68HC11@m68H...] On Behalf Of nathan apps
>
> Hi Darren
>
> The only reason I wanted to use the 68HC11 was because I just
> spent a semester at university learning about computer
> hardware. The first half of the semester was spent on plds,
> and then in the second half we touched on micro controllers,
> in particular the 68hc11.
>
> A friend of mine wants me to design a micro controller for
> his clock tower. The mechanical clock in this tower has a
> micro switch in it that sends an electrical pulse once every
> hour. This signal is to be recorded by a micro controller,
> and then used to send a signal to a relay to dong the bell.
> The micro controller is responsible for keeping track of the
> time, and with the aid of input switches, determining when to
> send a signal to the relay.
>
> So, because I am reasonable familiar with the 68HC11 and its
> assembly language, I thought I would use it.
>
> I have already written and tested the code for the 68Hc11 in
> the free simulator that came with our textbook - THRISM11.
> But when it came to transferring this code to the
> microprocessor, things became difficult. Bah.
>
> I live in Sydney Australia.
>
> Kind regards
>
> Nathan




Please use shorter lines. Please?

nathan apps wrote:

>Hi everyone
>
>Ok, I think I understand my question now.
>
>Here it is.
>
>I have a program that works in ROM, I used the THRISM11 simulator to write and test this program. Now, I want to transfer the program I wrote on my simulator into a real 68hc11, should I:
Please explain what THRISM11 is. I'm not going to go researching
your tool like that. I'm expert at the 68hc11, not THRISM.

>
>A) Get someone????? to program the ROM of a 68hc11 with my program
>
>or
>
>B) Put it in the chip another way (such as EEPROM)
>
>What way is the fatsest/easiest/cheapest and if it is to program the ROM who can do this in Australia?
What mode are you intending to use? Special Boot, Special Test, Single Chip,
or Expanded Multiplex? We can't answer you question until you provide
that info.

Do you expect your program to change much in the near future? How large is
your program?

Mike

--
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!


nathan apps wrote:

>Hi Darren
>
>The only reason I wanted to use the 68HC11 was because I just spent a semester at university learning about computer hardware. The first half of the semester was spent on plds, and then in the second half we touched on micro controllers, in particular the 68hc11.
That's a reasonable answer.

>
>A friend of mine wants me to design a micro controller for his clock tower. The mechanical clock in this tower has a micro switch in it that sends an electrical pulse once every hour. This signal is to be recorded by a micro controller, and then used to send a signal to a relay to dong the bell. The micro controller is responsible for keeping track of the time, and with the aid of input switches, determining when to send a signal to the relay.
>
>So, because I am reasonable familiar with the 68HC11 and its assembly language, I thought I would use it.
This project doesn't even seem like it needs a uController, just a
counter and a decoder.

However, since you are familiar with the MC68HC11, I'd recommend doing this:

Run in BOOTSTRAP mode. Put your program into the on-chip 1/2K EEPROM.
You don't even need to use interrupts. Just poll. Since you have a
mechanical switch,
you'll either need extra hardware for debounce external to the
uController, or you'll
have to debounce in software. If you don't debounce the switch
externally, you can't
use an interrupt, anyway. So debounce in software (firmware, actually)
and poll
the switch.

If you insist on using interrupts, then I strongly recommend you to use
external
debouncing of the switch. Otherwise you will wind up with a project that has
bizarre behavior that you won't be able to explain, given your seemingly
limited
experience with switches.

I can help you with debounce either way.

>
>I have already written and tested the code for the 68Hc11 in the free simulator that came with our textbook - THRISM11. But when it came to transferring this code to the microprocessor, things became difficult. Bah.
Welcome to the real world. In theory, theory is the same as practice. In
practice, theory is never the same as practice.

[huge quote snipped]

Mike

--
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!




Nathan apps wrote:
> Hi Darren
>
> The only reason I wanted to use the 68HC11 was because I just
spent a semester at university learning about computer hardware.
The first half of the semester was spent on plds, and then in
the second half we touched on micro controllers, in particular
the 68hc11.
>
> A friend of mine wants me to design a micro controller for
his clock tower. The mechanical clock in this tower has a micro
switch in it that sends an electrical pulse once every hour.
This signal is to be recorded by a micro controller, and then
used to send a signal to a relay to dong the bell. The micro
controller is responsible for keeping track of the time, and
with the aid of input switches, determining when to send a
signal to the relay.
>
> So, because I am reasonable familiar with the 68HC11 and its
assembly language, I thought I would use it.
>
> I have already written and tested the code for the 68Hc11 in
the free simulator that came with our textbook - THRISM11. But
when it came to transferring this code to the microprocessor,
things became difficult. Bah.
>
> I live in Sydney Australia.
>
> Kind regards
>
> Nathan
>
Hi Nathan,

If you are very careful it could fit in the 512 bytes of EEPROM
of a 68HC11 written in C. But that takes some really tight
programing and probably modification of the compiler start up
code. It should not be hard to fit in with assembler. You modify
an address at the beginning of EEPORM to tell the CPU where the
program is. If you have a Buffalo monitor on the board you pull
pin e.0 high and it will jump the start of EEPROM on power up or
reset instead of E000.

For a one off buying a board from some one like New Micros
http://www.newmicros.com/ is by far the least expensive way to
go. I have extensively used their NMIS-0021 board that takes to
memory chips and put an EEPROM in one for the program. If you
don't have access to EEPROM blaster you can use two SRAM chips
and HCLOAD it is at http://www.microsyl.com/. The documentation
does not mention Windows XP but the HCLOAD ran on my XT box. It
will burn code to the on board 512 KB of EEPROM or the OTROM
chips. You can also put a SRAM chip in the place where you would
normally put and EEPROM and use HCLOAD to load the program the
remove the jumper from the write enable pin of the SRAM socket.
That is not as secure as EEPROM but it woks great for testing
and is not a lot of trouble in service if you opto isolate it
from the wires coming down from the clock and run it on
batteries so nothing wild gets on the board.

I have not use at 68HC08 but your code should be an easy port to
a 68HC12 I have their NMIB-0912 $149.00 and NMIN-0812
$79.95. The 812 has 1024 bytes of RAM and 4096 bytes of EEPROM
on board. The EEPROM live is sort and 100 or 200 cycles. If you
use this chip if you can modify the EEPROM write program to
erase and write as fast as it can so the bits are heated as
little as possible.

Another choice with the New Micros 68HC11 boards is to use the
on board FORTH that resides at E000 to FFFF. They have examples
to do most of what you want and again if your fugal with your
code it should fit in the 512 EEPROM

I have been using the New Micros 68HC11 boards for about 15
years. These were the tools I used when I was working with it.
The editor is out of date and is a bit flaky on newer windows
systems. I have just revived that set up for a light meter and
it still works just fine.

If you are seriously thinking about going forward with embedded
systems I would consider a modern processor. I just bought New
Micros Tiny Arm Tini2106 and Plug an Arm D_kit and couple of
sockets for the Tiny Arm. A $30 60 MHz 128KByte Program Flash
and 64KByte SRAM with a rich feature set looks like a good move.
Of course I can use their on board FORTH and that's not an easy
language to get to the point you can use it well but it does
make an excellent testing and debugging toll for hardware. It
has almost all the words you need to test most things you put on
a broad fairly easy.

It also uses the open source GNU C++ and development system
Eclipse http://eclipse.org/ The make files and complexity of GNU
C++ are substantial. How ever the wide spread use of GNU C++
makes it wroth the trouble to learn if you going to work on
multiple platforms. I haven't used Eclipse but they talk a good
story. It is written in Java that seem to the trend in tools so
they can be platform independent. The support at New micros is
pretty good it is managed by email or through a form.

But ARM may not have the life of the 68HCll. While its and old
processor there is no sign of it going away. There are lot of
products that use it that have no reason to change. Good luck
Gordon

Gordon Couger
Stillwater, OK
www.couger.com/gcouger


Gordon Couger wrote:

>Nathan apps wrote: that he already has an assembly language program working with a simulator.

>If you are very careful it could fit in the 512 bytes of EEPROM
>of a 68HC11 written in C. But that takes some really tight
>programing and probably modification of the compiler start up
>code. It should not be hard to fit in with assembler. You modify
>an address at the beginning of EEPORM to tell the CPU where the
>program is. If you have a Buffalo monitor on the board you pull
>pin e.0 high and it will jump the start of EEPROM on power up or
>reset instead of E000.
He's already stated that he is working in assy.

>For a one off buying a board from some one like New Micros
>http://www.newmicros.com/ is by far the least expensive way to
>go. I have extensively used their NMIS-0021 board that takes to
[snip long discussion of New Micros stuff]

I also use New Micros, and think they are wonderful. They also live
about 20 mi from me, so it's an easy trip by car to pick one up, which
they will do.

However, this guy lives in AUSTRALIA. New Micros in Dallas, Texas,
USA is not very convenient for him.

>If you are seriously thinking about going forward with embedded
>systems I would consider a modern processor.
>
He wants to do a favor for a friend. Not become a major developer
of MC68HC11 products.

[snip more New Micros stuff]

>Good luck
>Gordon
I suggest that, next time, you read a little of the context before
posting mail.

Mike

--
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!


Mike,

I gave him all the options I could think of including loading the the
assembly code in the 512 bytes of EEPROM on the chip with HCLOAD. Which
is more than anyone else I have seen thought of.

New Micros has shipped boards all over the world for me. The cost of
shipping to OZ is not that much.

Gordon

Mike McCarty wrote:

>Gordon Couger wrote: >
>>Nathan apps wrote:
>>
>>
>>
>>
>that he already has an assembly language program working with a simulator. >
>>If you are very careful it could fit in the 512 bytes of EEPROM
>>of a 68HC11 written in C. But that takes some really tight
>>programing and probably modification of the compiler start up
>>code. It should not be hard to fit in with assembler. You modify
>>an address at the beginning of EEPORM to tell the CPU where the
>>program is. If you have a Buffalo monitor on the board you pull
>>pin e.0 high and it will jump the start of EEPROM on power up or
>>reset instead of E000.
>>
>>
>>
>>
>He's already stated that he is working in assy. >
>>For a one off buying a board from some one like New Micros
>>http://www.newmicros.com/ is by far the least expensive way to
>>go. I have extensively used their NMIS-0021 board that takes to
>>
>>
>>
>>
>[snip long discussion of New Micros stuff]
>
>I also use New Micros, and think they are wonderful. They also live
>about 20 mi from me, so it's an easy trip by car to pick one up, which
>they will do.
>
>However, this guy lives in AUSTRALIA. New Micros in Dallas, Texas,
>USA is not very convenient for him. >
>>If you are seriously thinking about going forward with embedded
>>systems I would consider a modern processor.
>>
>>
>>
>He wants to do a favor for a friend. Not become a major developer
>of MC68HC11 products.
>
>[snip more New Micros stuff] >
>>Good luck
>>Gordon
>>
>>
>>
>>
>I suggest that, next time, you read a little of the context before
>posting mail.
>
>Mike >