Hi everyone I am working with PIC16F1847 and I want to configure the pin RB0 as input but every time I am getting an Undefined identifier set_port_b_tris from the compilier.
Could you please let me know what can be the problem?
The compiler is CCS v5.065
The IDE is MPLAB X IDE v5.40
Thanks
Code:
set_port_b_tris(0x0F); // configure RB0~4 ins as inputs
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
Posted: Sat Apr 24, 2021 10:23 am
Why not try reading the manual....
The tris command is set_tris_b No 'set_port'. Also if you use standard_io,
you basically never need to actually set the tris. Simply
output_high(PIN_B0) or output_low(PIN_B0) will output the bit and set the
tris for you.
quick comment..
when doing 'bit level' stuff, like pin directions on a port...) it's easier to use 0b00001111 instead of 0x0f. Visually the brain 'sees the upper nibble as outputs, the lower 4 bits as inputs. (0=Output, 1=Input).
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