Compact Flash help

General discussion on mikroC.
Post Reply
Author
Message
bassin
Posts: 5
Joined: 17 Jun 2005 14:38

Compact Flash help

#1 Post by bassin » 24 Jun 2005 13:16

I have a problem whith a compact flash card...
when I use this piece of code

Code: Select all

Cf_Write_Init(590, 1);
 for (i = 0; i < 512; i++)
    Cf_Write_Byte(i+11);
and after use this one

Code: Select all

Lcd_Cmd(Lcd_CLEAR);
 i=0;
 Delay_ms(1000);
 Cf_Read_Init(590, 1);
 for (i = 0; i < 512; i++) {
    size = Cf_Read_Byte();
    LCD_Out(1,1, size);
    Delay_ms(200);
    Lcd_Cmd(Lcd_CLEAR);
    IntToStr(i, txt);
    LCD_Out(2,2, txt);
    Delay_ms(100);
 }
I recive random characters on the LCD.
The pic is a 18f458 and I'm using 10MHz osc whith OSCS_OFF, BOR_OFF, PWRT_OFF, DEBUG_OFF, WDT_OFF, LVP_OFF .
some idea?

gambrose
Posts: 369
Joined: 28 Sep 2004 17:34
Location: uk

#2 Post by gambrose » 24 Jun 2005 17:33

i don't think double posting helps.

Have you tried looking at what is written to the compact flash card to ascertain if it is the compact flash write or the read and display that is at fault.
Graham Ambrose

bassin
Posts: 5
Joined: 17 Jun 2005 14:38

#3 Post by bassin » 24 Jun 2005 18:33

I'm using winhex to check the card, and at sector 590 the data it's the same all time. There is some pull-up resistor, in the hardware scheme only pin 26 it's pulled-up. :?: I don't know what do!!!!

anton
Posts: 807
Joined: 23 Sep 2004 09:16
Location: South-Africa
Contact:

#4 Post by anton » 24 Jun 2005 18:37

Try checking the data at sector 638 in winhex
Another proud user of LV 24-33A Development System and mikroPascal PRO for dsPIC :)
PortA not working? Add CMCON := 7; PortD not working? Add ADCON1 := 6;
To paste code on the forum, please use the [b] Code [/b] button !! ;)

Post Reply

Return to “mikroC General”