Page 1 of 1

mLoader/PPP won't recognise 18F4523, sees an 18F4520

Posted: Tue Jun 10, 2014 4:53 pm
by chipfryer27

After my confusion regarding Flowcode V6 vs EB006 chip compatibilities, I found I had a 18F4523 (I got a job lot of chips) which appears to be compatible with V6, EB006 and also Flowcode v5 but not the HP-488.

I created a test programme in V6 which contained some LEDs, a LCD display and a EB023 interface (simple web server) which simulated as expected and I then attempted to send it to the chip. I had of course set the target to be a 18F4523 before I created the Flowcode and had what I think were suitable configuration settings

It compiled OK but mLoader then came back to inform that the Target chip was different to that specified. It wasn't, so I told it to go ahead anyway. After sending, it informed that Flash Memory could not be verified - may be due to code protect.

However it did run on the EB06 board with the 18F4523 inserted, however it appears to be slower than expected and there is an issue with the Web Server. When looking at it via a browser instead of variable values I got an incomplete page that displayed the variable names instead of the variables (the web page HTML code works fine on other chips I've played with using V5 and the HP-488).

I made some changes to the web server page, saved and compiled to chip. Same messages as before and it seemed to transfer. However the changes I'd made were not visible when viewed via a browser (I'd just reduced the number of variables to be displayed). I tried this a couple of times with the same result and concluded that I was no longer actually sending anything to the chip.

With the EB06 powered and the chip running the initial code, I asked mLoader to erase the chip. It claimed again that the target device was not the same as that specified and again I told it to go ahead. It claimed success but hadn't actually done anything. The board was still running my initial code.

I then ran PPPv3 and using Autodetect it claimed the chip in the EB06 was a 18F4520 and not a 4523 (it isn't). I told it to accept that (4520) and it did. I asked it to erase and it did. I then asked it to send the associated Hex file and it did. The code ran with similar results as before, but now the Web page had changed (still displays variable names instead of variables).

So mLoader and PPP can't see it as a 18F4523 but PPP thinks it is the 4520 and talks to it.

Using mLoader I again asked it to erase the device and this tme it did. I asked it to send the Hex file and after again getting warnings whch I ignored it sent the file. This time it did actually transfer, with the same results as before. Telling mLoader it is a 4520 seems to make it happy as I can then send Hex files without warnings.

Sending the Hex file created in Flowcode V5, with the same HTML in the Web Server, gave me similar slower than expected speeds, but the browser now displays the variables instead of their names.

I see from other posts that there are issues in setting clock speeds with a 18F4523, necessitating the use of extra code, so perhaps I have something similar? Just to play I'd like to set the clock to 20MHz and also 40MHz simply as I have those crystals.

As I'm new to V6 it would appear that it handles HTML differently. If anyone could point me in the direction of where to find those changes I'd appreciate it. I'm not a programmer but Flowcode allows me to learn whilst I play. Using V5 on chips such as 16F877a / 18F1937 and my schizophrenic 18F4523/4520 allows the use of :- %v1% %v2% %v3% to display the values of those variables, but in V6 it displays that actual line (v1 etc are defined as bytes elsewhere).

Lastly, I can assure you that the chip is marked as a 4523 despite what mLoader and PPP think. Although I got them as a job lot off of a friend, he originally got them from Farnell. Has anyone else heard of this or do I really have schizo chips?

Thanks in advance

Re: mLoader/PPP won't recognise 18F4523, sees an 18F4520

Posted: Tue Jun 10, 2014 5:25 pm
by DavidA

This may very well be the case, some of the chip IDs are similar, i dont have the 18F4523 here to test it sadly so i cant confirm it, but we have had problems in the past with Microchip giving chips the same ID. Although this is usually cross-family so its unlikely.

I would probably have to get hold of the chip to confirm this.

Re: mLoader/PPP won't recognise 18F4523, sees an 18F4520

Posted: Tue Jun 10, 2014 7:51 pm
by kersing
Have you checked the WIKI for help with the Webserver component?

Regarding the device recognition, the device ID for the 18F4523 is (binary mode):
0001 0000 1001 RRRR, where RRRR is a revision code.
For the 18F4520 it is:
0001 0000 100R RRRR, where R RRRR is a revision code.
The first 11 bits are the same, the 4523 just uses an additional bit for the identifier. As a result it is hard to distinguish between the two.

David, I guess Microchip has some clever way to do this, perhaps a little digging at their site or a support ticket can reveal the magic?

Re: mLoader/PPP won't recognise 18F4523, sees an 18F4520

Posted: Wed Jun 11, 2014 8:57 am
by chipfryer27

Thanks for the replies. I'll check the wiki but the HTML coding isn't too high an issue as I'm sure whatever changed between V5 and V6 can be resolved quite easily. Funny though that the HTML code in the Web Server component runs fine when compiled etc using V5 but not V6.

Another issue with this chip is when I insert it into a circuit board I constructed, it fails to talk to the Internet Board. The chip works fine in the EB06 with Internet board attached, but when I put it into this other board it hangs.

The board is extremely basic. All ports go directly to connectors, has a 20MHz crystal and a reset button connected to pin 1. This board then connects to the Internet board via a small patch lead (perhaps six inches at most) connecting the associated Port C bits.

This works fine if I use a 16F877a or a 18F1937. If I don't have the schizo 4523 looking for the internet board then it works fine too, talking to a LCD display connected to Port B or the like. To try and faultfind further, I had the chip make certain Ports toggle high/low at strategic places in the programme I used to test. It appears that it hangs at the first call of "CheckSocketActivity". I had previously ran the initialise and create socket macros.

I'm not sure why I see the problem with this 4523 and not the other chips but could it be timing related?


Re: mLoader/PPP won't recognise 18F4523, sees an 18F4520

Posted: Wed Jun 11, 2014 9:29 am
by Benj

I wonder if it could be config settings causing your problems as there are a lot more settings for a 18F compared to the 16F devices you have working. Would it be possible to attach your program or a screen shot of the config settings.

Re: mLoader/PPP won't recognise 18F4523, sees an 18F4520

Posted: Wed Jun 11, 2014 11:36 am
by chipfryer27

If it were configs, why would it run at all on the EB06 and not my circuit board? I apreciate that you have no way of knowing what I have but as mentioned it really is bare bones. All ports direct to connectors with only a crystal (20MHz) and a reset.

Attached is a simple program to toggle a few bits on Port B to indicate progress through the program.

Briefly it:-

Sets a few variables.
Sets Port B to 0
Output 1 on B0
Initialise WebServer
Output 1 on B1
Create ServerSocket
Output 1 on B2
Loops CheckSocketActivity whilst toggling port B3

It halts during the initialisation of the WebServer.

No issue with either a 16f877a or 18F1937 on my board and no issue with the 4523 on the EB06.

I've attached the Flowcode file V5 and it's Hex dump but do note that I set the target as a 4520 as that is how the chip is seen by mLoader/PPP.

Thanks for all help, really appreciated.

Re: mLoader/PPP won't recognise 18F4523, sees an 18F4520

Posted: Wed Jun 11, 2014 12:40 pm
by Benj

Your right your config settings look fine.

Have you continuity tested your board to make sure there are no shorts or breaks in the signals from the chip to the ports? I suppose this would cause the 16F devices to fail too?

Hmm, sounds like a weird one.

What value of capacitance do you have across the voltage rails on your board, wonder if maybe it's a brownout or tolerance related issue?

Re: mLoader/PPP won't recognise 18F4523, sees an 18F4520

Posted: Wed Jun 11, 2014 2:49 pm
by chipfryer27

Continuity is fine. Circuit is not disturbed other than to insert chip and as it works with other chips in....

+5v is derived via 7805 which has hefty tank and smoothing on input, and I have decoupling as close to the chip as possible. As it is on the underside I'm not quite sure of it's value but is certainly as one would expect. Last time I put a scope on the supply there was very, very little ripple or noise present. When capturing test data I had a chart recorder on the supply and on a toggling port to monitor and I didn't see the supply drop dangerously during extreme load of the 7805 (max current). uC continued to work without missing a beat. Of course that was the 877a in the controller board.

Now you have confirmed my code/config is OK, and as the chip works on the EB06 running that code, it is logical to assume that there is some issue with my circuit board. However as the chip only halts when trying to talk to the internet board, is happy to talk to other chips and also LCD it is a bit of a puzzle. Incidentally I have tried using the same Internet board in the EB06 and my circuit but no difference. Exactly the same.

I know that my programmer thinks that the 4523 is a 4520 and goes in the huff if I force it to be a 4523, but are you aware of any major issue I would face telling Flowcode the target is a 4520?

Time now to get a scope out (and charge its battery no doubt) and have a look at the pins. I didn't see anything in the EB023 datasheet regarding timings on pin activity, but using a logic probe I did see activity on one pin of the I2C but not the other and no activity on the interupt. Sorry but offhand I can't remember which pin was active.

I'm guessing that for whatever reason, the internet board isn't wanting to talk.

Thanks for your help, especially confirming my settings. It is appreciated. Once I finish poking around I might just send out the schizo chip for you professionals to have a look at, up close on the couch so to speak.


Re: mLoader/PPP won't recognise 18F4523, sees an 18F4520

Posted: Wed Jun 11, 2014 7:58 pm
by chipfryer27

I've solved my problem regarding the Internet board not being initialised.

As Benj had confirmed my config it really had to be my board, despite it working with the other chips. My connector has a 9-pin din at one end and a 8-pin SIL at the other. Only the three lines are connected. Using jumpers between the SIL and Port C of the EB06 I confirmed continuity from the internet board right through to the schizo 4523. All good. However the board still failed to initialise. This ruled out power issues on my board as the internet board was now powered by the EB06, and had now pretty much confirmed that the issue was in the patch lead.

My lead is about six inches long and comprises of three single wires between pins. At a few points along the way it goes through small sections of heatshrink to keep it neat and tidy. If the wires run parallel to each other for more than an inch or so, then the board fails to initialise. Keep them apart and there is no issue! Guess I'll need to use individually screened wires.

Interesting that some chips are more susceptible to crosstalk than others.

Thanks to all who helped. It is very much appreciated.