Hi!
I tried to read PORTB/D/E and confirmed that they have +5V on the pins, but it seems that flowcode is returning always zero, no matter what is the ports real state (tested with couple of boards and checked all soldering joints under micros-scope).
Had no chance to check other ports as the chip is on the real hw and there are so many pulldowns installed... But ill order the DIL one's for next week to check it out on EB006-09...
OR if i have something wrong in config and you spot it, please let me know
[WORKAROUND] 16F18877 port IO has something weird going on..
Moderator: Benj
-
- Posts: 444
- Joined: Tue Apr 15, 2014 4:19 pm
- Location: Kajaani, Finland
- Has thanked: 345 times
- Been thanked: 227 times
- Contact:
[WORKAROUND] 16F18877 port IO has something weird going on..
- Attachments
-
- 16F18887 tester.fcfx
- (15.3 KiB) Downloaded 238 times
Ill just keep the good work up!
Re: 16F18877 port IO has something weird going on...
Your code has the program operating through the NO side of the decision tree every time. The variable 'read' is not declared, so the program flow is only through the NO side.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: 16F18877 port IO has something weird going on...
Hi bernoulli,
The Decision branch is using a constant called which is set to 1, therefore will always be true.
EtsDriver should see via UART, on his monitor.
Along with all the other UART string messages and results.
This should indicate hardware is running at the correct speed and the true part of decision branch is being accessed.
@EtsDriver , have you tried a 1 sec flash test to see if you can turn output on and off?
Martin
That is not correct.bernoulli wrote:The variable 'read' is not declared
The Decision branch is using a constant called
Code: Select all
Read
EtsDriver should see
Code: Select all
ALL PORTS READ RESULTS:
Along with all the other UART string messages and results.
This should indicate hardware is running at the correct speed and the true part of decision branch is being accessed.
@EtsDriver , have you tried a 1 sec flash test to see if you can turn output on and off?
Martin
Martin
-
- Flowcode v5 User
- Posts: 211
- Joined: Tue Feb 19, 2013 9:51 pm
- Has thanked: 72 times
- Been thanked: 177 times
- Contact:
Re: 16F18877 port IO has something weird going on...
PORTx reads when it's ANSELx bits are set will always return a zero.
-
- Posts: 444
- Joined: Tue Apr 15, 2014 4:19 pm
- Location: Kajaani, Finland
- Has thanked: 345 times
- Been thanked: 227 times
- Contact:
Re: 16F18877 port IO has something weird going on...
Tested it yes, the outputs can be toggled fine. (And the UART works fine )medelec35 wrote: @EtsDriver , have you tried a 1 sec flash test to see if you can turn output on and off?
Martin
Kenrix2 wrote:PORTx reads when it's ANSELx bits are set will always return a zero.
Oh found it:EtsDriver wrote:Can you explain that more?
Had to put C-code that Kenrix2 suggested to all read functions to get them work correctly.
Code: Select all
ANSELx=0x00 ;
As conclusion:Microchip wrote:12.4.2 DIRECTION CONTROL
12.8.6 ANALOG CONTROL
The ANSELC register (Register 12-25) is used to
configure the Input mode of an I/O pin to analog.
Setting the appropriate ANSELC bit high will cause all
digital reads on the pin to be read as ‘0’ and allow
analog functions on the pin to operate correctly.
The state of the ANSELC bits has no effect on digital output
functions. A pin with TRIS clear and ANSELC set will
still operate as a digital output, but the Input mode will be
analog. This can cause unexpected behavior when executing
read-modify-write instructions on the affected
port.
It seems Flowcode doesn't configure these automagically for Flowcode program.
- Attachments
-
- 16F18887 tester.fcfx
- (16.16 KiB) Downloaded 238 times
Ill just keep the good work up!
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: [WORKAROUND] 16F18877 port IO has something weird going
Thanks for the info.
Updated FCD files attached.
Updated FCD files attached.
- Attachments
-
- 16F188xx.zip
- (34.86 KiB) Downloaded 252 times