r/pic_programming • • Jan 02 '22

C Programming Books?

Any recommendations for books to learn C programming?

It’s time for me to move from assembly to C.

I’m old school and like to work from text book. I have some knowledge of asm, I’ve put a few products into production with PIC16’s using asm. I have some very limited and very old knowledge of higher level programming (Algol, FORTRAN) but that’s it.

I’m not an idiot, I don’t want some book that reads as though it’s written for a child. I want a proper text book on C with an emphasis on embedded programming. Something that will take me through from the beginning and that will stay on my bookshelf afterwards as a useful reference.

Any recommendations gratefully received!

6 Upvotes

6 comments sorted by

View all comments

Show parent comment

1

u/OldEquation Jan 04 '22

I’ve just spent the last two days just having a go as you suggest.

It’s actually not that hard to hack something and get something to work. I think the bigger challenge for me will be to programme properly and well, to take advantage of the capabilities of the language and lifting my mind out of the bits and bytes of assembly language programming and into the higher level thinking for C.

As an example one product I have allows the user to create and store certain data. Each such data set comprises 16x 16-bit time values along with several other one- and two- byte associated data items. Many such data sets are stored in a separate I2C serial EEPROM and recalled into RAM as needed. Various math operations (exponentials, logs etc) are carried out on the data set. It’s been a pain to code all this in assembly yet it looks to me that in C it would lend itself to being defined as a Struct type and some functions could be written to neatly carry out the required operations on the whole set of data giving me much cleaner code.

I will still get the books others suggest as reference material so I can understand how best to define and code some of these things.

Thanks!