CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Interrupt does not work with different PIC
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
rovtech



Joined: 24 Sep 2006
Posts: 288

View user's profile Send private message AIM Address

PostPosted: Sat Feb 20, 2016 10:55 am     Reply with quote

Thanks Jay and others,
I said earlier that
Code:
#byte portb = getenv ("SFR:PORTB")
did not work and I changed all portb references to input_b() which worked. Well I went back to the getenv statement and it does work. I don't know what I did wrong but something obviously.
With
Code:
#byte portb = getenv ("SFR:PORTB")
  long pntr;
  pntr = &portb;
  sprintf (buff, "portb = %x", pntr);
in appropriate places in the program I get "portb = 0d" displayed so getenv definitely works showing the correct address for portb. I will switch to input_b() and forget bad habits I learned in 2002.
I will implement all the lessons learned here, thanks to all.
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Sat Feb 20, 2016 11:04 am     Reply with quote

If you also program the 18F parts - you REALLY want to abandon direct I/O register access, because it is different on that chip.

The glory of CCS is that their intrinsic functions like input_b() and output_B()
as well as timer setting , pwm and most other PIC function components , compiles the same code transparently across different parts and even differing families of PICS ..

You were guilty of the same lapses i committed when a newish user - fresh out of assmbler only PIC work. CCS is just so much better
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group