80 likes | 336 Views
I/O Ports. I/O Ports Specs. Atmeg16 has 32 I/O ports (Ports A, B, C, D 8 lines each ). Each output buffer has symmetrical drive characteristics with both high sink and source capability . The pin driver is strong enough to drive LED displays directly .
E N D
I/O Ports Specs • Atmeg16 has 32 I/O ports (Ports A, B, C, D 8 lines each). • Each output buffer has symmetrical drive characteristics with both high sink and source capability. • The pin driver is strong enough to drive LED displays directly. • All port pins have individually selectable pull-up resistors. • All I/O pins have protection diodes to both VCC and Ground.
Port Registers • 3 registers are dedicated to each port. So for example Port A has the following 3 bytes (control I/O registers) controlling its operation: • DATA Reg. • Direction • Reg. • Pin Reg. 0->input pin 1->output pin
I/O port and alternate functions • Pullup is enabled lf: • Pullup-override w. value 1 • OR write port a 1 and write direction 0 (input) together w. PUD (pullup disable in I/O Register SFIOR=0)
Most port pins have alternate functions in addition to being General Digital I/Os (see pin assignment). PVOExn: Pxn PORT VALUE OVERRIDE ENABLE PVOVxn: Pxn PORT VALUE OVERRIDE VALUE
Assignment: • Design an Electronic Lock with arbitrary specs e.g.: • ? • 3 digits • Alarm after 3 trials • Master key