PDA

View Full Version : 18F87J50 message question



Christopher4187
- 3rd March 2013, 05:45
Can someone give me the cliff notes version of what this means when I compile my program:


SFRs REFOCON, ODCON1, ODCON2, ODCON3, PADCFG1, MEMCON, ANCON1,
ANCON0, and CVRCON should be accessed in alternate memory space
with names REFOCON_ALT, ODCON1_ALT, ODCON2_ALT, ODCON3_ALT,
PADCFG1_ALT, MEMCON_ALT, ANCON1_ALT, ANCON0_ALT, and CVRCON_ALT.

Do I need to rename some things in my code? It's just a message but not sure to what extent something won't work later on down the road when I start adding lots of code.

HenrikOlsson
- 3rd March 2013, 07:06
Hi,
From the datasheet, section 5.3.5.1:

In several locations in the SFR bank, a single address is used to access two different hardware registers. In these cases, a “legacy” register of the standard PIC18 SFR set (such as OSCCON, T1CON, etc.) shares its address with an alternate register. These alternate registers are associated with enhanced configuration options for peripherals, or with new device features not included in the standard PIC18 SFR map. A complete list of shared register addresses and the registers associated with them is provided in Table 5-4.

My guess is that PBP handles this sharing/multiplexing of SFR adresses for you as long you use the _ALT designator when accessing the SFRs mentionend in the warning - but that's just a guess. If you're not actually using any of the SFRs mentioned in the warning there's obviously nothing to worry about.

/Henrik.

Christopher4187
- 3rd March 2013, 13:32
Thanks for the reply Henrik. These aren't warnings, they're messages. The program runs fine, with the exception I can't get it to enumerate via USB, but it may be due to some other settings I have to change.

pedja089
- 3rd March 2013, 17:08
Maybe this will help you:
http://www.picbasic.co.uk/forum/showthread.php?t=15322
And here is example that worked for me with 8MHz crystal.
http://www.picbasic.co.uk/forum/showthread.php?t=15322&page=2&p=106812#post106812
And I use this for shared sfr:

@ Bsf WDTCON,ADSHR; Enable write/read to the shared SFR
ANCON0_ALT =255
ANCON1_ALT =%11011111
@ Bcf WDTCON,ADSHR ; Disable write/read to the shared SFR

Christopher4187
- 4th March 2013, 00:30
@ Pedja - Thanks. Your program worked just fine. My PBP portion of the code works fine but I can't get it to enumerate. It won't even make the sound like it tried. When a USB device won't enumerate, what is the most common problem?

pedja089
- 4th March 2013, 01:34
I don't know... It could be any thing...
Did you try to use DT HID?

Christopher4187
- 4th March 2013, 02:04
I don't know... It could be any thing...
Did you try to use DT HID?You mean to write my code? No. I used it to verify my code is an issue.

pedja089
- 4th March 2013, 02:27
Then try it :)

Christopher4187
- 4th March 2013, 02:41
I did before. If there was an error, VB would freeze and the program would close. Do you have that problem?

pedja089
- 4th March 2013, 15:54
I think that is same for pc app if you are using DT HID, or something else.
Probably you have bug in your vb6 app.
You have my app and code, try it... And from that buildup your code on both side.

Christopher4187
- 4th March 2013, 16:46
I have four other VB6 programs that I made with the same version and they don't freeze up like this. When you are are programming and testing the VB6 software, what happens if you hit play and then about 5 seconds later hit stop? Does it stop and allow you to edit or will it freeze and crash?

pedja089
- 4th March 2013, 16:58
I don't have board right now to try it...
I think it freezes, but that doesn't have anything with DT HID.