Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

working with 24 bit registers

Not open for further replies.


Member level 1
Jul 6, 2009
Reaction score
Trophy points
Activity points
Hi all,

I have a IC that works with 8 bit, 12 bit and 24 bit registers that i want to read with a dsPIC that can work in 8 bit or 16 bit mode, is it possible to read the registers of 24 bit? if so, how?


I don't think the mode has anything to do with it.
If you want to read 24 bits at a time you will need 24 free input pins.
If you don't have 24 available input pins, then you could latch the results and read
say 8 bits at a time, and mux to the next 8 and so on.

The 8 and 16 mode you refer to is how the chip access memory, or does its math.

What is the IC you are referring to?

You didn't mention, but I guess, you're talking about a serial (SPI or similar) interface?
It's no problem with a high-level language, e.g. a C compiler.

Hi guys,

yes sorry i do mean with SPI. I am a bit confused.please help me understand. say i put my IC to work in 16 bit mode, this means the Buffer register only receives 16 bits and then i must empty the register by reading it. only then will it recieve more bits.

so how would i read a value that is passed to the other ic but is sent in 24 bits.

I am using ADE7753 energy meter and a dsPIC for example, i want to read a register that stores a rms value in order to test that i am communicating to the energy IC, but now i am not sure if i will receive the correct reading since half the bits will be cut off. I already tested the SPI between two dsPICs to switch LED's on and it works fine.

I am just not sure now if the energy IC has already been set to work in slave mode and such.

This is what i need help with:

I want to connect the dsPIC to the energy IC. Then i set the dsPIC as master SPI mode, then i tell the energy IC that i am going to perform a read from it by loading the dsPIC's buffer register with the appropriate bit for read and the address i'll be reading to. then i want the slave energy IC to send the rms value stored in the register to the dsPIC to turns LED's on the dsPIC that will represent the different bits. But i see the register of the energy IC that contains the rms information is 24 bits and my dsPIC can only work in 8 and 16 bit mode.

How can i know for sure that i am talking to the energy IC????


16 Bit SPI mode is a special feature of the 16-Bit Microchip processors. Most micros don't have it. Im not sure, if you can probably access ADE7753 in 16 bit mode, but I suggest to use 8 bit mode as anyone does.

Actually, the ADE7753 accesses aren't generally 24 Bit. They are variable in length and made by sending one address byte and reading or writing one to three data bytes, depending on respective command. It's also explained in the datasheet in terms of byte accesses, as they are provided by the SPI standard and available with any SPI capable micro.

Of course you have to disassemble and assemble 16 and 24 bits to 2 and 3 bytes. A very basic programming task, that has several solutions in any programming language. I think, that Microchip also has programming examples for Analog energy chips or 24 bit ADC. CCC C at least has it.

Not open for further replies.

Part and Inventory Search

Welcome to