Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

Embedded C Question / writing a program / sfr amd sbit

Status
Not open for further replies.

GrandAlf

Advanced Member level 2
Joined
Mar 9, 2002
Messages
520
Helped
47
Reputation
92
Reaction score
6
Trophy points
1,298
Location
UK
Activity points
4,730
Embedded C Question

I wonder if anyone can advise me on this one.

I am writing a program the uses sfr amd sbit to access mcu ports. At the moment they are specified outside of any function. When I have the all the functions declared in the main list, everything seem to work ok. But if I try to save the files as seperate functions, and then do an .h prototype, I am not able to access the ports. I have tried redefinig them in the function, but this just gives errors. I have looked in a few C guides, but they only talk about variables. Any pointers would be really appreciated.
 

thomaz

Member level 2
Joined
May 4, 2001
Messages
48
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
atlantis
Activity points
329
make sure you know the difference of
#include <my_header.h>
and
#include "my_header.h"

was this the problem?
 

GrandAlf

Advanced Member level 2
Joined
Mar 9, 2002
Messages
520
Helped
47
Reputation
92
Reaction score
6
Trophy points
1,298
Location
UK
Activity points
4,730
Thanks Thomaz,

I am using "xxx.h".

I thought that if I specified port definitions outside any functions, they would be available to all functions. Maybe I need to specify these first, before any includes. I will try on Monday when I get back to the office.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top