2013-03-05 11:33 PM
Dear,
I met the problem when use the USART multiprocessor mode. In my USART communication application, even for one USART, there are 3 different addressses for different data packages. But STM32F4 only provide one address to be compared. If I don't use the multiprocessor mode, I cannot identify the data or address on the bus. The basic requirement for me is to identify the data or address on the bus and if the addresses are not for this node, it will ignore or mute. The addresses for one node not only fixed one. So how can I implement? It works different with ARM7.
B.R.
Jin #9-bit #multiprocessor2013-03-06 06:41 AM
Couldn't you just use the USART in 9-bit and use a simple state machine in the IRQ handler?
2013-03-06 07:11 AM
thet's what we did in the olden days before the '51 had the ''match register'' added
Erik2013-03-06 07:17 AM
I have considered the 9-bits mode and got the data and address from DR register. In 9-bits mode, both data and address would generate the interrupt, I can identify the data and address by software, but I am afraid of the workload in this situation. There are many data when communication starts. I am not clearly understand what you mean about the simple state machine? So could you please give a more detail descripiton. Or may it can save or optimize my application?
Appreciate.B.R.
Jin2013-03-06 08:53 AM
Yes you'll get interrupts, but the stream can be managed very quickly/efficiently. Under 100 cycles at 168 MHz, I'd guess. You don't mention a baud rate. I could use DMA to decimate interrupt load.
http://blog.markshead.com/869/state-machines-computer-science/
At a most simplistic level, 4 states for processing data streams to 3 addresses. State changes when an address is received. WAIT_FOR_NEXT_ADDRESS (ignoring data) ACCEPTING_DATA_FOR_ADDRESS_A (seen address A last) ACCEPTING_DATA_FOR_ADDRESS_B ACCEPTING_DATA_FOR_ADDRESS_C I could code it, but not looking to do your job.2013-03-06 02:46 PM
I don't have a f4 or a f4 manual here, but tend to recall a bit ''interrupt only if 9th bit is set''
2013-03-06 07:01 PM
The baud rate is 500kHz. I am not worried about the node with address matching. As you suggested, DMA can take the task of data collection. What I am concern is the workload of node without address matching. It is always listening and been interrupted, even when data comes.
2013-03-07 12:07 AM
''I don't have a f4 or a f4 manual here, but tend to recall a bit 'interrupt only if 9th bit is set'.''
That's certainly the way the 8051 worked!''It is always listening and been interrupted, even when data comes.''
As Erik says, is there not an option to interrupt only on Address bytes (ie, bytes with the 9th bit set)? Even if there isn't, surely it's only a couple of instructions to test the 9th bit & ignore...?2013-03-07 01:05 AM
As Erik says, is there not an option to interrupt only on Address bytes (ie, bytes with the 9th bit set)?
Yes, there is interrupt only on address bytes, but it only support one address. I have 3 different address even for one node.Even if there isn't, surely it's only a couple of instructions to test the 9th bit & ignore...?
My application depends on the communication between the host and slave. Though there is little instructions to test 9th bit and ignore, other tasks with time strict event would be affect. That's why I am worried. But if there is not any other good choice, I have to test it, or change to other MCU.
2013-03-07 09:49 AM
''Yes, there is interrupt only on address bytes, but it only support one address''
You're missing the point! We're talking about an option that looks only at the 9thbit
- without considering the address value. ie, it just considers whether the byeis
an addres - without any attention to what address it is.''I have 3 different address even for one node'' That is not the way that this multiprocessor mode is usually used!''change to other MCU'' As noted above, I think most MCUs which support this 9-bit mode do only support automatic recognition of a single address per node?Maybe you could use a part with multiple UARTs, and have each UART configured for a different address...?