Go Down

Topic: Newbie questions (Read 8 times) previous topic - next topic

Charles Linquist

I'm a long-time PIC user and I write in both ASM and PICBasic Pro.  I'm used to dealing very close to the hardware, and the abstraction makes me feel uneasy.  I need to read the ATMEL datasheets, but before I do, I would like to ask the following questions:

What libraries make use of all the hardware functions of the chip?
I'm mostly concerned with the serial port, SPI port, I2C and PWM.  Are they hardware, or bit-banged?

How much overhead does Sketch add?  For example, most PicBasic Pro functions are about 80% as fast as pure assembly.

What is the instruction cycle time of the Atmel chips?  For example, a PIC runs at 200nSec/instruction.

What is the interrupt latency?  Also, how many interrupt priority levels are there?

Or - if someone could point me to a (hopefully single) source for the above information, I would be most appreciative.


PaulS

Quote
I'm mostly concerned with the serial port, SPI port, I2C and PWM.  Are they hardware, or bit-banged?

There are hardware and software implementations of serial communication and PWM, at least. SPI and I2C may be bit-bangable, but they are supported in hardware, for specific pins.

Quote
How much overhead does Sketch add?

Depends on the sketch, the OS (which typically defines the compiler in use), and the compiler optimizations selected (hard-coded, that is).

Quote
What is the instruction cycle time of the Atmel chips?

Depends on the clock speed, which is typically 16MHz, so each instruction takes 62.5 nano-seconds.

Quote
Or - if someone could point me to a (hopefully single) source for the above information, I would be most appreciative.

Well, that would be the ATMEL data sheets that you don't want to read.

Charles Linquist

I appreciate the answers that you gave, and I'm looking at the 2560 datasheet right now.  

In "PIC - land", I use a lot of interrupts, so the interrupt latency is important.  If I write an ISRs in ASM, I have only 20-30 cycles of overhead.  If I write my ISRs in PicBasic, that increases to over 100. I can't figure out how much overhead that Sketch adds.  Is there an answer somewhere?

Also, PicBasic creates macros that then call the Microchip assembler, so it produces an ASM file.  If you want to know what the compiler is doing, you can look at the created ASM file.  I don't see anything like that in Sketch.  Is there a way I can see the actual instructions being programmed into the ATMEL?


Coding Badly

Quote
Also, PicBasic creates macros that then call the Microchip assembler, so it produces an ASM file.  If you want to know what the compiler is doing, you can look at the created ASM file.  I don't see anything like that in Sketch.  Is there a way I can see the actual instructions being programmed into the ATMEL?


http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1207951658/2
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1240652220
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1193790150
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1241117308

Some keywords to facilitate the search: "avr-dump", "temp" (as in the temporary directory), "hex".

Charles Linquist

Thank you.  That is one more step.  I have to say that while the level of abstraction that Sketch provides is very nice, it I am a bit uneasy about what is really going on.  I have seen compilers generate really  messy code.

Go Up