ELEKTOR FORUMS

Please log in to post a reply or subscribe / unsubscribe to topics

Topic: 8 and 7 bit Ports and how should it be Written

Author Post

confused

12 posts

Popping In
Popping In

Read post 08-11-2010 19:44

hi port B is an 8 bit Port so when you write movelw 0b00000000
THere are 8 Zeros
Then port C is a 7 bit wide in the course its written as
0b00000000 again 8 zeros

The same as an 8 bit wide , But surely it should be written as

0b0000000 eg 1 less i notice that FLow code does not care, it works both way ,but could some one let me know what the convention is
Thanks Peter

GeenBert

64 posts

Frequent Visitor
Frequent Visitor

Read post 08-11-2010 23:38

Port C is 8 bits wide. Pin c3 doesn't exist but c0,c1,c2 and c4 up to and including c7 do exist. So you need 0b00000000 where the 4th bit technically has no function.

If you use 0b0000000 for port C Flowcode does care: the 8th bit is simply not set. If it happens to be zero by default you may not notice this.

confused

12 posts

Popping In
Popping In

Read post 09-11-2010 16:20

Hi thanks but could you let me know why the data sheet discribes port C as 7 bit wide
Regards Peter

confused

12 posts

Popping In
Popping In

Read post 09-11-2010 16:33

Hi again when you look at the block diagram although it only shows 7 outputs it cleary show RC0 to RC7 8bits wide
Thanks Regards Peter

Arjen H.

1075 posts

Power User
Power User

Read post 09-11-2010 17:06

From the datasheet:
In PIC18F2455/2550/4455/4550 devices, the RC3 pin
is not implemented.


So port C only has 7 pins (7 pins wide), but you should address it as 8 bit. The RC3 bit is ignored (0 or 1, it does not matter...).

Please log in to post a reply or subscribe / unsubscribe to topics

Follow Elektor

      

Act now!

Bestseller

Microprocessor Design using Verilog HDL

This book is a practical guide to processor design in the real world. It presents the Verilog HDL in an easily digestible fashion and serves as a thorough introduction about reducing a computer architecture and instruction set to practice. 

Package Deals

Elektor Bundles

Check our Package Deals and save money! Discounts up to 19% now available!

Price Slashed

Elektor OSPV

This Open Source People Vehicle is perfect for factory halls, warehouses, hospitals, colleges, schools etc.

Elektor PCBs at 25% OFF