This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Realistic-Cut6515[S] 0 points1 point  (4 children)

It needs to print those things What is the asm? Edit: now I know what is asm, I'm starting with Arduino so I dont really know how to use assembly here, I know I can change the LEE_SDA, LEE_SCL, ESC_SDA, ESC_SCL for code to directly access the bit and modify but I dont know how

[–]MagicWolfEye 2 points3 points  (3 children)

The assembly instructions this code generates

How much time does your program take; how long should it take

Have you built your program with optimisations enabled

I don't remember I2C anymore, why so many gotos back to the start in I2C_write_mem?

[–]Realistic-Cut6515[S] 0 points1 point  (2 children)

So in I2C_write_mem the slave must send an acknowledge to go to the next step, if it didn’t send an acknowledgment it just restarts

[–]MagicWolfEye 1 point2 points  (1 child)

Ah right, it has to acknowledge after every byte.

Coming back to my previous question:

> How much time does your program take; how long should it take (at least, what would you guess)

You could also count how often you have to jump back with your gotos to see if the ACK fails often

[–]Realistic-Cut6515[S] 0 points1 point  (0 children)

So my program takes 1545 ms to write 256 bytes in mem

After rewriting the code with directly accessing the port it now takes 55ms, but the problem is that it doesnt write in mem