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 support@ccsinfo.com

PIC24 PORTB issue.

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
0xDEADBEEF



Joined: 24 Jan 2007
Posts: 8

View user's profile Send private message

PIC24 PORTB issue.
PostPosted: Tue Mar 04, 2008 11:01 am     Reply with quote

Sample code:
Code:
fprintf(COMCON, "\rA:%2x\tB:%2x\tC:%2x\tD:%2x\tE:%2x\tFB:%2x\tG:%2x\t", input_A(), input_B(), input_C(), input_D(), input_E(), input_F(), input_G());



1. The input function only returns an 8-bit number (yes, even if I change the printf formatting to %4x) instead of the full 16-bit value... i can work around that though.

2. All the ports are working except PORTB (well I haven't actually checked PORTC, but I'm not using it so I don't care).


No matter what, PORTB always reads as all zeroes.

Chip is a PIC24HJ256GP610 compilier is version 4.064

Any ideas?
0xDEADBEEF



Joined: 24 Jan 2007
Posts: 8

View user's profile Send private message

PostPosted: Tue Mar 04, 2008 11:52 am     Reply with quote

UPDATE:

PortB works when I'm running in DEBUG mode through the MPLab ICD2 programmer.

So, apparently this is a compilier issue of some sort. The question is... how do i fix it?


MPlab version is 8.00
Guest_7068
Guest







PostPosted: Thu Mar 06, 2008 7:19 pm     Reply with quote

Try using the printf with %LX parameter.

Use the following to shut down the A/D module which is multiplexed on port B.
Code:
SETUP_ADC_PORTS(NO_ANALOGS);
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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