-sorry for my english
im using hidlibrary c#
i have problem configuring the size of the eprom spi in the loop
hid work like this send 64 byte packet receive 64 byte packet
and i have problem receiving all packet together and substract 4 byte from each packet
thats all for the moment
this is the loop for reading eprom
Task t = new Task(async () =>
{
for (i = 0, w = 0; i < bufferF.Length; w++)
{
// bufferF[w++] = 0;
bufferF[w++] = SPI_READ;
bufferF[w++] = 0x3C; // i < mybyt.Length - (DIMBUF - 2) ? DIMBUF - 2 : mybyt. - i;
bufferF[w++] = FLUSH;
for (; k < eeprom.Size +4; k++)
{
HidReport first3 = new HidReport(64, new HidDeviceData(bufferF, HidDeviceData.ReadStatus.Success));
device.Write(bufferF);
device.ReadReport(ReadSpiContent);
}
// bufferU[w] = 0x0;
//if (bufferL[1] == SPI_READ && bufferL[2] < 0xFA)
//{
// for (z = 3; z < bufferL[2] + 3 && z < DIMBUF; z++) memEE[k++] = bufferL[z];
//}
//await device.ReadReportAsync(bufferF.Length);
}
});
t.Start();
for receiving i use tyhis function
public void ReadSpiContent(HidReport SpiContent)
{
byte[] managedArray = new byte[SpiContent.Data.Length];
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
got it working thx anyway , but i have problem receiving full size of eprom, can i modify src of the pic 18fxxx to send all content of eeprom without 0X3C thx
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
plz can you help me to do something :
i need a Case : wehn i send SPIREAD to Pic it read total size of eprom;
because i have problem with hidlibrary ,when i read incoming data from PIC ,my hidlibrary read in the separat function (Hidreport report)and i cant do 2 loop 1 for readind and one for receiving data ; thx
any help WELCOME.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Parallel flash requires a lot of IO lines, so the current hardware would need a port expander of some sort.
I am currently not planning anything like this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I see, you have some port expanders for addresses and direct connection for data.
One thing you should do to make it compatible with the current programmer is using RA3-4-5 instead of RC0-1-2 for the expanders.
Then you also have RC6-7 available. I am pretty sure you need additional control signals in order to read or write parallel memories, like WE, CE, OE etc.
On the software side, an immediate option is to use instructions WRITE_RAM and READ_B/READ_AC in order to access those ports, however for performance reasons it would be better to implement a new WRITE_EXP_PORT that quickly shifts the desired data to the port expanders.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can't read your code from the image.
Anyways, an example of READ_RAM can be found in opgui.c, function IOchanged(GtkWidget widget,GtkWidget window)
....
bufferU[j++]=READ_RAM;
bufferU[j++]=0x0F;
bufferU[j++]=0x80; //PORTA
...
Here you read PORTA at address 0x0F80.
After PacketIO(2) you will find in the return packet:
... READ_RAM, 0x0F, 0x80, [content of PORTA] ...
In the same functions you can find examples of WRITE_RAM as well.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
for(i=0;i<(NUMBER_OF_74595*8);i++) // Clock out bits from the eo array
{
if(bit_test(eo[NUMBER_OF_74595 - 1], 7) == 0)
output_low(EXP_OUT_DO);
else
output_high(EXP_OUT_DO);
the loop go infinite i have tryed all
BYTE buffer[BUFFSIZE]; //64
BYTE readeprom(){
BYTE data2;
int offset;
for (offset = 0; offset < 8;offset++){ //address from 0x00 to 0x07
write_expanded_outputs2 (&offset);
read_expanded_inputs (buffer);
}
data2 = buffer;
return data2;
}
then function to send to pc
usb_put_packet(1, readeprom(), 64, USB_DTS_TOGGLE);
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have no idea of what you are doing.
Is this source is from your porting in C++?
I only know about opcodes sent to the porogrammer.
What does output_high/low do?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
-sorry for my english
im using hidlibrary c#
i have problem configuring the size of the eprom spi in the loop
hid work like this send 64 byte packet receive 64 byte packet
and i have problem receiving all packet together and substract 4 byte from each packet
thats all for the moment
this is the loop for reading eprom
Task t = new Task(async () =>
{
got it working thx anyway , but i have problem receiving full size of eprom, can i modify src of the pic 18fxxx to send all content of eeprom without 0X3C thx
Sorry, I don't understand the context.
Are you re-writing opgui in c#?
What EEPROM?
yes and il make it opensource
im begginning with spi flash
not exactly re-writing or tranlating code, another concept
u are genius with c++
The sources are plain C
openprog 9.1
That version is obsolete, you should look at opgui 10.1
plz can you help me to do something :
i need a Case : wehn i send SPIREAD to Pic it read total size of eprom;
because i have problem with hidlibrary ,when i read incoming data from PIC ,my hidlibrary read in the separat function (Hidreport report)and i cant do 2 loop 1 for readind and one for receiving data ; thx
any help WELCOME.
case SPI_READ:
help to write parallel flash memory
Parallel flash requires a lot of IO lines, so the current hardware would need a port expander of some sort.
I am currently not planning anything like this.
So you have some hardware; what does it look like?
Please post a schematic diagram.
What IO lines are you planning to use?
This is schematic thx
eeprom 27c 29xxx 28xxx dedicated project
thx
in the futur im planning to use 74hc165 for input expander
I see, you have some port expanders for addresses and direct connection for data.
One thing you should do to make it compatible with the current programmer is using RA3-4-5 instead of RC0-1-2 for the expanders.
Then you also have RC6-7 available. I am pretty sure you need additional control signals in order to read or write parallel memories, like WE, CE, OE etc.
On the software side, an immediate option is to use instructions WRITE_RAM and READ_B/READ_AC in order to access those ports, however for performance reasons it would be better to implement a new WRITE_EXP_PORT that quickly shifts the desired data to the port expanders.
This is my test reading 1 byte from address 0xF0, 27c64
Sorry can you tell me more about WRITE_RAM ,you have 1 example
thx
im using CCS thx
I can't read your code from the image.
Anyways, an example of READ_RAM can be found in opgui.c, function IOchanged(GtkWidget widget,GtkWidget window)
....
bufferU[j++]=READ_RAM;
bufferU[j++]=0x0F;
bufferU[j++]=0x80; //PORTA
...
Here you read PORTA at address 0x0F80.
After PacketIO(2) you will find in the return packet:
... READ_RAM, 0x0F, 0x80, [content of PORTA] ...
In the same functions you can find examples of WRITE_RAM as well.
thx
but now i have problem reading 8 or 16 byte in the loop
this is my function for reading from 74165 parallel serial
void write_expanded_outputs(unsigned int8 *eo)
{
unsigned int8 i;
output_low(EXP_OUT_CLOCK);
#if EXP_OUT_RCLK != EXP_OUT_CLOCK
output_low(EXP_OUT_RCLK);
#endif
output_low(EXP_OUT_ENABLE);
for(i=0;i<(NUMBER_OF_74595*8);i++) // Clock out bits from the eo array
{
if(bit_test(eo[NUMBER_OF_74595 - 1], 7) == 0)
output_low(EXP_OUT_DO);
else
output_high(EXP_OUT_DO);
}
#if EXP_OUT_RCLK == EXP_OUT_CLOCK
output_high(EXP_OUT_CLOCK);
output_low(EXP_OUT_CLOCK);
#endif
output_high(EXP_OUT_ENABLE);
output_low(EXP_OUT_ENABLE);
}
the loop go infinite i have tryed all
BYTE buffer[BUFFSIZE]; //64
BYTE readeprom(){
BYTE data2;
int offset;
for (offset = 0; offset < 8;offset++){ //address from 0x00 to 0x07
write_expanded_outputs2 (&offset);
read_expanded_inputs (buffer);
}
data2 = buffer;
return data2;
}
then function to send to pc
usb_put_packet(1, readeprom(), 64, USB_DTS_TOGGLE);
I have no idea of what you are doing.
Is this source is from your porting in C++?
I only know about opcodes sent to the porogrammer.
What does output_high/low do?