EmbDev.net

Forum: ARM programming with GCC/GNU tools AT91SAM7S256 ~ PORT IO Code Help


Author: Nazmus Sakib (Company: Time & Space) (sakibnaz)
Posted on:

Rate this post
0 useful
not useful
Hello.
I am very new at ARM7. Trying to switch ARM7 from AVR. I am using 
WinARM. I have checked the example codes "LED Blink" for both ATMel and 
LPC.

for the LPC code (lpc2106_blink_switch )to turn ON a LED:

GPIO_IODIR |= (1<<LEDPIN);  // define LED-Pin as output
GPIO_IOCLR=(1<<LEDPIN);  // set all outputs in mask to 0 -> LED on

I am interested to use ATMel ARM7 AT91SAM7S256 MCU but don't have any 
EK.
So, initially I want to write a code which will simple makes a PIN high 
logic to turn ON a LED. I want to do this like the LPC code without 
adding any board header. Like, there will be a simple mail program which 
will define the Output PORT and make a PIN high logic of AT91SAM7S256. 
But all ATMel ARM7 example are for the EK. Could anyone suggest to write 
the main function to make a PIN high logic without adding ant board 
header? Actually after doing some initial code I'll make a breakout for 
AT91SAM7S256 chip and try to burn the HEX directly (without EK). Thanks 
in advance.

Regards.
Sakibnaz.

Author: Peter (Guest)
Posted on:

Rate this post
0 useful
not useful
Hello,

I do something like:

#define LED1    BIT17

AT91C_BASE_PIOA->PIO_OER = LED1; // Set as Output

p_pPio->PIO_CODR = LED1; // Low
p_pPio->PIO_SODR = LED1; // High

... should not be very tricky, to find out the adresses with the 
datasheet.

Kind regards,
Peter

ps.: I´m using the Olimex AT91SAM7P256 with the AT91SAM7S256 on it.

Author: Nazmus Sakib (Company: Time & Space) (sakibnaz)
Posted on:

Rate this post
0 useful
not useful
Hello Peter.
Thank you for your reply. Yes I have done the initial port IO Led 
Blinking code. Actually I am very beginner on ARM. Now checking the 
codes of UART. I am using Keil MDK uVision IDE. What Compiler and IDE 
you are using to program your Olimex-EK?

Regards.
Sakibnaz.

Author: Big Wall (tylr2005)
Posted on:

Rate this post
0 useful
not useful
Hello Nazmus.
I'm a beginner on ARM too. I use at91sam7xxxx in my board and develop 
with IAR EWARM.
I hope you can understand my words, because my English is so poor.
:)

Regards.
Bigwall.(from China)

Author: Nazmus Sakib (Company: Time & Space) (sakibnaz)
Posted on:

Rate this post
0 useful
not useful
Hello Bigwall.

Are you using AT91SAM7X-EK? I don't have the EK yet. I use Keil MDK IDE.

Regards.
Sakibnaz.

Author: Big Wall (tylr2005)
Posted on:

Rate this post
0 useful
not useful
Nazmus Sakib wrote:
> Hello Bigwall.
>
> Are you using AT91SAM7X-EK? I don't have the EK yet. I use Keil MDK IDE.
>
> Regards.
> Sakibnaz.

I'm not use AT91SAM7X-EK. At first I bought a simple board with 
AT91SAM7S64 from "www.taobao.com" to study ARM. Then I drawn a pcb with 
AT91SAM7X256. The difference between 7S?? and 7X?? are only the Ethernet 
peripheral. But the AT91SAM7S64 study board is cheap.   :p

I never use Keil MDK IDE. I always use IAR EWARM. Once I tried YAGARTO 
toolchains, but I feel too difficult. In addition, the EWARM's simulator 
function is powerful, it can simulate interrupts.

If I have more time, I want to study YAGARTO toolchain. Because it's 
free and my EWARM is [...(*)].

Regards.
Bigwall.

[(*) removed by Mod.]

Author: Nazmus Sakib (Company: Time & Space) (sakibnaz)
Posted on:

Rate this post
0 useful
not useful
Hello Bigwall.

I never tried IAR. My target is to program AT91SAM7x256 Chip directly. I 
have only the Chip. I'll make a breakout board for the Chip. Do you 
think, is it possible to program the ARM7 chip directly as like we did 
for AVR (using USB, Serial or Parallel port)?

Yes, I also like Open Source projects. I see YAGARTO and there are some 
tutorials for YAGARTO and Eclipse by Jim Lynch. Nice tutorial. But I did 
not test that yet. It will be a nice learning for me too :-)
Did you see WinARM? Its a nice Open Source Project too. There are lots 
of examples by Martin Thomas for AT91SAM7 Series MCU.

Thank you.

Regards.
Sakibnaz.

Author: Big Wall (tylr2005)
Posted on:

Rate this post
0 useful
not useful
Hello Sakibnaz.

Your target is feasible.
The at91sam7x and at91sam7s series both have a internal boot program. It 
is actived by pull-up the TST pin about 10s when power on.
And Atmel provide a GUI program run in Windows namely SAM-BA. Then you 
can program the chip by USB or serial port or J-Link. I hope it is what 
you want.  ^_^

And thank you for introduce the WinARM to me, It will be a nice learning 
for me too.

If you like, I hope you write e-mail to me anytime. And I'm very glad to 
make friend with you. My e-mail is tylr2005@126.com.

Work happily! Now I wish you have a good dream.   :p

Regards.
Bigwall.

Author: Nazmus Sakib (Company: Time & Space) (sakibnaz)
Posted on:

Rate this post
0 useful
not useful
Thank you. I appreciate. We can work together in the world of ARM7.

Regards.
Sakibnaz.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.