Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Multi. Microcontroller design

Status
Not open for further replies.

jit_singh_tara

Full Member level 6
Joined
Dec 22, 2006
Messages
325
Helped
9
Reputation
18
Reaction score
4
Trophy points
1,298
Location
Delhi , India
Activity points
4,293
Hi friends,
I am working on an application where there are 2 pcb boards.

Board 1 is doing a critical task so it can't be used for user defined settings via lcd and switches.

Board 2 is having lcd and switches so we have to use it for saving the settings. But these settings have to be transferred to board 1 so that it can be used by board 1 for its working......
Everytime any setting is changed on board 2 it has to be reflected on board 1.There are some 50 variables of unsigned int type that need to be transferred from board 2 to board 1.

So I would like to know what is the best way to do it.Should I transfer the data in ascii form. That will be approx 200characters if I transfer all the variables.

Or should I go with one variable at a time with some header and then data. for example if I need to send 20000 then I use #__20000$
where __ is for type of data ranging from 0-99..
i.e I can send 99 variables of unsigned int type.

The board 1 does some critical work. So the data sent via board 2 UART will. Be received via Board 1 UART via interrupt.

Also if we need to Display some data from board 1 then board 1 can transmit the data to board 2 via UART.

Please let me know how to proceed in such scenario....
 

Hi,

There are many solutions depending on your requirements.

If you are sending via UART, then I recommend to use the format to be most comfortable for Board1.
Which means:
* easy to parse
* low byte count
* the frame should start with a single byte "message identifier"
* the frame should end with a unique "EOL" marker
* optionally (I recommend it) the frame should contain a checksum

****
Check whether SPI or I2C is more suitable.

****
In one similar application I even used a "dual port RAM".
If I have to design the same again I used an FPGA instead.

***
Also consider a SPI_RAM or I2C_RAM with multiplexed bus. This needs a careful arbitration scheme.

Klaus
 

I would suggest to stop for a while and think. There are totally mess in your head. May be we should start from beggining? What you want to achive?
 

I would suggest to stop for a while and think. There are totally mess in your head. May be we should start from beggining? What you want to achive?

Dear friend, May be you are not able to understand the problem. I m very clear about the issue and have received a reply also regarding the same. So please don't judge others if you are not able to understand the issue.
 

Keep the data in byte form (~50% less data movement than ASCII, no interpretation required on board 1). Create a data packet scheme to send data and requests to board 1. To keep things simple, maybe just send 1 variable at a time rather than all 50+. I would also suggest a fixed packet size going from board 2 to board 1.

Maybe:

Byte 1: Message start; is this a variable or a request for data?
Byte 2: Variable number or request number.
Byte 3: MSB of variable or dummy data if a request
Byte 4: LSB of variable or dummy data if a request
Byte 5: Checksum of message
Byte 6: End of transmission byte

Board 1 should send some kind of acknowledge message after the 6 bytes are received and interpreted (Message OK or error) as a handshake.

If the data coming back from board 1 to board 2 doesn't fit this scheme, you can create a different scheme for the return data. You're writing both end so it's up to you.
 
Last edited:
you can also assign each byte of data an address and upload only the byte that changed.
this can reduces the transmission to 2 bytes - and address and a dataum.
and a checksum or some error detect and correct scheme - fairly easy for 16 bits.

data transmission is generally much faster than human changing of switches, even at the relatively slow rate of 1 bit per microsecond.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top