Electronics > Beginners
How to start embedded progrmming
mathan:
hello all,
I have just begin embedded c programming, I am on the learning process can anyone help me for how to write the program from datasheet? if any website or forum available for that please provide the details :)
THANKS IN ADVANCE ;)
Rerouter:
Your missing just a few details...
E.g. maybe a link to the datasheet??
What your intending to use it for??
Do you have any prior knowledge of programming languages?
rjp:
you may have more success if you tell people where you are embedding the c.
mathan:
Hi Rerouter,
Thanks for your reply. I know basic C language and i able to understand programs ( i have read several pic24f programs). now i m trying to write basic program like toggle the LED. I have saml21j18b development board so I want to make simple program by whatever the details that provided in the datasheet itself :)
Rerouter:
Ok to begin with, It appears this development board is intended to be used with "Atmel Studio", This is an "IDE" for writing the software to run on the device.
To write microcontroller software, generally the IDE's will have a "Library" of common code to make things more plug and play, similar to what the arduino enviroment does, keeping the harder stuff hidden,
But if you just want to dive right in, the device has various "Peripherals" there are specific purpose bits of hardware that generally let you do cool things, without having to be actively looked after by the CPU,
simple Examples would be an ADC, (Analog to digital converter, he measures voltages and spits out a number for the reading), Timers (Can be used to count pulses or the time between pulses, or as an alarm), USART/UART's (Serial In and out), SPI (Mostly the same just generally faster), TWI (Small cheap external sensors)
Then when you get to higher performace there are more peripherals that can pull off some real magic like the DMA Controller (Direct Media Access), you pretty much tell him to copy from X to Y and how many bytes and he will handle the transfer with the CPU free to do what it wants, getting a flag when the transfer is done,
These peripherals are set up with "Registers", where certain bits switch certain functions of those peripherals to behave how you want it, the datasheet should go into high detail on what each register controls,
But to honestly just toggle an LED, your likely looking at I/O, setting a pin as an output, then changing its state after X amount of time, If it has that library of macros like i mentioned at the start its likely something like: pinMode A11 Output; digitalWrite A11 True; delay(1000); digitalWrite A11 False; delay(1000);
Navigation
[0] Message Index
[#] Next page
Go to full version