[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] PORT access

From: Marlin Unruh
Subject: [avr-gcc-list] PORT access
Date: Thu, 26 Apr 2001 09:19:25 -0600

I am using CAN-bus with two MCUs, one is an 8515 and the other is an 8535. I
would like be able to modify a port using the following example;

1: void Modify_Port(u08 address, u08 mask, u08 data)
2: {
3:      u08 tmp;
4:      tmp = inp(address); // place port reading in tmp
5:      tmp &= ~mask;
6:      tmp |= (data & mask);
7:      outb(tmp, address);
8: }

I made up this example to demonstrate what I am wanting to do. Is there a
way? This does not work because the value of address is non-constant. I am
wanting to be able to modify a port in the other MCU via the CAN-bus. Thus,
controller 'B' could directly set a bit on a port in controller 'A' to sound
a buzzer. The 'address', 'mask', 'data' is transferred over the CAN-bus.

Any help would be much appreciated.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]