??? 02/06/06 17:02 Read: times |
#109323 - additional info Responding to: ???'s previous message |
Hello Jan,
thanks for help. I use Monitor-51 V2.1 - this is all I know now. Basic HW components: 1. Processor TEMIC TSC80C31 2. EPROM 27C64 mapped at C:0000 - C:1FFF, mirror at C:2000 - C3FFF; contains monitor 3. RAM - von Neumann: C+X:A000 - BFFF (BF00 - BFFF is dedicated for MON51 data) 4.MAX232 for the serial line My code: #pragma iv(0xA000) #include "reg51.h" #include <stdio.h> /* prototype declarations for I/O functions */ #define zakl_perioda 0xFFFF - 10000 //10,8507 ms #define krok 2000 #ifdef MONITOR51 /* Debugging with Monitor-51 needs */ char code reserve [3] _at_ 0xA023; /* space for serial interrupt if */ #endif /* Stop Exection with Serial Intr. */ /* is enabled */ unsigned int Pocet_aktivnich; //inkrementovat/dekrementovat po stovkach sbit motor = P1^7; void main(void) { TMOD = 0x11; //nastveni t0 a t1 coby 16bit casovacu s prednastavovanim IP = 0x0A; //timery mají prioritu pøed externím pøerušením IE = 0x8F; TL1 = (zakl_perioda) & 0xFF; TH1 = (zakl_perioda >> 8) & 0xFF; //TH1 = 0xD8; IT0 = 1; IT1 = 1; Pocet_aktivnich = (0xFFFF-(80*100)); //printf ("Hello World\n"); TR1 = 1; while (1) ; } void int_tim1 (void) interrupt 3 { motor = 1; TL1 = (zakl_perioda) & 0xFF; TH1 = (zakl_perioda >> 8) & 0xFF; TL0 = (Pocet_aktivnich) & 0xFF; TH0 = (Pocet_aktivnich >> 8) & 0xFF; TR0 = 1; } void int_tim0 (void) interrupt 1 { motor = 0; TR0 = 0; } void int_ext0 (void) interrupt 0 { Pocet_aktivnich -= krok; } void int_ext1 (void) interrupt 2 { Pocet_aktivnich += krok; } |
Topic | Author | Date |
error message | 01/01/70 00:00 | |
what tools | 01/01/70 00:00 | |
additional info![]() | 01/01/70 00:00 |