It is currently 20 Apr 2018 02:00

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 03 May 2017 13:47 
Offline

Joined: 06 Mar 2017 08:57
Posts: 8
I am experiencing strange unknown problem using pic5 dew board, pic 16f684 mcu and latest mikroe pic compiler. I removed all software and drivers and made a clean install but problem persist.

I tried just a simple led program (ansel and porta register are all correctly assigned) and when I use:
porta.0:=1;
porta.1:=1;
only RA0 led will shine and if I use:
porta.1:=1;
porta.2:=1;
only RA2 will shine

when I use
porta:=%00000011;
or
porta:=%00000101;

everything works ok.


Top
 Profile  
 
PostPosted: 03 May 2017 22:35 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4892
It's not the compiler that's to blame - the effects you're observing are due to the way single bits of a port are modified in a PIC processor. You'll find an explanation of these effects in the 'Read Modify Write Problem' chapter in compiler Help.

_________________
Replacement libraries for mP PRO and PIC18 processors, mP PRO tips & trics


Top
 Profile  
 
PostPosted: 04 May 2017 12:15 
Offline

Joined: 06 Mar 2017 08:57
Posts: 8
Thank you for finding the explanation and solution to that problem.

So why do then compiler even have this option of writing single bit to port pins if controler than writes the whole port and user get such a strange behavior?


Top
 Profile  
 
PostPosted: 04 May 2017 13:05 
Offline

Joined: 29 Sep 2007 14:35
Posts: 171
Location: France
Quote:
So why do then compiler even have this option of writing single bit to port pins if controler than writes the whole port and user get such a strange behavior?

Because this problem doesn't always occur, depending on uC speed and pin load. :wink:


Top
 Profile  
 
PostPosted: 17 Nov 2017 17:58 
Offline

Joined: 30 Mar 2011 14:36
Posts: 7
I think because mcu is pin can work such as anlog ,digital, pwm ,etc must config at main program to correct for mcu number it have happen to me but after config main program correct form datasheet microchip every thing clear and you can understand it sir. some time speed cpu high and after delay it ok sush as analog input i used to hi-tech after simulator by proteus say wait time adc not clear and after play by change program and study datasheet microchip every thing clear sir.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to: