AT90S2313 code not working

Thread Starter

huida_lymya

Joined Jul 23, 2018
25
Hi,how are you .Ihave problem with at90s2313 not work out on circuit board and in the simulation work can
you guide me this is the code:

C:
void main() {
ddrd=0x00;
  portd=0x0e;


  Portb=0;
  ddrb=0xff;
  while (1)
  {
  if (pind.b0==1 && pind.b1==1&& pind.b2==0&&pind.b3==0&& pind.B4==0)
  Portb=0b00001011;
  else
  Portb=0;
  if(pind.b0==1  && pind.b1==0&& pind.b2==0&&pind.b3==0&&pind.b4==0)
  portb=0b00000011;
  else
  portb=0;
  if(pind.b0==1&&pind.b1==0 && pind.b2==1&&pind.b3==0&&pind.b4==0)
  portb=0b00000010;
  else
  portb=0;
  if (pind.b0==1 && pind.b1==1&&pind.b2==1&&pind.b3==0&&pind.b4==0)
  portb=0b00000100;
  else
  portb=0;
  if(pind.b3==1&&pind.b1==1&&pind.b2==0&&pind.b0==0&&pind.b4==0)
  portb=0b00011001;
  else
  portb=0;
  if(pind.b3==1&&pind.b1==0&&pind.b2==0&&pind.b0==0&&pind.b4==0&&pind.B5==0)
  portb=0b00010001;
  else
  portb=0;

  if(pind.b3==1&&pind.b2==0&&pind.b1==1&&pind.b0==0&&pind.b4==0&&pind.B5==0)
  portb=0b00010000;
  else
  portb=0;
  if (pind.b3==1&&pind.b2==1&&pind.b1==1&&pind.b0==0&&pind.b4==0&&pind.B5==0)
  portb=0b00010000;
  else
  portb=0;



  }
}
 

MrChips

Joined Oct 2, 2009
34,807
There are experienced members here who can help you.
But before they can do that you need to explain clearly what you are trying to do.

In general, before even starting to write code, one should begin by writing out the specifications of the task and drawing a flow chart.
 
Top