We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello, We are working on RTX-51 on ATMEL 89C51 with 11.0592M.hz Xtal. we are using two code banks with 64k each. In microcontroller we did't placed any code except a pointer to the bank 0 which is containing (main) function. In main we created os_start_system with priority 0 and created two tasks in the first task. We have enabled the round_robin and placed both tasks in priority 0, but when we used os_wait function the system is hanging up on the hardware. the code before os_wait function is working . but on simulator when we watched performance analyzer it is showing that tasks are running with time slice . But why the system is hanging up at os_wait on target board ? #include <reg52.h> #include <rtx51.h> #include <inithardware.h> #include <inithardware.c> unsigned char xdata lc_status[4]; unsigned char bdata lc,ls; sbit ext1 = ls ^ 0; sbit ext2 = ls ^ 1; sbit ext3 = ls ^ 2; sbit ext4 = ls ^ 3; sbit lpsa = ls ^ 4; unsigned int xdata ext1_task[4]; void extension1 (void)_task_ 2 _priority_ 0 { unsigned char i; while(1) { EXTERNAL = PERI; i = LC1_STATUS; EXTERNAL = XRAM; lc_status[0] = i; ls=lc_status[0]; if(ext1==1) { fo_led1 =0; EXTERNAL = PERI; LED_LATCH = led_latch; EXTERNAL = XRAM; } else fo_led1 =1; EXTERNAL = PERI; LED_LATCH = led_latch; EXTERNAL = XRAM; os_wait(K_TMO,2,0); } } void extension1 (void)_task_ 3 _priority_ 0 { unsigned char i; while(1) { EXTERNAL = PERI; i = LC1_STATUS; EXTERNAL = XRAM; lc_status[0] = i; ls=lc_status[0]; if(ext1==1) { fo_led1 =0; EXTERNAL = PERI; LED_LATCH = led_latch; EXTERNAL = XRAM; } else fo_led1 =1; EXTERNAL = PERI; LED_LATCH = led_latch; EXTERNAL = XRAM; os_wait(K_TMO,1,0); } } void start_task (void) _task_ 1 _priority_ 1 { EXTERNAL = PERI; led_latch = 0xFF; LED_LATCH = led_latch; EXTERNAL = XRAM; os_create_task(2); os_create_task(3); os_delete_task(1); } void main (void) { os_start_system (1); }