Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
ram_kotecha
PostPosted: Jun 13, 2012 - 08:28 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


Hello,

I'm very novice to chip programming and I was wondering if any one could help me in this regard. I'm trying to create a 2d memomry look-up table in at28c64b only to no avail. Does anyone know how to create a lookup table in a parallel ic such as at28c64b
 
 View user's profile Send private message  
Reply with quote Back to top
theusch
PostPosted: Jun 13, 2012 - 08:32 PM
10k+ Postman


Joined: Feb 19, 2001
Posts: 25923
Location: Wisconsin USA

Well, since you >>are<< on an Atmel AVR site, if you do indeed have a large static lookup table that is crucial to your application (which makes one curious at the outset), why wouldn't you locate it in the AVR's onboard flash memory instead of adding the complexity and cost and pin count and power and time penalties of using an external chip?
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Jun 13, 2012 - 08:50 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62366
Location: (using avr-gcc in) Finchingfield, Essex, England

Do you simply mean you have a base pointer something like:
Code:
char * foo = (char *)0x8000;

and you want to treat what 'foo' points at as if it were a 2D array? If so then consider this. if you declare a 2D array such as:
Code:
char bar[8][5];

Then it's really a block of 40 bytes at address 'bar' and to access bar[3][2] you are saying the byte that is 3 lots of 8 plus another 2 away from the base address - so that is bar[3*8 + 2] which is the 26th byte or bar[26] which can also be written as *(bar + 26). In fact you can switch array notation and pointer access at will so going back to be 'foo' char pointer, if I wanted to access the byte at 0x8000 + 37 I could use *(foo + 37) or foo[37]. Now consider that I wanted to interpret that same array as foo[10][] where each "row" is 10 bytes then my 37 offest is foo[3 * 10 + 7] and, in fact you could stick with just that where to access the [N][M] element of an array that is foo[X][Y] in dimension it is simply foo[X * N + M]. But you can take this a step further and declare foo as:
Code:
char (* foo)[10];

which tells the compiler that the "rows" are 10 bytes wide. Then access foo[N][M]. So this code:
Code:
char (*foo)[10] = (void *)0x8000;

int main(void) {
   foo[7][5] = 0x55;
}

generates this assembler:
Code:

   foo[7][5] = 0x55;
  92:   e0 91 60 00    lds   r30, 0x0060
  96:   f0 91 61 00    lds   r31, 0x0061
  9a:   ea 5b          subi   r30, 0xBA   ; 186
  9c:   ff 4f          sbci   r31, 0xFF   ; 255
  9e:   85 e5          ldi   r24, 0x55   ; 85
  a0:   85 83          std   Z+5, r24   ; 0x05

and in the simulator this writes to 0x804B where 7*10 + 5 = 75 = 0x4B

I presume you want read-only access but the same applies and the only "clever bit" is the:
Code:
type (*name)[high_order_dimension];

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 13, 2012 - 10:07 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


Hi Clawson, thank you for your help with the code. I'll explain my system in more detail. I have a Simulink simulation in which I have a 2-d look up table and the output of the look-up table are the switch states for a converter (1 or 0) and the inputs are voltage and current vectors. How do I create a similar lookup table on a parallel eeprom. I do not have an AVR board. For the system, I have to store a voltage and current vectors in the memory IC and pull out the switch state as the output. Hope I'm a bit clearer this time.

thanks..
 
 View user's profile Send private message  
Reply with quote Back to top
theusch
PostPosted: Jun 13, 2012 - 10:13 PM
10k+ Postman


Joined: Feb 19, 2001
Posts: 25923
Location: Wisconsin USA

Quote:

I do not have an AVR board.

I'm out.
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 13, 2012 - 10:31 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


thank you anyways theusch..
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 14, 2012 - 06:06 AM
Rookie


Joined: Jun 13, 2012
Posts: 38


@theusch.

Thank you for your help. But at the same time, just quoting one sentence out as a reason for not helping out is not reasonable. Discussion forums are for spreading knowledge to begin with. They are not based on certain terms and conditions. If one does not want to help, one does not need to be rude either. People come to discussion forums to get help from people who are willing to help.
 
 View user's profile Send private message  
Reply with quote Back to top
meslomp
PostPosted: Jun 14, 2012 - 07:15 AM
Raving lunatic


Joined: May 02, 2007
Posts: 3022
Location: Nieuwegein, Netherlands

I wonder...
but you are not using an AVR for your code, yet you come here (an AVR specific forum) and ask a question about how to write code for using an external EEPROM.....
why do you come here?????
(note: this is not a rude question, just very very curious as to what brings the OP here instead of the forum of the controller he is actually using...)

The big thing is that most(if not all) AVRs today have a onboard EEPROM. So you could implement it without additional components.

as clawson wrote:
using storage in a look-up table or array is nothing more then a base address plus a number of offsets(one for each dimension of the table/array) I think if you keep that in mind writing code would not be that hard. assuming you have the interface to the external storage under control and know how to use it....

_________________
1)Datasheet and application notes checked?
2)tutorial forum
3)Newbie start here
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Jun 14, 2012 - 09:08 AM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62366
Location: (using avr-gcc in) Finchingfield, Essex, England

ram_kotecha

Can we be clear as to whether we are talking about the use of avr-gcc for an 8bit AVR here or not so I know which forum to move this thread too? In fact even if you are using an AVR then GCC is the wrong forum anyway as there's nothing really GCC specific about anything mentioned so far unless you imply the need to use __attribute__((section())) and --section-start?

Cliff (acting as moderator)

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 14, 2012 - 05:58 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


Thank you people. I could not really find any community where I can post a question related to parallel EEPROM. I found this forum from ATMEL site since I am using an ATMEL parallel EEPROM AT28c64B. If you know of any community let me know.
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 14, 2012 - 06:01 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


Now coming back to the problem, I have an AT28C64B parallel eeprom and I have BP-1200 development system which can write on an eeprom using a hex file. I have a 2-D lookup table with the switching logic as the output in simulink. I'm trying to use the same lookup table to write on an eeprom using the development system that I have.
 
 View user's profile Send private message  
Reply with quote Back to top
meslomp
PostPosted: Jun 14, 2012 - 08:20 PM
Raving lunatic


Joined: May 02, 2007
Posts: 3022
Location: Nieuwegein, Netherlands

Quote:
The AT28C64B is accessed like a Static RAM for the read or write cycle without the
need for external components


the BP-1200 seems to be an ordinairy programmer.
It will probably just write to the EEPROM as if you would try to access external RAM.

all you need to do is define a start adress and then determine what offset commes first and what offste commes second.
so the fetch location adress will become: start+Offset1+offset2

_________________
1)Datasheet and application notes checked?
2)tutorial forum
3)Newbie start here
 
 View user's profile Send private message  
Reply with quote Back to top
theusch
PostPosted: Jun 14, 2012 - 08:28 PM
10k+ Postman


Joined: Feb 19, 2001
Posts: 25923
Location: Wisconsin USA

Quote:

But at the same time, just quoting one sentence out as a reason for not helping out is not reasonable.

But that was the reason why I went "out". That sentence. What more do I need to quote?
 
 View user's profile Send private message  
Reply with quote Back to top
ka7ehk
PostPosted: Jun 14, 2012 - 09:23 PM
10k+ Postman


Joined: Nov 22, 2002
Posts: 12055
Location: Tangent, OR, USA

Data, even a "table" is "just bytes". Can't you construct a binary image of your table and write it to the EEPROM?

Jim

_________________
Jim Wagner
Oregon Research Electronics, Consulting Div.
Tangent, OR, USA

"The only thing standing between us and victory is defeat" P.G.Wodhouse in Wooster & Jeeves series
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 15, 2012 - 12:42 AM
Rookie


Joined: Jun 13, 2012
Posts: 38


meslomp wrote:
Quote:
The AT28C64B is accessed like a Static RAM for the read or write cycle without the
need for external components


the BP-1200 seems to be an ordinairy programmer.
It will probably just write to the EEPROM as if you would try to access external RAM.

all you need to do is define a start adress and then determine what offset commes first and what offste commes second.
so the fetch location adress will become: start+Offset1+offset2


thanks a lot. So, the offset would determine the look up table row's and column's vector ! Am i right? The first offset would determine the row vector and the second offset would determine the column vector. Right?

Also, Are you suggesting that bp 1200 won't work? Then what system should I use ??
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 15, 2012 - 12:54 AM
Rookie


Joined: Jun 13, 2012
Posts: 38


ka7ehk wrote:
Data, even a "table" is "just bytes". Can't you construct a binary image of your table and write it to the EEPROM?

Jim


Thank you, Mr Wagner.. I'll see if I can do that. I do not have much background in chip programming which is part of the problem. But right now, my requirement is such that the only way it'll be possible to complete my project is through a look-up table in a parallel eeprom coz serial eeprom would need a microcontroller which would add more hardware to the system and introduce more noise to the control system. the look-up table is made up of arrays of voltage and current vector in the simulation. The output of the table is just the switch state depending on what values of the current and voltages hit the look-up table.
 
 View user's profile Send private message  
Reply with quote Back to top
Kartman
PostPosted: Jun 15, 2012 - 02:18 AM
Raving lunatic


Joined: Dec 30, 2004
Posts: 8789
Location: Melbourne,Australia

Now we're starting to get the whole picture! Your BP1200 programmer should be able to program your device, but the issue is how to structure your data and get this into the programmer in order to store it into the flash chip. If the size of your two dimensions are a power of 2, then this makes things a bit easier for you as the address lines can be used easily to lookup the value you want. Eg: if X is 0..15 (2 ^4) and Y is 0..63(2^6) then address pins A0..3 are your X value, address pins A4..9 are your Y value. The other address pins would be tied to 0V. In order to create the data, I would use an assembler and type in your data tables. The assembler would take your data and create a .hex file which can be loaded into the programmer then into your flash chip. I assume the programmer can be connected to your PC?
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 15, 2012 - 04:23 AM
Rookie


Joined: Jun 13, 2012
Posts: 38


Kartman wrote:
Now we're starting to get the whole picture! Your BP1200 programmer should be able to program your device, but the issue is how to structure your data and get this into the programmer in order to store it into the flash chip. If the size of your two dimensions are a power of 2, then this makes things a bit easier for you as the address lines can be used easily to lookup the value you want. Eg: if X is 0..15 (2 ^4) and Y is 0..63(2^6) then address pins A0..3 are your X value, address pins A4..9 are your Y value. The other address pins would be tied to 0V. In order to create the data, I would use an assembler and type in your data tables. The assembler would take your data and create a .hex file which can be loaded into the programmer then into your flash chip. I assume the programmer can be connected to your PC?


Mr. Kartman... You're amazing. that's what I need to do.So, the same logic can be applied for any number of look up tables right? eg. If I'm using a 3-d look up table, than I can use 12 bits of address lines and split them 4 per dimension, right?
So, can i use cygnus editor to create a hex file? I have never used it, but i found some info about it on google. And I can populate the table output on the pins on the pins O0-O7, right?

thank you so much... that makes my life a little bit easier.
 
 View user's profile Send private message  
Reply with quote Back to top
Kartman
PostPosted: Jun 15, 2012 - 05:21 AM
Raving lunatic


Joined: Dec 30, 2004
Posts: 8789
Location: Melbourne,Australia

You've got the general idea. A hex file is usually machine generated. Thats why i suggest using an assembler program to take your tables and generate the hex file for you. Hopefully Cliff or the others will chime in and suggest an assembler and give you an example on how to drive it. Depending on the size of your tables this could be labourious. If you are writing a program on your PC to calculate your data, then you could have it generate the hex files directly and skip using the assembler. Google intel hex and that should lead you to wikipedia for an explanation.
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 15, 2012 - 06:04 AM
Rookie


Joined: Jun 13, 2012
Posts: 38


Actually, I wrote my program in in MATLAB with a simulink model. The look-up table is also there in the simulink model. I couldn't find a way to convert the simulink model into hex file. The size of the table is also flexible and I am gonna vary it depending on the response and noise in the system. But I'll use in the multiples of 2(as you suggested, that will make my life a lot easier).
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 15, 2012 - 06:04 AM
Rookie


Joined: Jun 13, 2012
Posts: 38


Actually, I wrote my program in in MATLAB with a simulink model. The look-up table is also there in the simulink model. I couldn't find a way to convert the simulink model into hex file. The size of the table is also flexible and I am gonna vary it depending on the response and noise in the system. But I'll use in the multiples of 2(as you suggested, that will make my life a lot easier).
 
 View user's profile Send private message  
Reply with quote Back to top
ka7ehk
PostPosted: Jun 15, 2012 - 06:10 AM
10k+ Postman


Joined: Nov 22, 2002
Posts: 12055
Location: Tangent, OR, USA

Indeed, we are now getting somewhere.

To burn in an EEPROM, you need something like a .hex file (or one of the other "image " files. How do you get that? Either write some code to create the file according to the intel hex format. Or, you use some assembler that allows you to create a data table (Atmel Assembler2 is one of several that will). "Assemble the table with no code. That will create the hex file for you. The EEPROM burner can accept the hex file and burn it into the EEPROM.

Once you have the mechanics of this down, your final issue is table organization. Your 2D table has to be flattened into a 1D memory space. So, you can organize by row or by column, your choice, such that a simple mapping points to a linear memory address such as
Code:
address = base + row_num + maxrowcount*col_num


YOU will have to provide the mechanism in your FPGA, or what ever it is, to compute the linear address from the row and column indices.

Jim

_________________
Jim Wagner
Oregon Research Electronics, Consulting Div.
Tangent, OR, USA

"The only thing standing between us and victory is defeat" P.G.Wodhouse in Wooster & Jeeves series
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 15, 2012 - 07:58 AM
Rookie


Joined: Jun 13, 2012
Posts: 38


Thank you Mr. Wagner for your help. I'll see if we have an assembler in our lab or not. But we do not have FPGA for sure in our lab. So, that is out of the equation for me. But I'm glad i got so many ideas already.

I hope if someone knows how to convert a MATLAB/Simulink model into hex file, that would be really really awesome. Meanwhile, I'll try using all the options you folks have suggested. Please keep coming with your ideas, if you have more, I'll be truly grateful to you all..
 
 View user's profile Send private message  
Reply with quote Back to top
Kartman
PostPosted: Jun 15, 2012 - 11:10 AM
Raving lunatic


Joined: Dec 30, 2004
Posts: 8789
Location: Melbourne,Australia

Can i ask what generates the inputs? How fast are these generated and how fast do you need the solution. Realise that the output data will glitch when the inputs change unless you add extra logic to synchronise the output. At a guess it seems like you really need a microcontroller.
 
 View user's profile Send private message  
Reply with quote Back to top
ka7ehk
PostPosted: Jun 15, 2012 - 04:42 PM
10k+ Postman


Joined: Nov 22, 2002
Posts: 12055
Location: Tangent, OR, USA

If all you have is a collection of single-bit inputs to the EEPROM, then the best you can do is a one dimensional table. You could allocate some inputs to be "row" and some as "column" but that would be an illusion. It would still be 1D.

What do you expect to get from this 2D organization that is not obtained from a 1D linear organization?

Jim

_________________
Jim Wagner
Oregon Research Electronics, Consulting Div.
Tangent, OR, USA

"The only thing standing between us and victory is defeat" P.G.Wodhouse in Wooster & Jeeves series
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 15, 2012 - 04:48 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


Kartman wrote:
Can i ask what generates the inputs? How fast are these generated and how fast do you need the solution. Realise that the output data will glitch when the inputs change unless you add extra logic to synchronise the output. At a guess it seems like you really need a microcontroller.


Actually, the inputs will be voltage and current coming from a converter through ADC and will go to the look up table and give switch state as the output that will go back to the FET of the converter to provide control. The switch states are calculated theoretically and simulations for different voltages and current that will be stored in the lookup table. I might even need to make a third dimension that will also provide the switch state of the next value. But that's a different story. If i can get 2-d look up table to work, 3-d won't be too hard.
I am not allowed to use microcontroller and that's why i chose parallel eeprom that can directly talk with the adc.
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 15, 2012 - 04:49 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


ka7ehk wrote:
If all you have is a collection of single-bit inputs to the EEPROM, then the best you can do is a one dimensional table. You could allocate some inputs to be "row" and some as "column" but that would be an illusion. It would still be 1D.

What do you expect to get from this 2D organization that is not obtained from a 1D linear organization?

Jim


Mr. Wagner,

I would need 2d or 3d look up table 'cause i'm implementing a real-time control using the results derived from theory and simulations.
 
 View user's profile Send private message  
Reply with quote Back to top
ka7ehk
PostPosted: Jun 15, 2012 - 08:03 PM
10k+ Postman


Joined: Nov 22, 2002
Posts: 12055
Location: Tangent, OR, USA

That still does not say why a multidimensional table is needed.

So, you have multiple ADCs? And you want a "dimension" for each ADC? Just flatten the table into a single linear address space. You can verify this in MATLAB very easily. The only question is how you figure where in the address space each data value goes.

And, of course, you will be dealing with 8-bit integer data, right? Your output bus is only 8 bits wide.

Jim

_________________
Jim Wagner
Oregon Research Electronics, Consulting Div.
Tangent, OR, USA

"The only thing standing between us and victory is defeat" P.G.Wodhouse in Wooster & Jeeves series
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 15, 2012 - 09:04 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


ka7ehk wrote:
That still does not say why a multidimensional table is needed.

So, you have multiple ADCs? And you want a "dimension" for each ADC? Just flatten the table into a single linear address space. You can verify this in MATLAB very easily. The only question is how you figure where in the address space each data value goes.

And, of course, you will be dealing with 8-bit integer data, right? Your output bus is only 8 bits wide.

Jim


Are you suggesting that each address in the memory would correspond to a particular data value for a particular dimension?
 
 View user's profile Send private message  
Reply with quote Back to top
jayjay1974
PostPosted: Jun 16, 2012 - 12:56 AM
Raving lunatic


Joined: Oct 30, 2002
Posts: 5721
Location: The Netherlands

In what format is the lookup table now?
 
 View user's profile Send private message  
Reply with quote Back to top
ka7ehk
PostPosted: Jun 16, 2012 - 01:29 AM
10k+ Postman


Joined: Nov 22, 2002
Posts: 12055
Location: Tangent, OR, USA

I assume that you will have several ADCs, each with a parallel output. In aggregate, they will form an "address". For sake of an example suppose that ADC0 makes the low 4 address bits, ADC1 makes the next 4 address bits and ADC2 makes the next 5 add (for 13 address bits). One COULD imagine this as a 3D address space (4bit x 4bit x 5 bit) that has been flattened into a single linear 13 bit address space.

Next, just for example, suppose that you want some specific condition when ADC0 = 0x04, ADC1 = 0x03, and ADC2 = 0x12. Then the effective composite address would be 0x1234, At that address location, you would then put the data value for that combination of inputs, say 0xff.

By the way, choosing this EEPROM gives you very little resolution from any ADC. At best, you get 4 bits from two and 5 bits from one. Thats not much.

No multi-dimension table is needed!

Jim

_________________
Jim Wagner
Oregon Research Electronics, Consulting Div.
Tangent, OR, USA

"The only thing standing between us and victory is defeat" P.G.Wodhouse in Wooster & Jeeves series
 
 View user's profile Send private message  
Reply with quote Back to top
jayjay1974
PostPosted: Jun 16, 2012 - 01:54 AM
Raving lunatic


Joined: Oct 30, 2002
Posts: 5721
Location: The Netherlands

But the data in the EEPROM represents a multi-dimensional table Wink

The question is on how to convert from the currently used format to a hex file. Isn't stuff like Perl/Phyton/PHP/TCL meant for these things?
 
 View user's profile Send private message  
Reply with quote Back to top
ka7ehk
PostPosted: Jun 16, 2012 - 02:36 AM
10k+ Postman


Joined: Nov 22, 2002
Posts: 12055
Location: Tangent, OR, USA

I am assuming, from previous comments, that each ADC represents a "dimension" in the OP's thinking. For any integer dimension index, there is only 1 "value". Hence, each dimension can represent a field out of the larger width address space, resulting in a linear address map with a 1;1 correspondence between a 13 bit address and an 8 bit value.

The mapping can be done, very easily in matlab, where all this originates. If we assume that each ADC output has been masked and shifted so that the top 4 or 5 bits form a a right-shifted integer (by that, I mean, from the set {0.1.2,...,15} or {0,1,2,...,31}. For a 5:4:4 set of input fields, the linear address is (in matlab) is simply A = ADC2*256 + ADC1*16 + ADC0. No Perl needed.

Hope this is more clear than it seems.

Jim

_________________
Jim Wagner
Oregon Research Electronics, Consulting Div.
Tangent, OR, USA

"The only thing standing between us and victory is defeat" P.G.Wodhouse in Wooster & Jeeves series
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 16, 2012 - 07:48 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


ka7ehk wrote:
I am assuming, from previous comments, that each ADC represents a "dimension" in the OP's thinking. For any integer dimension index, there is only 1 "value". Hence, each dimension can represent a field out of the larger width address space, resulting in a linear address map with a 1;1 correspondence between a 13 bit address and an 8 bit value.

The mapping can be done, very easily in matlab, where all this originates. If we assume that each ADC output has been masked and shifted so that the top 4 or 5 bits form a a right-shifted integer (by that, I mean, from the set {0.1.2,...,15} or {0,1,2,...,31}. For a 5:4:4 set of input fields, the linear address is (in matlab) is simply A = ADC2*256 + ADC1*16 + ADC0. No Perl needed.
Hope this is more clear than it seems.

Jim


Mr. Wagner, I'm now understanding much better what you've been trying to explain in last couple of days. I was wondering how would i do mapping in MATLAB as suggested.
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 16, 2012 - 07:56 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


jayjay1974 wrote:
In what format is the lookup table now?


The lookup table is in a Simulink mathematical model. And I'm trying to store the lookup table in a parallel eeprom
 
 View user's profile Send private message  
Reply with quote Back to top
ka7ehk
PostPosted: Jun 16, 2012 - 09:46 PM
10k+ Postman


Joined: Nov 22, 2002
Posts: 12055
Location: Tangent, OR, USA

Do an integer division of the ADC value (by a power of 2). If you divide 0x123 by 16 = 0x10 in an integer division, you get 0x12 which has the effect of right shifting and masking in a single operation.

Then, simply sum the different values, each multiplied by a power of 2. These multiplications have the effect of left shifting while inserting 0s in the new low bit locations. For example, 0x12 * 16 gives you 0x120.

That is how you would construct a 1D table address in MatLab.

Jim

_________________
Jim Wagner
Oregon Research Electronics, Consulting Div.
Tangent, OR, USA

"The only thing standing between us and victory is defeat" P.G.Wodhouse in Wooster & Jeeves series
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 17, 2012 - 03:41 AM
Rookie


Joined: Jun 13, 2012
Posts: 38


ka7ehk wrote:
Do an integer division of the ADC value (by a power of 2). If you divide 0x123 by 16 = 0x10 in an integer division, you get 0x12 which has the effect of right shifting and masking in a single operation.

Then, simply sum the different values, each multiplied by a power of 2. These multiplications have the effect of left shifting while inserting 0s in the new low bit locations. For example, 0x12 * 16 gives you 0x120.

That is how you would construct a 1D table address in MatLab.

Jim


Mr. Wagner, I have been carefully reading what you've said and everything is making sense. From what you speak, I think you have a sound understanding of chip level programming and so I was wondering how would I program this chip and I think you'd understand my issue the best and I hope I can explain my question here.

Before the inputs from the ADCs arrive, I have to load the chip with pre-determined set of inputs and pre-determined switch-states as the output. (Kind of theoretical predictions for real time).

it doesn't matter if I'm required to flatten out my memory table or keep it 3-d. And for the resolution, I'll use higher sizes of chips too to see which one works better, but i first need to get one chip working. But here's what i'm trying to do.

i need to store a voltage vector with values from 0-30 in some steps which will change during the course of experiment. i need to store a current vector with values from 0-5 in some steps same as voltage vector. And the present switch state corresponding to voltage and current values at each point. The output of the table is a future switch state. The real-time voltages and current will come from the converter, hit the lookup table, will find the nearest value of voltages and current matching the actual values of voltage and current and spit out the corresponding switch state. If i have to use the intel hex code which has 6 parts, in which part of the hex-code should i store the pre-determined values of voltages(or currents) in the parallel eeprom. This is all before the ADCs arrive. Of course the resolution of ADC will determined the eeprom's resolution as well,but i need to store the voltages and currents in the eeprom corresponding to each address.
 
 View user's profile Send private message  
Reply with quote Back to top
ka7ehk
PostPosted: Jun 17, 2012 - 06:15 AM
10k+ Postman


Joined: Nov 22, 2002
Posts: 12055
Location: Tangent, OR, USA

For the scheme I outlined to work, you have to assign a contiguous set of address bits to each input vector. That means that each vector will have a value range of 0 to (2**N)-1, where N is the number of bits in that vector. Thus, you would have maximum values like 7 or 15 or 31. 0-30 will easily fit into a 5 bit vector and 0-5 will fit into a 3 bit vector.

As far as your table values, an intel hex file will fill contiguous addresses. You can play some "games" and leave gaps, and so forth, but you are far better off filling with zeros (or something recognizable). Thus, if there are value combinations that you expect never to occur, pad them with dummy values. Then, your table will come out nicely.

Jim

_________________
Jim Wagner
Oregon Research Electronics, Consulting Div.
Tangent, OR, USA

"The only thing standing between us and victory is defeat" P.G.Wodhouse in Wooster & Jeeves series
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 17, 2012 - 07:33 AM
Rookie


Joined: Jun 13, 2012
Posts: 38


ka7ehk wrote:
For the scheme I outlined to work, you have to assign a contiguous set of address bits to each input vector. That means that each vector will have a value range of 0 to (2**N)-1, where N is the number of bits in that vector. Thus, you would have maximum values like 7 or 15 or 31. 0-30 will easily fit into a 5 bit vector and 0-5 will fit into a 3 bit vector.

As far as your table values, an intel hex file will fill contiguous addresses. You can play some "games" and leave gaps, and so forth, but you are far better off filling with zeros (or something recognizable). Thus, if there are value combinations that you expect never to occur, pad them with dummy values. Then, your table will come out nicely.

Jim


Thanks for this very detailed explanation, Mr. Wagner!!
I'm still stuck with one more thing. I looked upto the wikipedia for intel hex code and I couldn't figure out. How to enter data corresponding to each address. I have to fill up those values for voltages and currents inside the chip and I have to also fill out the output switch states for each values of voltages and currents.
How will the hex-code tell the memory chip that what value of voltage corresponds to a particular address and same with the current.
 
 View user's profile Send private message  
Reply with quote Back to top
ka7ehk
PostPosted: Jun 17, 2012 - 04:05 PM
10k+ Postman


Joined: Nov 22, 2002
Posts: 12055
Location: Tangent, OR, USA

The hex file format has an address, several other bytes, and the data for (typically) 8 bytes. The data is for the 8 memory addresses starting at the given address. The programmer converts this data into the signals needed to program the EEPROM.

So, the hex file has many lines, each line is for a block of 8 addresses, You could construct the file by hand though it would be tedious.

Jim

_________________
Jim Wagner
Oregon Research Electronics, Consulting Div.
Tangent, OR, USA

"The only thing standing between us and victory is defeat" P.G.Wodhouse in Wooster & Jeeves series
 
 View user's profile Send private message  
Reply with quote Back to top
jayjay1974
PostPosted: Jun 17, 2012 - 06:20 PM
Raving lunatic


Joined: Oct 30, 2002
Posts: 5721
Location: The Netherlands

There is nothing stopping you from having only one data byte per line instead of standard 16.

That might simplify coding.

Likely the programmer also accepts a raw binary file, maybe that's even simpler.
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 17, 2012 - 11:07 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


ka7ehk wrote:
The hex file format has an address, several other bytes, and the data for (typically) 8 bytes. The data is for the 8 memory addresses starting at the given address. The programmer converts this data into the signals needed to program the EEPROM.

So, the hex file has many lines, each line is for a block of 8 addresses, You could construct the file by hand though it would be tedious.

Jim


I looked that over and over again and I still can't figure this out. Here's the hex format I'm looking at http://en.wikipedia.org/wiki/Intel_HEX#Example

If the data as you're mentioning is the data corresponding to the voltage and current vectors, where's the place for the output of the table. The eeprom needs to be programmed for the output of the memory lookup table as well.
 
 View user's profile Send private message  
Reply with quote Back to top
jayjay1974
PostPosted: Jun 18, 2012 - 12:51 AM
Raving lunatic


Joined: Oct 30, 2002
Posts: 5721
Location: The Netherlands

The address is the combined voltage/current vector, the data is the output state.
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 18, 2012 - 02:49 AM
Rookie


Joined: Jun 13, 2012
Posts: 38


jayjay1974 wrote:
The address is the combined voltage/current vector, the data is the output state.


But then, my look-up table will be meaningless 'cause i need to store a set of voltages and currents at each address and spit out the switch state as the output of the table. Is it not possible with eeprom.
 
 View user's profile Send private message  
Reply with quote Back to top
meslomp
PostPosted: Jun 18, 2012 - 06:19 AM
Raving lunatic


Joined: May 02, 2007
Posts: 3022
Location: Nieuwegein, Netherlands

no it is the other way around.....
each address is a voltage and a current and at that address is the switch state that will be out putted when you select that address.

_________________
1)Datasheet and application notes checked?
2)tutorial forum
3)Newbie start here
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 18, 2012 - 06:39 AM
Rookie


Joined: Jun 13, 2012
Posts: 38


meslomp wrote:
no it is the other way around.....
each address is a voltage and a current and at that address is the switch state that will be out putted when you select that address.


Thank you for some light here. But I am wondering how do i corelate each address with the switch state. I have a set of voltages from 0-30 V and a set of currents from 0-5 amp in a theoretical look-up table wherein, corresponding to each point of voltage and current, there is a theoretically derived switch state. How does the address knows what voltage and current it represents.

thanks!
 
 View user's profile Send private message  
Reply with quote Back to top
larryvc
PostPosted: Jun 18, 2012 - 07:19 AM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

Think of an array of switch states:

Switch_State_Array[1000] = {1, 0 , 0 , 1, 1, 1, 0, ...}

Then store the switch state that correlates to a voltage and current at the offset of [voltage+current] in the Switch_State_Array.

So that:

Switch_State = Switch_State_Array[voltage+current];

Then imagine EEPROM is the array:

Switch_State = EEPROM[voltage+current];

Does that help?

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc


Last edited by larryvc on Jun 19, 2012 - 06:40 AM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 18, 2012 - 07:54 AM
Rookie


Joined: Jun 13, 2012
Posts: 38


Lary, Thank you for your response. I'm still not able to figure out how to store a value for a voltage and current at the address. Here's a small example of what i have in my theoretical stuff that i'm trying to implement. eg. i have a 2-d look up table with voltage on the column vector and current on the row vector. I have switch states corresponding to each voltage and current value on the memory lookup. How do i store this kind of setup on the eeprom. I understand that each address line can be programmed to have specific outputs. just see the table below, how do i store the values of the voltages and currents at each address. the switch states are the output of the table that'll go back to the converter. the real time voltages and currents will come from the converter, hit the lookup table and spit out the switch state as output back to the converter's FET or IGBT to providing switching. this is the control scheme.

V(C)| I(L)
0 | 0.5 1 1.5 2
|
0.5 | 1 0 0 1
|
1 | 1 0 0 1
|
1.5 | 1 0 1 1
|
2 | 1 0 1 0 1
 
 View user's profile Send private message  
Reply with quote Back to top
jayjay1974
PostPosted: Jun 18, 2012 - 08:50 AM
Raving lunatic


Joined: Oct 30, 2002
Posts: 5721
Location: The Netherlands

You DON'T program the current voltage information in the EEPROM. You must devise a mapping from current&voltage information to an address.
 
 View user's profile Send private message  
Reply with quote Back to top
larryvc
PostPosted: Jun 18, 2012 - 09:00 AM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

jayjay1974 wrote:
You DON'T program the current voltage information in the EEPROM. You must devise a mapping from current&voltage information to an address.

And at that mapped address you store/retreive the switch state.

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 18, 2012 - 11:45 AM
Rookie


Joined: Jun 13, 2012
Posts: 38


larryvc wrote:
jayjay1974 wrote:
You DON'T program the current voltage information in the EEPROM. You must devise a mapping from current&voltage information to an address.

And at that mapped address you store/retreive the switch state.


I see what you both are saying, can you give a small example which can give me a way to implement what you're suggesting.

thanks !!!!
 
 View user's profile Send private message  
Reply with quote Back to top
jayjay1974
PostPosted: Jun 18, 2012 - 01:18 PM
Raving lunatic


Joined: Oct 30, 2002
Posts: 5721
Location: The Netherlands

I'm assuming 2 bits for both the ADCs. So 2x2=4 bits=2^4=16 different addresses. You connect the output of the current ADC to A0 and A1, of the voltage ADC to A2 and A3.

address=current+voltage*4

Table:
Code:

address - current - voltage
0 0 0
1 1 0
2 2 0
3 3 0
4 0 1
5 1 1
6 2 1
7 3 1
8 0 2
9 1 2
10 2 2
11 3 2
12 0 3
13 1 3
14 2 3
15 3 3
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 18, 2012 - 02:30 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


jayjay1974 wrote:
I'm assuming 2 bits for both the ADCs. So 2x2=4 bits=2^4=16 different addresses. You connect the output of the current ADC to A0 and A1, of the voltage ADC to A2 and A3.

address=current+voltage*4

Table:
Code:

address - current - voltage
0 0 0
1 1 0
2 2 0
3 3 0
4 0 1
5 1 1
6 2 1
7 3 1
8 0 2
9 1 2
10 2 2
11 3 2
12 0 3
13 1 3
14 2 3
15 3 3


Wow.. That's a very simple explanation. But, I was wondering whether it's possible or not to setup the same thing as in simulation in the memory chip. i.e. Without having knowledge of what's coming from the adc's is it impossible to store the voltage and current vectors inside the memory chip corresponding to the addresses.
Like, in my simulink model, I could easily create a 2-d and 3-d look-up table, i could store a voltage and current vector and I could also populate the table data with switch states for each point.

thanks..
 
 View user's profile Send private message  
Reply with quote Back to top
jayjay1974
PostPosted: Jun 18, 2012 - 02:57 PM
Raving lunatic


Joined: Oct 30, 2002
Posts: 5721
Location: The Netherlands

Therefore you should determine what comes from the ADC; e.g. what is its exact transfer function? An ADC does not generate output in nice engineering units.

I guess your table is now set up with engineering units with a few specific limit points. An EEPROM can't do this, you need to program it with all possible combinations of ADC values. The easiest way is to write a Matlab function that creates an output state for a given voltage and current, then with another function generate all possible combinations. After all, an ADC has a limited, finite number of states (generally between 8 to 16 bits, or 256 to 65536 states). Every extra bit doubles the table size though.

Though I think what you want is impossible. You would need something more elaborate than the EEPROM if you want the table to be sparse. Like a microcontroller Wink

If you have this EEPROM chip programmed, where does it plug into?
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 18, 2012 - 03:04 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


jayjay1974 wrote:
Therefore you should determine what comes from the ADC; e.g. what is its exact transfer function? An ADC does not generate output in nice engineering units.

I guess your table is now set up with engineering units with a few specific limit points. An EEPROM can't do this, you need to program it with all possible combinations of ADC values. The easiest way is to write a Matlab function that creates an output state for a given voltage and current, then with another function generate all possible combinations. After all, an ADC has a limited, finite number of states (generally between 8 to 16 bits, or 256 to 65536 states). Every extra bit doubles the table size though.

Though I think what you want is impossible. You would need something more elaborate than the EEPROM if you want the table to be sparse. Like a microcontroller Wink

If you have this EEPROM chip programmed, where does it plug into?


Once I have this eeprom programmed, it will go back to the IGBT of the converter and will provide the switching to the converter based on the switch state. This will be kind of a digital control for converter. The voltage and current from the converter will hit the look up table and will provide the switching to the converter based on the set up of the look up table.
 
 View user's profile Send private message  
Reply with quote Back to top
jayjay1974
PostPosted: Jun 18, 2012 - 03:14 PM
Raving lunatic


Joined: Oct 30, 2002
Posts: 5721
Location: The Netherlands

But is there an ACTUAL tangible circuit you can touch and feel and admire? Or at least its design and not some preconceptualization sketch in Simulink?

edit: I have the feeling you are trying to do something that's typically done when fleshing out the (minute) details of a design, while you're at the stage where you perform preliminary theoretical, rather abstract simulations where actual design parameters are yet unknown.
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 18, 2012 - 03:22 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


jayjay1974 wrote:
But is there an ACTUAL tangible circuit you can touch and feel and admire? Or at least its design and not some preconceptualization sketch in Simulink?


We have converter boards designed and working in our lab which we have already used for analog control and digital control through microcontrollers. Now we are trying to make them work with digital control without using serial protocol. I have worked only on analog control before and sometimes using DSPACE, but never used digital control like this.

I see what you're saying that it may look impossible right now but that's something we still have to atleast go for it.

So, if I'm using ADC's with 2 bit, for a 3-d look-up table, I'll need 3^(2*2*2) memory addresses for the memory chip right? Is that what you were suggesting earlier?

thanks ??
 
 View user's profile Send private message  
Reply with quote Back to top
jayjay1974
PostPosted: Jun 18, 2012 - 05:51 PM
Raving lunatic


Joined: Oct 30, 2002
Posts: 5721
Location: The Netherlands

2^(total_number_of_adc_bits + additional_state_input_bits)
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 18, 2012 - 06:25 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


If I'm using 3 ADCs of 4 bits each, the total number of adc bits would be 12, right? so, total addresses would be 2^(12), right?
 
 View user's profile Send private message  
Reply with quote Back to top
jayjay1974
PostPosted: Jun 18, 2012 - 06:34 PM
Raving lunatic


Joined: Oct 30, 2002
Posts: 5721
Location: The Netherlands

Right.
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 18, 2012 - 06:46 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


OK. I'll start working on this strategy and will let you know how it goes. But i was wondering is there any way to read what's coming out of the ADCs so that memory mapping can become more efficient. Like, the ADC would scale down the voltage and current signals depending on it's config. If it's possible to read the upper and higher limit of the signals from the output of the ADC before it hits eeprom, I can efficiently do the memory mapping of the eeprom.
 
 View user's profile Send private message  
Reply with quote Back to top
meslomp
PostPosted: Jun 19, 2012 - 06:30 AM
Raving lunatic


Joined: May 02, 2007
Posts: 3022
Location: Nieuwegein, Netherlands

Your ADC can be anywhere between 0 and MAX.
You never know what the next value of the ADC will be.
That is why it is said that you need to make a table for all possible values, so:
ADC conversion voltage 0 ... max
and
ADC conversion Current 0 ... max
this will then be a table with the size of volt_max * current_max
you cannot omit values as they might occur at any given point in time and then would give you a wrong switch state with potentially devastating results.....
Note that when you scale the voltage/current then you will loose accuracy, but will get a smaller table to build.
for instance an 8 bit converter will give 8^2*8^2 = 4096 entries
if you scale down to 4 bits resolution you only have to make 256 entries, but you loose that in accuracy.
If you have a micro controller then you could use that to do an interpolation between the points and gain back some of the lost acuracy.

_________________
1)Datasheet and application notes checked?
2)tutorial forum
3)Newbie start here
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 19, 2012 - 05:27 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


meslomp wrote:
Your ADC can be anywhere between 0 and MAX.
You never know what the next value of the ADC will be.
That is why it is said that you need to make a table for all possible values, so:
ADC conversion voltage 0 ... max
and
ADC conversion Current 0 ... max
this will then be a table with the size of volt_max * current_max
you cannot omit values as they might occur at any given point in time and then would give you a wrong switch state with potentially devastating results.....
Note that when you scale the voltage/current then you will loose accuracy, but will get a smaller table to build.
for instance an 8 bit converter will give 8^2*8^2 = 4096 entries
if you scale down to 4 bits resolution you only have to make 256 entries, but you loose that in accuracy.
If you have a micro controller then you could use that to do an interpolation between the points and gain back some of the lost acuracy.


Thanks a lot !! This is a very precise explanation. I understand what you're saying about the accuracy but the project requirement is such that we have to show an alternative to microcontroller based approach and we have to see what happens. If the EEPROM size doesn't work, we have to use higher sizes of EEPROM and see what happens.

But if we get satisfactory results, I'll put names of all the people in the documentation who have guided here on this forum, with their due permission. I'm so grateful to you all who have shown willingness to make some programming concepts clear for me. And I hope ya'll will continue to help me in case i am stuck somewhere..
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 20, 2012 - 06:28 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


jayjay1974 wrote:
You DON'T program the current voltage information in the EEPROM. You must devise a mapping from current&voltage information to an address.


I'm trying to think of a strategy for mapping the ADCs with the parallel EEPROM.

For eg. if i have AT28c64B parallel eeprom, and I have three ADCs for mapping with the parallel eeprom.

1st dimension of the table: I'm using a 6-bit ADC for a voltage vector.
2nd dimension of the table: Another 6-bit ADC for a current vector.
3rd dimension of the table: And 1-bit ADC (I hope I wouldn't need more than 1-bit) for the current switch state

The output of this look-up table is the next switch state for the converter.

The hex-code that the programmer excepts is mere hex file with linear addresses. Just to make sure that I'm not doing this wrong, can you guide on the memory mapping for the eg. eeprom I have used here.

thanks !!
 
 View user's profile Send private message  
Reply with quote Back to top
Kartman
PostPosted: Jun 21, 2012 - 03:47 AM
Raving lunatic


Joined: Dec 30, 2004
Posts: 8789
Location: Melbourne,Australia

First up you need to assign you adc bits to address lines. Eg:
1st adc A0..A5
2nd adc A6..A11
3rd adc A12

Obviously it helps if we work in binary or hexidecimal numbers.
Lets look at some number sequences:
ADC 2 = 0, ADC1 = 0 address is 0x0000
ADC2 = 0,ADC1 = 1 address is 0x0001
ADC2=0,ADC1 = 0x3f address is 0x003f

ADC2=1,ADC1=0 address is 0x0040
ADC2= 0x3f, ADC1=0 address is 0x0fc0
ADC2=0x3f,ADC1=0x3F address is 0x0fff

work it out using pencil and paper! What is stopping you from figuring this out yourself? Are you afraid to make a mistake? This is easy to test, so you can do some experiments and determine where you are going wrong fairly quickly. As I mentioned early on, I would use an assembler - if you don't have one then download one! There's plenty of free ones.

Another method is to use a program like XVI32 to enter the values then use a program like bin2hex to generate the hex file. Both these are free downloads.
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 21, 2012 - 05:45 AM
Rookie


Joined: Jun 13, 2012
Posts: 38


Kartman wrote:
First up you need to assign you adc bits to address lines. Eg:
1st adc A0..A5
2nd adc A6..A11
3rd adc A12

Obviously it helps if we work in binary or hexidecimal numbers.
Lets look at some number sequences:
ADC 2 = 0, ADC1 = 0 address is 0x0000
ADC2 = 0,ADC1 = 1 address is 0x0001
ADC2=0,ADC1 = 0x3f address is 0x003f

ADC2=1,ADC1=0 address is 0x0040
ADC2= 0x3f, ADC1=0 address is 0x0fc0
ADC2=0x3f,ADC1=0x3F address is 0x0fff

work it out using pencil and paper! What is stopping you from figuring this out yourself? Are you afraid to make a mistake? This is easy to test, so you can do some experiments and determine where you are going wrong fairly quickly. As I mentioned early on, I would use an assembler - if you don't have one then download one! There's plenty of free ones.

Another method is to use a program like XVI32 to enter the values then use a program like bin2hex to generate the hex file. Both these are free downloads.


thank you Mr. Kartman. I'll try this one now. You're right. no need to be afraid of this stuff. Btw, I did try to download one of the assemblers online, but i ran into circles. Do you know a good assembler online that you'd recommend to use?
 
 View user's profile Send private message  
Reply with quote Back to top
meslomp
PostPosted: Jun 21, 2012 - 06:12 AM
Raving lunatic


Joined: May 02, 2007
Posts: 3022
Location: Nieuwegein, Netherlands

don't forget that it might happen that one ADC converter is done while the other converter is still running(might be a single clock cycle, but can happen. you need to make sure the table can handle that OR that first both ADC's are read and when they are finished you update the EEPROM address...

_________________
1)Datasheet and application notes checked?
2)tutorial forum
3)Newbie start here
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 21, 2012 - 07:17 AM
Rookie


Joined: Jun 13, 2012
Posts: 38


meslomp wrote:
don't forget that it might happen that one ADC converter is done while the other converter is still running(might be a single clock cycle, but can happen. you need to make sure the table can handle that OR that first both ADC's are read and when they are finished you update the EEPROM address...


Good point sir ! This is very imp because i might end up using three lookup tables and i'll have to make sure that all ADC's are read. Do you know a practical way of resolving this?
 
 View user's profile Send private message  
Reply with quote Back to top
Kartman
PostPosted: Jun 21, 2012 - 07:32 AM
Raving lunatic


Joined: Dec 30, 2004
Posts: 8789
Location: Melbourne,Australia

I mentioned this very point early on. You'll need to add registers eg 74HC374 in order to latch the data then have some logic to synchronise the adcs.

Why not try my second suggestion of XVI32 etc.
Quote:
Btw, I did try to download one of the assemblers online, but i ran into circles.

Next time tell us what assembler and what problems - do you expect we can read your mind?
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 21, 2012 - 08:15 AM
Rookie


Joined: Jun 13, 2012
Posts: 38


OK. Sorry about that! to be precise, I tried the AVr assembler and the files that were downloaded did not really have installation files.

I was hoping you'd suggest an assembler too.
 
 View user's profile Send private message  
Reply with quote Back to top
MBedder
PostPosted: Jun 21, 2012 - 08:48 AM
Raving lunatic


Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia

Forget about all that gibberish you've spreaded here before and just show us a picture of your system - just what/how many do you have inputs and outputs.

_________________
Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.
 
 View user's profile Send private message  
Reply with quote Back to top
Kartman
PostPosted: Jun 21, 2012 - 08:49 AM
Raving lunatic


Joined: Dec 30, 2004
Posts: 8789
Location: Melbourne,Australia

I rarely use assembler these days so I can't advise much regarding the AVR assemblers. I wouldn't have thought the assembler would need an installation file - just unpack into a directory and run from the command line. If you want something friendlier, download AVRStudio 4 (or 5,6 if you're brave).
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 21, 2012 - 05:06 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


MBedder wrote:
Forget about all that gibberish you've spreaded here before and just show us a picture of your system - just what/how many do you have inputs and outputs.


Well.. if you think it's gibberish, then you shouldn't be here helping people on the community. The communities are meant for people who are seeking to learn something new from the people who are willing to help out. These communities have survived because there are enough generous people still alive in this world.
 
 View user's profile Send private message  
Reply with quote Back to top
MBedder
PostPosted: Jun 21, 2012 - 08:42 PM
Raving lunatic


Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia

ram_kotecha wrote:
if you think it's gibberish, then you shouldn't be here helping people on the community.
I do not think it's gibberish - I do know it is.

And where should or shouldn't I be - it's not your forking business.

_________________
Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 21, 2012 - 09:26 PM
Rookie


Joined: Jun 13, 2012
Posts: 38


MBedder wrote:
ram_kotecha wrote:
if you think it's gibberish, then you shouldn't be here helping people on the community.
I do not think it's gibberish - I do know it is.

And where should or shouldn't I be - it's not your forking business.


Well... if it's gibberish, then good for you. Good luck with your life. I now know a person who knows anything and everything and is smarter than Bill gates and Steve jobs.
 
 View user's profile Send private message  
Reply with quote Back to top
Kartman
PostPosted: Jun 22, 2012 - 05:18 AM
Raving lunatic


Joined: Dec 30, 2004
Posts: 8789
Location: Melbourne,Australia

What mbedder is trying to tell you is that your technique is fraught with problems. If you're having trouble trying to solve the issue of the lookup table then you're really going to struggle with the other issues it will create. This was pointed out early and now we're up to four pages. Coceptually, using a memory device as a lookup table is calid. I've seen it used in old hard disk drives and a reasonably modern inverter welder.
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 22, 2012 - 05:35 AM
Rookie


Joined: Jun 13, 2012
Posts: 38


Kartman wrote:
What mbedder is trying to tell you is that your technique is fraught with problems. If you're having trouble trying to solve the issue of the lookup table then you're really going to struggle with the other issues it will create. This was pointed out early and now we're up to four pages. Coceptually, using a memory device as a lookup table is calid. I've seen it used in old hard disk drives and a reasonably modern inverter welder.


The way he said it meant that he's not interested in helping out with the problem solving but trying to tell people that they are fools and he knows but wouldn't help. Just to come over here and say that your stuff is crap doesn;t make sense. One can simply ignore the post if they are not interested in helping out.

And that's exactly the reason why i came to the community to see if i can get help with the lookup table. And all the questions arose because everyone wanted to understand the problem first and i tried to explain them to the best of my abilities. If you have anything to suggest or ask in detail, feel free. But i read Mr. Mbedder's other post too and he's equally rude to everyone. So, I'm not surprised but i replied to him without being rude coz that's how i was raised.

Now coming back to the point, it has gone upto 4 pages coz different people asked me the same question and i explained me my system in simulations to each one and different people gave me different ideas and i'm really grateful to them.
 
 View user's profile Send private message  
Reply with quote Back to top
ram_kotecha
PostPosted: Jun 23, 2012 - 03:34 AM
Rookie


Joined: Jun 13, 2012
Posts: 38


In case my explanation wasn't clear, i would like to paste a pic of my matlab simulation file for the system. But i couldn't really figure out how to paste a image here. If anyone knows how to paste a picture/image here, please let me know.

thanks..
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits