Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

S3C4510 IOPDATA Read/Write Question

Status
Not open for further replies.

JustinN

New Member
Hi, I'm a senior in our EE program, and am using a microcontroller for the first time, we have a AX4510 development board. I am competent with C/C++, and am learning assembly. I am using EmbestIDE education version to create my C and Source files.

I want to read and write data, and also store the data that was read in.

Section 12 in the S3C4510 user manual (page 394) showed me how to set these registers. Also EmbestIDE User Guide Example 3.3, helped me to understand the registers also.

**broken link removed**

Code:
IOPMOD = 0x0003003F;  //set P0-5, P16,17 as output.  All others are input
IOPCON = 0x320;	      //set Port9 as external interrupt
INTMOD = 0x0;	      //interrupt is IRQ mode(FIQ if set to '1')
INTMASK = 0x3FFFFD;   //this Masked all interrupts except XIRQ which is P9


for(;;)

{
		
  for(i=0;i<65000;i++)  
  //creates a delay, LED1 is not active during this time
  IOPDATA = 0x00000000;	
  //All output ports write out a '0' thus LED1 is not active
			
     for(i=0;i<65000;i++);		
     //delay, and then then returns to the start of the for(;;) loop
     IOPDATA = 0x0001003F;		
     //light LED1  Port 16 writes out a '1'
     //Ports 0 to Port 5 also write out a '1'
}


I checked the Ports with a Tektronix TDS 2202B scope, but didn't observe the correct output. I should've seen an alternating "low" followed by a "high." Per the schematics I checked pin 196 P16/TIMER0, and pin 20 P0. Both pins produced noise rather than the expected low high oscillation.

Is there something wrong with my C code? I am at a loss, and also don't know how to read in data from IOPDATA. IOPDATA is a data register that stores 1 bit, for each I/O port. I think I would need to store that 1 bit, move it to another register, LSL#1 (left shift by 1) the register, store another bit from IOPDATA, LSL#1 again, until I have a full word, then LDR to memory somewhere. Is my thinking correct, and if so, does anyone have any examples of how to do this. I've read the S3C4510 manual, and also read all of these sites about Assembly, unfortunately they don't cover S3C4510 input and output.

**broken link removed**
https://web.archive.org/web/20031203092354/www.geocities.com/wonglinhoo/Arm.htm http://www.heyrick.co.uk/assembler/ was really helpful.

I hope this forum is able to help me, as I'm new to microcontrollers, but am willing to learn. Also if anyone knows of other ARM7 I/O programming information sources they could direct me to, I'ld appreciate it. Thank you in advance.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top