共2条
1/1 1 跳转至页
有朋友做过RTX51 full 吗?
哦,我调好了,不麻烦大家了。
原来P89C668 default(复位)内部8KRAM是无效的,
而RTX51 full 要1K左右的RAM,所以就启动不了啦。
要先enable内部RAM。
我把例子放在这,给大家参考:
#pragma large
#include /* RTX-51 Definitions */
#include
#define PRODUCER_NBR 0 /* Tasknumber for the producer task */
#define CONSUMER_NBR 1 /* Tasknumber for the consumer task */
sbit led=P1^1;
sbit led2=P1^0;
sbit ledb=P1^2;
void producer_task (void) _task_ PRODUCER_NBR
{
unsigned int send_mes;
led=1;
os_create_task (CONSUMER_NBR); /* Create the Consumer-Task */
send_mes = 1;
for (;;) { /* endless loop */
/* send the actual value of 'send_mes' to the mailbox 0 */
/* if the mailbox is full, wait until there is place for the message */
os_send_message (0, send_mes, 0xff);
send_mes++;
os_wait (K_TMO, 300, 0);
ledb=!ledb;
}
}
void consumer_task (void) _task_ CONSUMER_NBR _priority_ 1
{
unsigned int rec_mes;
for (;;) {
/* read from the mailbox 0 to the variable 'rec_mes' */
/* wait for a message, if the mailbox is empty */
os_wait (K_MBX+0, 0xff, &rec_mes);
led2=!led2;
/*
... perform some calculations with 'rec_mes'
*/
}
}
void main (void)
{
/* Init the system and start the Producer-Task */
AUXR=AUXR&0xfd;
led2=1;
os_start_system (PRODUCER_NBR);
}
共2条
1/1 1 跳转至页
回复
我要赚赏金打赏帖 |
|
|---|---|
| PCF8574功能模块及其使用被打赏¥20元 | |
| 传感器LSM6DSO及LIS3MDL的功能检测被打赏¥18元 | |
| LPS25HB气压传感器及其检测被打赏¥18元 | |
| HTS221温湿度传感器及其检测被打赏¥18元 | |
| 【S32K3XX】HSE FW 版本更新被打赏¥21元 | |
| 基于ArduinoUNO开发板的AT24C02读写测试被打赏¥16元 | |
| TCS3472S传感器及其色彩检测被打赏¥19元 | |
| 【S32DS】S32K3 RTD7.0.1 HSE 组件配置报错问题解决被打赏¥27元 | |
| 【S32K3XX】MCME 启动 CORE1被打赏¥23元 | |
| AG32VH407下温度大气压传感器及其检测被打赏¥20元 | |
我要赚赏金
