jjonas Posted April 8, 2014 Report Posted April 8, 2014 Hi, I have an 18F4685 chip (it says PIC18F4685 I/P on it) which I'd like to program with the MIOS bootloader. (I figured this is one of the places where it makes sense to post this.) I'm using Elnec SmartProg2 programmer which supports the chip, and according to the Elnec GUI programming was successful. However, MIOS Studio is unable to communicate with the chip. It's possible that the only problem is with device ID, but I've tried ID 0-20 and 120-127, and don't see what the logic I should use to try any of the ones in between would be... I've tried programming with ID1-ID8 as 00 (instead of FF, the default), but that didn't help. I'm sure my connections are correct, I've tested them with a chip I've bought from SmashTV, and communication works fine. Here's a link to a screenshot of Elnec GUI's default settings screen, any advice on the correct settings..? https://www.flickr.com/photos/68202862@N03/13710200005/ These are the default settings (minus the tick in the 'User program memory and ID locations)' box). I've tried setting ID1-ID8 as 00 (plus ticking all of the 'Programming parameters' boxes), but while attempts have succeeded in terms of Elnec output ("Programming device OK"), MIOS Studio is not able to communicate with the chip. Is there something that can be done with these Elnec settings, or should I use TEST SW2 from the midi debug guide (at the end of the page)? Or something else..? Quote
freddy Posted April 8, 2014 Report Posted April 8, 2014 Jjonas, I do have the Elnec programmer as well (I think even version 2, definitely the LPT one, not USB) and I do remember the oscillator settings needed to be changed, not sure about the actual values though. It was definitely referring to XTAL settings. Apparently, the SmartProg is much too smart and offers way too many configuration options compared to other programmers ;-) Not sure if I have a 4685 lying arond to test, if I do find one I can test the config bits if you don't succeed, just let me know. Quote
jjonas Posted April 9, 2014 Author Report Posted April 9, 2014 Hi, thanks for the reply! SmartProg2 GUI offers the following oscillator options, any idea which one of them is the correct one? Oscillator [FOSC3:FOSC0]: 0000 = LP 0001 = XT 0010 = HS 0011 = EXT RC-CLKOUT on RA6 0100 = EC-CLKOUT on RA6 0101 = EC-Port on RA6 0110 = HS-PLL enabled freq=4xFosc1 0111 = EXT RC-Port on RA6 1000 = INT RC-Port on RA6, Port on RA7 1001 = INT RC-CLKOUT on RA6, Port on RA7 101x = EXT RC-CLKOUT on RA6 11xx = EXT RC-CLKOUT on RA6 Quote
freddy Posted April 9, 2014 Report Posted April 9, 2014 Jjonas, I'd go for XT first. Give it a try, no problem erasing the chip and try another option if it doesn't work. Cheers, freddy Quote
jjonas Posted April 9, 2014 Author Report Posted April 9, 2014 Hi, I tried them all, programming was successful every time, but MIOS Studio was not able to communicate with the chip (I tried with device ID 00). There were a few differences though: with "HS" my PSU (with a 3-number display: 0,00) drew 10mA, with "HS-PLL enabled freq=4xFosc1" it was 30mA, and with "INT RC-CLKOUT on RA6, Port on RA7" it was 10mA. With all the other options the PSU didn't appear to draw any current. (The functioning SmashTV chip draws 30mA, FWIW.) Regarding the image link I posted above, the parameters I used to try different oscillator configurations are as shown there, except for these: - Section "Programming parameters", all boxes ticked. [x] User Program memory and ID locations [x] Data EEPROM memory [x] Configuration bits - Section "ID Location", all values 00, plus box ticked [x] Ignore Microchip recommendation to let most Significant nibble on each ID be Fh. - Section "Configuration bits": MCLRE = 0: RE3 pin enabled, MCLR pin disabled. (I changed this because what I take to be the equivalent tick box in the PICkit2 GUI programming guide was also unticked.) I erased the chip every time before programming it with other settings. After trying all the oscillator options, I also programmed it without configuration bits (with just "[x] User Program memory and ID locations"), but to no avail. Quote
freddy Posted April 9, 2014 Report Posted April 9, 2014 jjonas, unfortunately I found that I have no 18F4685 lying around to test the settings for you. I do have some other chips but these settings are chip-specific so "similiar" doesn't really help. Also, I just found that my programmer is an even older one - SmartProg so I'm afraid I won't be much help for you, sorry :sad: Quote
TK. Posted April 9, 2014 Report Posted April 9, 2014 Based on your screenshot: https://www.flickr.com/photos/68202862@N03/13710200005/ Change: 0110 = HS-PLL enabled freq=4xFosc1 Disable LVP Disable PORTB = analog input All ID bytes have to be programmed with 00 Best Regards, Thorsten. Quote
smashtv Posted April 9, 2014 Report Posted April 9, 2014 Hi jjonas, Does reading in the chip I sent change/show the configuration on the Elnec software? Best regards Tim Quote
jjonas Posted April 10, 2014 Author Report Posted April 10, 2014 Hi, thanks for all the replies, I can now report success! I followed TK's advice, but in addition to that (when comparing to the screenshot I originally provided) I still needed to tick the boxes for "Programming parameters [x] Configuration bits" and "ID Locations [x] Ignore Microchip recommendation to let most Significant nibble on each ID be Fh" in order to make it work. As regards Tim's advice, reading the SmashTV chip didn't affect the programming configuration settings, but programming the blank chip with the stuff read from the SmashTV chip with the correct settings worked as well. I also tried changing the ID8 to 01 to check whether MIOS Studio is able to communicate with it using device ID 01, and it worked too. I took a screenshot of the correct settings and was going to upload here it for future reference, but I'm now at work, and the image was too big (<2Mb) for upload, so I'll upload it later when I get home and have scaled it down. Quote
jjonas Posted April 11, 2014 Author Report Posted April 11, 2014 Here are the settings with which I managed to program the bootloader onto the chip: Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.