This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Accessing hardware interrupts

Dear friends,
1.I would like to know about external interrupts.
How to access interrupt in C programming?
2.How to activate timers for determined time? for example I want the timer to be active for 2Minutes.Which mode to use?
3.How to send the data from one controller to another with assembly coding?
4.How to transfer the characters from PC to
Microcontroller kit

Parents
  • >1.I would like to know about external interrupts.
    >How to access interrupt in C programming?

    Well, you have to use the interrupt statement when you decalre the interrupt service routine.

    That can e.g. look like this:

    void uart_isr( void ) interrupt UART_INT_NO using 1
    
    UART_INT_NO is the number of the interrupt that C51 uses. INT0 is 0, INT 1 is 2. YOu will find the numbers in the docs.

    >2.How to activate timers for determined time? for example I want the timer to be active for 2Minutes.Which mode to use?

    You can make timer be triggered like every 1/10 of a second and then set up a counter in your interrupt service routine to "extend" the timer. It is only a 16 bit timer that counts with a frequency of the quartz devided by 12, so it will not be possible to set up a 2 minutes timer without an extension.

    That extension timer could be a count down that sets a flag when it reaches 0 and then stops counting.

    >3.How to send the data from one controller to another with assembly coding?

    One c51 to another? Well there are serveral ways, could be dual ported ram, could be a parallel interface or a serial. Depends on how fast you want it to be.

    >4.How to transfer the characters from PC to Microcontroller kit

    The serial interface would probably be the easiest way.

    You will find many answers to your questions in one of the 8051 websites.
    They have lotsa source code to download.

    http://www.8052.com

    Take care
    Sven

Reply
  • >1.I would like to know about external interrupts.
    >How to access interrupt in C programming?

    Well, you have to use the interrupt statement when you decalre the interrupt service routine.

    That can e.g. look like this:

    void uart_isr( void ) interrupt UART_INT_NO using 1
    
    UART_INT_NO is the number of the interrupt that C51 uses. INT0 is 0, INT 1 is 2. YOu will find the numbers in the docs.

    >2.How to activate timers for determined time? for example I want the timer to be active for 2Minutes.Which mode to use?

    You can make timer be triggered like every 1/10 of a second and then set up a counter in your interrupt service routine to "extend" the timer. It is only a 16 bit timer that counts with a frequency of the quartz devided by 12, so it will not be possible to set up a 2 minutes timer without an extension.

    That extension timer could be a count down that sets a flag when it reaches 0 and then stops counting.

    >3.How to send the data from one controller to another with assembly coding?

    One c51 to another? Well there are serveral ways, could be dual ported ram, could be a parallel interface or a serial. Depends on how fast you want it to be.

    >4.How to transfer the characters from PC to Microcontroller kit

    The serial interface would probably be the easiest way.

    You will find many answers to your questions in one of the 8051 websites.
    They have lotsa source code to download.

    http://www.8052.com

    Take care
    Sven

Children
No data