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.

Port Initialization Return value

Status
Not open for further replies.

electronicsman

Full Member level 5
Joined
May 4, 2012
Messages
291
Helped
11
Reputation
22
Reaction score
12
Trophy points
1,298
Activity points
3,737
The application calls the Port_Init() and there is return type of Port initialization is success or not. Now my question is how is it possible to know that the port is initialized successfully? In all the micro controllers do they provide any feedback register? Please help. Similarly there are several cases like ADC initialization etc where we can check for success or not. Is it possible?

Port.png
 

It depends on the type of port. If it is just a serial or parallel data port on an MCU, there probably isn't any way to see if it was successful although you might be able to read the port configuration back to see if it is correct. That doesn't actually tell you the port is operational though.

If it is a network port, normally there is some indication that the port is active because it will attempt connection to a remote system (host maybe) and tell you if it has done so.

ADCs don't normally report back because they are just registers as far as software is concerned but you can do a simple sanity check to see if expected values are returned.

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top