18F46K20 PIC in Oshonsoft SYMBOLS

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Here're the template files for the 18F46K20 using absolute Assembly ("TEMP"). For relocatable code, you want the "TEMPO" file.

If you want a feeling for PIC Assembly, I suggest starting with anything "lower" than 18Fxxxxx. PIC 16F1829 or 12F1840 are popular, and for going way back to nature, the 12F509. That is just for a feeling; not a suggestion to switch from the 18F series. The instruction sets of those chips are simpler, and then when you go back to the 18F series, the added instructions will not be so imposing.
Hi J,
Appreciate your abilities. While I carry on in BASIC and accept mine, with envy.

I'm adding a compass module into a (for me) difficult program, and I've made very little progress today, even in BASIC.
C.
 

jpanhalt

Joined Jan 18, 2008
11,087
Which module are you using? (sorry if mentioned above) I have experience with the Bosch BMC156, MPU9250, and AK8963. The MPU9250 (Invensense) is more difficult in that it uses the AK8963 along with its own accelerometer. That requires specific steps (and a second serial protocol as I recall) to address the registers in the AK8963 that have similar location names, but different functions than in the "mother" chip. Bosch isn't bad, but you need to be aware it enters sleep as default. You have to keep waking it.

The AK8963 was the easiest for me to get working and gave greater resolution than the Bosch. I used the MikroElectronics backpack, as all three chips are hard to solder.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Which module are you using? (sorry if mentioned above) I have experience with the Bosch BMC156, MPU9250, and AK8963. The MPU9250 (Invensense) is more difficult in that it uses the AK8963 along with its own accelerometer. That requires specific steps (and a second serial protocol as I recall) to address the registers in the AK8963 that have similar location names, but different functions than in the "mother" chip. Bosch isn't bad, but you need to be aware it enters sleep as default. You have to keep waking it.

The AK8963 was the easiest for me to get working and gave greater resolution than the Bosch. I used the MikroElectronics backpack, as all three chips are hard to solder.
Hi J,
Just the person to talk to:)
Here's a link to the thread, see post #230
C
 

jpanhalt

Joined Jan 18, 2008
11,087
I will have a look later -- have to get some heavy mowing (weeds = 3 feet) in a back field done before it rains. I think I had a different version of the breakout board. Of course, any code I had was in Assembly.
 

jpanhalt

Joined Jan 18, 2008
11,087
Hi C,

Here is a link to a short video of the AK8963 working: https://forum.allaboutcircuits.com/threads/ecompass-short-magnetometer-review.129961/#post-1067505

I have also attached the rough code in Assembly. By rough, I mean really rough. I was working with all three magnetometers mentioned, mostly the BMC and AK8963 ones, and commented out a lot, but I tried to remove some of those sections to remove clutter . Did single reads and 16 reads with averaging. I think the 16-read code is what was used for the video. Interface was SPI.

To get proper formatting, you may need to open in MPLab. I only use version 8.92 so far.

John
 

Attachments

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Hi C,

Here is a link to a short video of the AK8963 working: https://forum.allaboutcircuits.com/threads/ecompass-short-magnetometer-review.129961/#post-1067505

I have also attached the rough code in Assembly. By rough, I mean really rough. I was working with all three magnetometers mentioned, mostly the BMC and AK8963 ones, and commented out a lot, but I tried to remove some of those sections to remove clutter . Did single reads and 16 reads with averaging. I think the 16-read code is what was used for the video. Interface was SPI.

To get proper formatting, you may need to open in MPLab. I only use version 8.92 so far.

John
Hi J,
Thanks for that, it will take me a while to read and follow it though.
C.
 
Top