1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Can't get LPC2148 timer match interrupts to work

Discussion in 'Microcontrollers' started by futz, Jan 17, 2009.

  1. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    Should you not be able to map out a vector address for what ever you need? If its simply made for vector 4 then why have some many registers to set?

    So all you have to do it alter:

    VICVectAddr4 .... IRQ_Routine() address
    VICVectCntl4 .... #4 aka 0x0000 0010 (for Timer0)
    VICIntEnable .... Bit 4 aka 0x0000 0010 (for Timer0)
    VICIntSelect .... 0x00 to set it as IRQ (but not needed since its default)

    to configure the interrupt?
     
    Last edited: Jan 20, 2009
  2. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    Yes, you can put whichever interrupt in whichever vector interrupt slot you want. Put what you need higher priority in lower numbered slots. There's tons of flexibility in the ARMs.

    Got PWM and A/D going last night. Both are pretty easy to work with. Did RTC (less interrupts) last week. Ultra easy to use. Now I can add interrupts and really make it do something.
     
    Last edited: Jan 20, 2009
  3. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    Awsome to hear futz. Good job!

    I should be ordering mines today or early tomorrow. The issue i have is Sparkfun doesnt have that USB-TINY thing in stock. So i have to get more money for the

    "JTAG USB OCD Programmer/Debugger for ARM processors"
    SparkFun Electronics - JTAG USB OCD Programmer/Debugger for ARM processors

    Just about a $20 difference but with that one i can supply the board power:

    "5V 9V and 12VDC @ 300mA" which is pretty cool. Even tho i will be sure to get a 6v supply from radio shack . They have a sale i think its only $3-$4. I also have a few 6v/1000mAh RC batteries and 2 chargers for them so im good when it comes to power supply but still a excellent feature.

    So all i have to do is wait for money to poor in lol Ill go visit a few people to see if i can service any PCs or install some breakers in a apartment. You know some here still have fuses :D I cant live without my breaker box. When fuses blow so does your wallet :D at least a breaker is resetable :)

    EDIT: also adds:
    "virtual RS232 port to your computer with all modem signals like: DTR, DSR, DCD, RTS, CTS, Rx, Tx"
     
    Last edited: Jan 20, 2009
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.

    Order from Optimal-Microsystems in Quebec.

    That unit is the same as the TINY, but has the additional features - power supply and serial.

    I'm a renter-for-life (too poor to buy a house) so I'm familiar with fuses. I rent falling down shacks for too much money. In most of these shacks anything you do (ANYTHING) is an improvement. Kick a hole in a wall and it's, "Ohhh! Nice decoration!". And yes, fuses suck.
     
    Last edited: Jan 21, 2009
  6. Ubergeek63

    Ubergeek63 Well-Known Member

    Joined:
    Apr 16, 2008
    Messages:
    1,886
    Likes:
    37
    Sorry, my mistake, that is what i get for opening my mouth before more than a cursury review. It has been seven years since I looked this close at the interrupt structure, and that was on an Atmel.

    Dan
     
    Last edited: Jan 20, 2009
  7. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US

    I rent a apartment and until about 2-4 years ago we had fuses i guess i was too young to care but now i understand more and appreciate the breaker :D

    Futz will you believe that i was going to order from them but those 2 things i need are in "backorder" stock.

    Thats why i think heh a $20 increase isnt so much (even tho im a broke man lol)
     
  8. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    Heh. :p Thought that might be it. I had just finished reading the User Manual and doing the code, so I knew I was right.
     
  9. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    heh all in all this was a fun topic. :D

    My PC hardrive just died so im reinstalling everything again :(
    It was a old 40GB anyway i have 2 300GBs left to use :) but bad is to reinstall. I just got XP installed then SP2 (since i own xp sp1(HOME)) i just restored firefox with all my links and other personal stuff.

    Now to install every thing else (about 20-30 programs easy!) lol
    I should have all the money i need to get that LPC2148 ordered tomorrow. Yay! just about $10 away. :D
     
  10. Ubergeek63

    Ubergeek63 Well-Known Member

    Joined:
    Apr 16, 2008
    Messages:
    1,886
    Likes:
    37
    :) I think there are many who do not know ARMs have been out that long as micros. It has only been in the last few years that they have become really popular. I guess that makes me an old-timer!

    I got our company started with them 7 years ago with a buggy compiler and start up code. Even though I am the hardware guy, I ended up bootstrapping the software group. Some of the ARM idiosyncrasies that you are not seeing are the multiple data bus widths, bus protocols, bus speeds, memory remapping (external memory - execution starts at add 0, but the ARM core "interrupt vectors" are there as well. actually single instructions that load the PC with the contents of the VIC service vector).

    Dan
     
  11. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    hey futz my pc blew up lol well my motherboard 4 capacitors blew. i tried replacing them but the damage is done. i had to use sisters PC to write this. Now i gita shell out $200 to replace mb/cpu/memory and IDE controller since i have 3 hds and a burner and most motherboards come with only 1 IDE connector now :(

    I should be up in a week and have that LPC2148 also! I guess a break is in order :D
     
  12. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    Haha! :D You're such a savage! :p I haven't bought an IDE drive in many years except for customer's machines. Switched to all SATA optical drives a couple years back too.

    What a pain, huh? Popped or bulged caps is pretty much always death for a MB.
     
  13. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,216
    Likes:
    640
    Location:
    Derbyshire, UK
    Not if it's due to the capacitors been faulty, usually from the massive faulty batches a number of years ago. If the capacitors have blown because the PSU has gone high, then the board is probably toast though :p

    I've replaced duff electrolytics in a number of boards, all behaved perfectly afterwards - my old machine at work used to crash a lot, replacing the domed caps cured it.

    Assuming it is just duff caps, it's best to replace them before they cause any more damage, if the board is dead it's probably more than just caps.
     
  14. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    yeah it goes on once and a while im sure something else is damaged tho. I just got a loner PC which ill use for the time being. I have another PC on the way also. Thank god i got friends :D
     
  15. Shank

    Shank New Member

    Joined:
    Feb 21, 2011
    Messages:
    1
    Likes:
    0
    Hey futz!
    I checked out ta code u mentioned earlier but I'v bin gettin errors. I use Keil uVision 4 which runs on a RealView compiler. Could tat be ta problem? Here are ta errors I got:

    ss.c(5): warning: #1207-D: attribute "interrupt" ignored
    ss.c(6): warning: #1207-D: attribute "interrupt" ignored
    ss.c(7): warning: #1207-D: attribute "interrupt" ignored
    ss.c(8): warning: #1207-D: attribute "interrupt" ignored
    ss.c(15): warning: #550-D: variable "i" was set but never used
    ss.c(16): warning: #550-D: variable "cp" was set but never used
    ss.c(48): error: #20: identifier "PLLCFG" is undefined
    ss.c(49): error: #20: identifier "PLLFEED" is undefined
    ss.c(51): error: #20: identifier "PLLCON" is undefined
    ss.c(54): error: #20: identifier "PLLSTAT" is undefined
    ss.c(72): warning: #260-D: explicit type is missing ("int" assumed)
    ss.c(72): error: #65: expected a ";"
    ss.c(109): warning: #1-D: last line of file ends without a newline
    ss.c(109): warning: At end of source: #12-D: parsing restarts here after previous syntax error
    ss.c(72): warning: #177-D: variable "inline" was declared but never referenced


    Shank.
     
  16. Ubergeek63

    Ubergeek63 Well-Known Member

    Joined:
    Apr 16, 2008
    Messages:
    1,886
    Likes:
    37
    it really is strange how something so similar can be so different...

    that was in '02. i had rewritten the boot code for nested interrupts and no mickey mouse hacks that were all over the crappy Atmel code along with commoning out the flash and debug start up code.

    I did need to reference the PC, which the assembler flagged a warning on, but that is a small price to pay for being able to debug directly in flash.

    also did a cycle accurate inline assembly delay loop, our software guy expected it to work but was surprised when it was dead nuts on every time :)
     

Share This Page