# PIC24FJ1024GB610

**URL:** <https://forums.freertos.org/t/pic24fj1024gb610/6666>\
**Category:** Kernel\
**Created:** [July 5, 2017, 8:25pm UTC](https://forums.freertos.org/t/pic24fj1024gb610/6666 "2017-07-05T20:25:20Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 5, 2017, 8:25pm UTC](https://forums.freertos.org/t/pic24fj1024gb610/6666/1 "2017-07-05T20:25:20Z")

</div>

**[tinchogleria](https://sourceforge.net/u/tinchogleria/)** wrote on [Wednesday, July 05, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/#05b6):

Hi! I’m trying to compile freeRTOS demo for the PIC24FJ1024GB610 and the output when I build says:  
lcd.c: In function ‘prvLCDGotoRow’:  
lcd.c:148:3: error: ‘PMADDR’ undeclared (first use in this function)  
And the same for other symbols in the same file lcd.c.  
Any idea of what could I try to solve this issue?  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [July 5, 2017, 8:41pm UTC](https://forums.freertos.org/t/pic24fj1024gb610/6666/2 "2017-07-05T20:41:31Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Wednesday, July 05, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/#05b6/fc05):

Sounds like the constants used in the Microchip libraries have been  
renamed. PMADDR is, I think the address of a register. What are the  
registers called in the libraries the latest Microchip tools come with?

---

<div class="post-metadata">

**Author:** ![tlafleur](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tlafleur](https://forums.freertos.org/u/tlafleur)\
**Post date:** [July 6, 2017, 12:22pm UTC](https://forums.freertos.org/t/pic24fj1024gb610/6666/3 "2017-07-06T12:22:51Z")

</div>

**[tlafleur](https://sourceforge.net/u/tlafleur/)** wrote on [Thursday, July 06, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/#05b6/fc05/72a2):

PMADDR is used on some PIc24/Pic33 as part of an optional peripheral  
“Parallel Master Port” and is not available on all devices… should be  
easy to make the code change to drive the LCD…

Read the data sheet!

See AN1210 from Microchip on using the PMP device…

On Wed, Jul 5, 2017 at 1:41 PM Real Time Engineers ltd. [rtel@users.sf.net](mailto:rtel@users.sf.net)  
wrote:

> ## Sounds like the constants used in the Microchip libraries have been renamed. PMADDR is, I think the address of a register. What are the registers called in the libraries the latest Microchip tools come with?
> 
> ## PIC24FJ1024GB610 [https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/?limit=25#05b6/fc05](https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/?limit=25#05b6/fc05)
> 
> Sent from [sourceforge.net](http://sourceforge.net) because you indicated interest in  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/p/freertos/discussion/382005/)
> 
> To unsubscribe from further messages, please visit  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/auth/subscriptions/)

–

~~\_/) `_/)` \_/) ``` \_/)~~

Tom Lafleur

---

<div class="post-metadata">

**Author:** ![tlafleur](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tlafleur](https://forums.freertos.org/u/tlafleur)\
**Post date:** [July 6, 2017, 12:34pm UTC](https://forums.freertos.org/t/pic24fj1024gb610/6666/4 "2017-07-06T12:34:34Z")

</div>

**[tlafleur](https://sourceforge.net/u/tlafleur/)** wrote on [Thursday, July 06, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/#05b6/fc05/72a2/4392):

Looks like the part your using has as an Enhanced Parallel Master/Slave  
Port, so you will need to understand the difference between the two  
devices… again, read the data sheet for the part used in the FreeRTOS  
demo and the data sheet for the part your using to understand the  
difference …

On Thu, Jul 6, 2017 at 5:22 AM Tom Lafleur [xxxx@xxxx](mailto:xxxx@xxxx) wrote:

> PMADDR is used on some PIc24/Pic33 as part of an optional peripheral  
> “Parallel Master Port” and is not available on all devices… should be  
> easy to make the code change to drive the LCD…
> 
> Read the data sheet!
> 
> See AN1210 from Microchip on using the PMP device…
> 
> On Wed, Jul 5, 2017 at 1:41 PM Real Time Engineers ltd. [xxxx@xxxx](mailto:xxxx@xxxx)  
> wrote:
> 
> > ## Sounds like the constants used in the Microchip libraries have been renamed. PMADDR is, I think the address of a register. What are the registers called in the libraries the latest Microchip tools come with?
> > 
> > ## PIC24FJ1024GB610 [https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/?limit=25#05b6/fc05](https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/?limit=25#05b6/fc05)
> > 
> > Sent from [sourceforge.net](http://sourceforge.net) because you indicated interest in  
> > [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/p/freertos/discussion/382005/)
> > 
> > To unsubscribe from further messages, please visit  
> > [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/auth/subscriptions/)
> 
> –
> 
> ~~\_/) `_/)` \_/) ``` \_/)~~
> 
> Tom Lafleur
> 
> –

~~\_/) `_/)` \_/) ``` \_/)~~

Tom Lafleur

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 6, 2017, 8:51pm UTC](https://forums.freertos.org/t/pic24fj1024gb610/6666/5 "2017-07-06T20:51:13Z")

</div>

**[tinchogleria](https://sourceforge.net/u/tinchogleria/)** wrote on [Thursday, July 06, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/#7552):

I thank you both for your prompt response. Where can I find information about the supposed LCD used by FreeRTOS in this example? I am trying to adapt the lcd.c and lcd.h files of the demo for the Explorer16 / 32 board, but I am missing information about the LCD used in the demo for freeRTOS. I guess this example has been written for an earlier version of the Explorer16 / 32 board. The mia is DM240001-3, and the LCD it has is TSB1G7000-E.  
Thanks again.

---

<div class="post-metadata">

**Author:** ![tlafleur](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tlafleur](https://forums.freertos.org/u/tlafleur)\
**Post date:** [July 6, 2017, 9:03pm UTC](https://forums.freertos.org/t/pic24fj1024gb610/6666/6 "2017-07-06T21:03:17Z")

</div>

**[tlafleur](https://sourceforge.net/u/tlafleur/)** wrote on [Thursday, July 06, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/#7552/9169):

It’s a standard LCD display, look at the source code in microchip sample  
for the explorer 16 board. It’s NOT a FreeRTOS supported file.

On Thu, Jul 6, 2017 at 1:51 PM Martin [tinchogleria@users.sf.net](mailto:tinchogleria@users.sf.net) wrote:

> ## I thank you both for your prompt response. Where can I find information about the supposed LCD used by FreeRTOS in this example? I am trying to adapt the lcd.c and lcd.h files of the demo for the Explorer16 / 32 board, but I am missing information about the LCD used in the demo for freeRTOS. I guess this example has been written for an earlier version of the Explorer16 / 32 board. The mia is DM240001-3, and the LCD it has is TSB1G7000-E. Thanks again.
> 
> ## PIC24FJ1024GB610 [https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/?limit=25#7552](https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/?limit=25#7552)
> 
> Sent from [sourceforge.net](http://sourceforge.net) because you indicated interest in  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/p/freertos/discussion/382005/)
> 
> To unsubscribe from further messages, please visit  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/auth/subscriptions/)

–

~~\_/) `_/)` \_/) ``` \_/)~~

Tom Lafleur

---

<div class="post-metadata">

**Author:** ![tlafleur](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tlafleur](https://forums.freertos.org/u/tlafleur)\
**Post date:** [July 6, 2017, 9:43pm UTC](https://forums.freertos.org/t/pic24fj1024gb610/6666/7 "2017-07-06T21:43:22Z")

</div>

**[tlafleur](https://sourceforge.net/u/tlafleur/)** wrote on [Thursday, July 06, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/#7552/9169/d23d):

data sheet…

> **[TSB1G7000-Ev1.0.pdf](https://ww1.microchip.com/downloads/en/DeviceDoc/TSB1G7000-Ev1.0.pdf)**
>
> 883.50 KB

~~\_/) `_/)` \_/) ``` \_/)~~

Tom Lafleur

On Thu, Jul 6, 2017 at 2:03 PM, lafleur [tlafleur@users.sf.net](mailto:tlafleur@users.sf.net) wrote:

> It’s a standard LCD display, look at the source code in microchip sample  
> for the explorer 16 board. It’s NOT a FreeRTOS supported file.
> 
> On Thu, Jul 6, 2017 at 1:51 PM Martin [tinchogleria@users.sf.net](mailto:tinchogleria@users.sf.net) wrote:
> 
> ## I thank you both for your prompt response. Where can I find information about the supposed LCD used by FreeRTOS in this example? I am trying to adapt the lcd.c and lcd.h files of the demo for the Explorer16 / 32 board, but I am missing information about the LCD used in the demo for freeRTOS. I guess this example has been written for an earlier version of the Explorer16 / 32 board. The mia is DM240001-3, and the LCD it has is TSB1G7000-E. Thanks again.
> 
> ## PIC24FJ1024GB610 [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/p/freertos/discussion/382005/) thread/74d73758/?limit=25#7552
> 
> Sent from [sourceforge.net](http://sourceforge.net) because you indicated interest in  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/p/freertos/discussion/382005/)
> 
> To unsubscribe from further messages, please visit  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/auth/subscriptions/)
> 
> –
> 
> ~~\*/) `*/)` \*/) ``` \*/)~~
> 
> ## Tom Lafleur
> 
> ## PIC24FJ1024GB610 [https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/?limit=25#7552/9169](https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/?limit=25#7552/9169)
> 
> Sent from [sourceforge.net](http://sourceforge.net) because you indicated interest in  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/p/freertos/discussion/382005/)
> 
> To unsubscribe from further messages, please visit  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/auth/subscriptions/)

---

<div class="post-metadata">

**Author:** ![tlafleur](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tlafleur](https://forums.freertos.org/u/tlafleur)\
**Post date:** [July 6, 2017, 9:49pm UTC](https://forums.freertos.org/t/pic24fj1024gb610/6666/8 "2017-07-06T21:49:17Z")

</div>

**[tlafleur](https://sourceforge.net/u/tlafleur/)** wrote on [Thursday, July 06, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/#7552/9169/d23d/23b8):

controller data sheet…’

Novatek NT7603 Controller Datasheet - Crystalfontz  
[https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwiMlv3n0PXUAhVW02MKHYrLDGEQFggpMAA&url=https%3A%2F%2Fwww.crystalfontz.com%2Fcontrollers%2FNovatek%2FNT7603%2F392&usg=AFQjCNGnKHYJ6omi-jJVIjbON2C0Gvwf-Q](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwiMlv3n0PXUAhVW02MKHYrLDGEQFggpMAA&url=https%3A%2F%2Fwww.crystalfontz.com%2Fcontrollers%2FNovatek%2FNT7603%2F392&usg=AFQjCNGnKHYJ6omi-jJVIjbON2C0Gvwf-Q)  
[https://www.crystalfontz.com/controllers/Novatek/NT7603/392](https://www.crystalfontz.com/controllers/Novatek/NT7603/392)

~~\_/) `_/)` \_/) ``` \_/)~~

Tom Lafleur

On Thu, Jul 6, 2017 at 2:43 PM, lafleur [tlafleur@users.sf.net](mailto:tlafleur@users.sf.net) wrote:

> data sheet…
> 
> [http://ww1.microchip.com/downloads/en/DeviceDoc/TSB1G7000-Ev1.0.pdf](http://ww1.microchip.com/downloads/en/DeviceDoc/TSB1G7000-Ev1.0.pdf)
> 
> ~~\*/) `*/)` \*/) ``` \*/)~~
> 
> Tom Lafleur
> 
> On Thu, Jul 6, 2017 at 2:03 PM, lafleur [tlafleur@users.sf.net](mailto:tlafleur@users.sf.net) wrote:
> 
> It’s a standard LCD display, look at the source code in microchip sample  
> for the explorer 16 board. It’s NOT a FreeRTOS supported file.
> 
> On Thu, Jul 6, 2017 at 1:51 PM Martin [tinchogleria@users.sf.net](mailto:tinchogleria@users.sf.net) wrote:
> 
> ## I thank you both for your prompt response. Where can I find information about the supposed LCD used by FreeRTOS in this example? I am trying to adapt the lcd.c and lcd.h files of the demo for the Explorer16 / 32 board, but I am missing information about the LCD used in the demo for freeRTOS. I guess this example has been written for an earlier version of the Explorer16 / 32 board. The mia is DM240001-3, and the LCD it has is TSB1G7000-E. Thanks again.
> 
> ## PIC24FJ1024GB610 [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/p/freertos/discussion/382005/) thread/74d73758/?limit=25#7552
> 
> Sent from [sourceforge.net](http://sourceforge.net) because you indicated interest in  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/p/freertos/discussion/382005/)
> 
> To unsubscribe from further messages, please visit  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/auth/subscriptions/)
> 
> –
> 
> ~~\*/) `*/)` \*/) ``` \*/)~~  
> Tom Lafleur
> 
> ## PIC24FJ1024GB610 [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/p/freertos/discussion/382005/) thread/74d73758/?limit=25#7552/9169
> 
> Sent from [sourceforge.net](http://sourceforge.net) because you indicated interest in  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/p/freertos/discussion/382005/)
> 
> To unsubscribe from further messages, please visit  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/auth/subscriptions/)
> 
> * * *
> 
> ## PIC24FJ1024GB610 [https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/?limit=25#7552/9169/d23d](https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/?limit=25#7552/9169/d23d)
> 
> Sent from [sourceforge.net](http://sourceforge.net) because you indicated interest in  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/p/freertos/discussion/382005/)
> 
> To unsubscribe from further messages, please visit  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/auth/subscriptions/)

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 21, 2017, 7:36pm UTC](https://forums.freertos.org/t/pic24fj1024gb610/6666/9 "2017-07-21T19:36:32Z")

</div>

**[tinchogleria](https://sourceforge.net/u/tinchogleria/)** wrote on [Friday, July 21, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/#4e82):

I want to share how I finally solved this issue.  
I copy from Microchip Explorer16/32 demo application the lcd.c and lcd.h files into the freeRTOS demo application (renaming them to lcd\_driver.c and lcd\_driver.h) and I used the functions from this files from the originals lcd.c and lcd.h freeRTOS files, commenting the implementation and calling the analog functions coded in lcd\_driver.c with a few changes and adaptions.  
If anybody need the code, just ask!

* * *

I’ve solved the lcd issue, but I could not say that the full run of the demo application was successful.  
I had the following issues:  
**1.** _Task#2_ and _Task#4_ failed.  
**2.** The demo app is being reseted frecuently.  
**3.** I’m pretty sure that the clock configuration is wrong, and that is causing problems too.  
To clarify, _Task#2_ is what in the code is called ComTestTasks, two tasks related to the use of UART2 and a 9-way serial port included in the version of Explorer16 on which this port was based. _Task#4_ is what in the code is called BlockTimeTasks, a pair of task wich try to pass some tests related to the use of queues and blocking times.  
About the 3 points above, I have:  
**1.** Task#2 is now disable following [the recomendation](https://sourceforge.net/p/freertos/discussion/382005/thread/3f07e575/) of a member of official support, arguing that tha task is about a port that is no available in the demo board I’m using. [Task#4 is still failing](https://sourceforge.net/p/freertos/discussion/382005/thread/6e192cab/)with some frequency.  
**2.** Based on [other recomendation](https://sourceforge.net/p/freertos/discussion/382005/thread/0a75ef3f/) of a member of official support, I checked Watchdog configuration, and I realized that is turned on. Is not clear if this is how supposed to be or not.  
**3.** I’ve measured with a digital oscilloscope the pulse in the leds that are being blinked by 5 co-routines, and I noted that the relationship between the times measured and the times programmed is 16:1, slower in the measurment. So I try setting the clock speed to 1/16 the actual value, but the result was not good. Everything is REALLY slower now. The specific change I’ve made about this was in _FreeRTOSConfig.h_ file, being the original state:

```auto
#define configCPU_CLOCK_HZ ( ( unsigned long ) 16000000 ) /* Fosc / 2 */

```

And now:

```auto
#define configCPU_CLOCK_HZ ( ( unsigned long ) 1000000 ) /* Fosc / 2 */

```

# My BIG questions are:

**1)** Where are the configurations bits programmed in this demo application sources?  
**2)** Is the watchdog being used or should be disabled?  
**And the most important:**  
**3)** Anyone could run this demo in the current Explorer 16/32 (DM240001-3) having everything working?  
Thanks a lot for reading.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [July 21, 2017, 7:40pm UTC](https://forums.freertos.org/t/pic24fj1024gb610/6666/10 "2017-07-21T19:40:55Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Friday, July 21, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/#4e82/7469):

> _1)_ Where are the configurations bits programmed in this demo  
> application sources?

If they are then you will see the #pragma statements that set the bits  
at the top of main.c. If the statements are not there then the bits are  
being set via settings in the project (accessed and changed from the IDE).

> _2)_ Is the watchdog being used or should be disabled?

The application is not using it at all - not even kicking (resetting)  
it. It needs to be disabled.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 24, 2017, 7:13pm UTC](https://forums.freertos.org/t/pic24fj1024gb610/6666/11 "2017-07-24T19:13:14Z")

</div>

**[tinchogleria](https://sourceforge.net/u/tinchogleria/)** wrote on [Monday, July 24, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/74d73758/#4774):

Thanks for your reply.  
About WDT, it is disabled now. I haven’t watched the system reseting then.  
About configuration bits, is really intriguing for me not see them anywhere in the code.  
I’ve read all documentation about starting guides and it never mentions anything about set the configuration bits.

1. When you set-up the project for the port PIC24, how did you do to set up the configurations bits?
2. Do all demo applications lack a section of code dedicated to the configuration bits?

I’m not sure how should I configure de bits related to the clock configuration.  
3. What clock source should I choose? Where can I find information about this?

I put here the section of the configuration of bits relative to the configuration of the clock in the hope that you can guide me. (Copy-paste from IDE):  
// FOSCSEL  
#pragma config FNOSC = OSCFDIV // Oscillator Source Selection (Oscillator with Frequency Divider)  
#pragma config PLLMODE = DISABLED // PLL Mode Selection (No PLL used; PLLEN bit is not available)  
#pragma config IESO = ON // Two-speed Oscillator Start-up Enable bit (Start up device with FRC, then switch to user-selected oscillator source)

// FOSC  
#pragma config POSCMD = NONE // Primary Oscillator Mode Select bits (Primary Oscillator disabled)  
#pragma config OSCIOFCN = OFF // OSC2 Pin Function bit (OSC2 is clock output)  
#pragma config SOSCSEL = ON // SOSC Power Selection Configuration bits (SOSC is used in crystal (SOSCI/SOSCO) mode)  
#pragma config PLLSS = PLL\_PRI // PLL Secondary Selection Configuration bit (PLL is fed by the Primary oscillator)  
#pragma config IOL1WAY = ON // Peripheral pin select configuration bit (Allow only one reconfiguration)  
#pragma config FCKSM = CSDCMD // Clock Switching Mode bits (Both Clock switching and Fail-safe Clock Monitor are disabled)
