It is currently 26 May 2018 03:26

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: 16 May 2018 08:03 
Offline

Joined: 28 Oct 2007 03:16
Posts: 92
Location: West Australia
My test rig comprises:
PIC18F47K42
Mikro C Pro for PIC 7.2.0
And I a trying to use the library function Printout() - it does not work
I have put in a 'UART1_Remappable_Write' and 'UART1_Remappable_Write_Text'
to test - and these work OK.
////////////////////////////////////////////////////////////////////////////////
// Project:         PIC18F47K42_0limex_Template                               
// File:            PIC18F47K42_0limex_Template.c                             
// Function:       Template for Olimex board with PIC18F47K42 MCU           
// MCU:             PIC18F47K42                                               
// Board:           Olimex PIC40                                             
// Power            5V. PIC18F47K42 will work on 2.3V to 5.5V                 
// Compiler:       mikroC PRO for PIC version 7.2.0                         
// Programmer:  ICD3 with MCLR and  PGC/RB6 PGD/RB7                       
// Author:          WVL                                                       
// Date:             15 May 2018                                               
////////////////////////////////////////////////////////////////////////////////

void main() {
    unsigned short my_string[]="My string";
    // Init MCU
    ANSELA = 0;             // PORTA is digital 1 to 8
    ANSELB = 0;             // PORTB is digital 1 to 8
    ANSELC = 0;             // PORTC is digital 1 to 8
    ANSELD = 0;             // PORTD is digital 1 to 8
    ANSELE = 0;             // PORTE is digital 0 to 2 only
    // Periperal Pin Select
    Unlock_IoLock();
    PPS_Mapping_NoLock(_RC2, _OUTPUT, _TX1PPS);
    Lock_IoLock();
    UART1_Remappable_Init(9600);

    // Init ports and pins
    TRISC2_bit = 0;         // output for U1Tx

    while(1){
        // Test Printout function
        delay_ms(1000);
        UART1_Remappable_Write(65);                        // 65 is 'A' - works OK
        UART1_Remappable_Write_Text(my_string);     //           - works OK
        Printout(UART1_Remappable_Write,"This is a test\r\n");  // Fails?????
        UART1_Remappable_Write(13);                       // 13 is \r  - works OK
        UART1_Remappable_Write(10);                       // 10 is \n  - works OK
    }
}

The line with Printout() produces endless gibberish.
Any advice please?

Regards Bill Legge
In Australia


Top
 Profile  
 
PostPosted: 16 May 2018 11:46 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4916
The only possible advice is to wait till mE fully prepares the compiler for K42 processors. For the moment even some basic things like placement of SFRs access bank are not implemented correctly.

_________________
Replacement libraries for mP PRO and PIC18 processors, mP PRO tips & trics


Top
 Profile  
 
PostPosted: 16 May 2018 16:26 
Offline

Joined: 21 Jun 2011 15:40
Posts: 50
janni wrote:
For the moment even some basic things like placement of SFRs access bank are not implemented correctly.

:shock:


Top
 Profile  
 
PostPosted: 17 May 2018 00:26 
Offline

Joined: 28 Oct 2007 03:16
Posts: 92
Location: West Australia
If this is the problem - faults in the compiler?
Then could one of the moderators please confirm as soon as possible?

I have just started a small project using 5 Olimex PIC40 boards with the PIC18F47K42
as the MCU. The MCUs only cost a few dollars and I am able to change them to any
other 40P pin DIP PIC18 without too much trouble.

I do not want to waste my time fighting with a PIC18F47K42 is the MikroE compiler is 'early days'
and buggy?

Some urgent advice please:
1. Is the compiler a bit buggy with the PIC18FK47K42?
I can do the project without the Printout() function but generally expect most to work OK?
2. Some advice on selecting a different 40 pin 5V PIC18 to replace it - PPS would be nice but not essential.

Regards Bill Legge
In Australia


Top
 Profile  
 
PostPosted: 17 May 2018 01:33 
Offline

Joined: 07 Mar 2007 14:36
Posts: 394
For question 1 my oppinion is that you can, when using 7.2.0, not expect any kind of project to run in an expected way using the K42 family which is too bad since that family is a huge leap in RAM memory. I have tried for weeks but in the end had to abandon that PIC for the moment.. it just does not work..

I have 2 projects that have PCBs already made and just waiting to get a working compiler released ... but I have no idea when that will happen.


Top
 Profile  
 
PostPosted: 17 May 2018 02:21 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4916
Bill Legge wrote:
If this is the problem - faults in the compiler?
Then could one of the moderators please confirm as soon as possible?
If you need official confirmation, see here, for example.

Quote:
1. Is the compiler a bit buggy with the PIC18FK47K42?
I can do the project without the Printout() function but generally expect most to work OK?
Like jumper already stated, there's little chance for that.
Quote:
2. Some advice on selecting a different 40 pin 5V PIC18 to replace it - PPS would be nice but not essential.
There isn't one comprising same advanced features but at least a processor from K22 or K40 family will work with mC (K40 processors, like 18F47K40, have PPS).

_________________
Replacement libraries for mP PRO and PIC18 processors, mP PRO tips & trics


Top
 Profile  
 
PostPosted: 17 May 2018 03:59 
Offline

Joined: 28 Oct 2007 03:16
Posts: 92
Location: West Australia
I'm after some MCUs for a project. Must be:

1. 40 pin DIP format.
2. 8 bit.
3. Stable and proven performance with the Mikro 8bit C complier - unlike the PIC1847K42!

After quire a bit of digging round there are two MCUs that I like:

PIC18F4550 but it's only 5.5V supply and I'd like about 3.3V to 5.5V
PIC18F45K50 2.3 to 5.5V
PIC18F46K22 2.3V to 5.5V

The three MCUs listed above are all supported by the Mikro compiler.
Anyone with usage experience that can confirm they are OK and bug free?

Regards Bill Legge
In Australia


Top
 Profile  
 
PostPosted: 17 May 2018 15:54 
Offline
mikroElektronika team
User avatar

Joined: 25 Jan 2008 09:56
Posts: 9785
Hi,

All three of the mentioned MCUs work OK, I didn't experience any issues.
I have been using 18F4550 and 18F46K22 many years without any problems.

Regards,
Filip.


Top
 Profile  
 
PostPosted: 17 May 2018 23:40 
Offline

Joined: 28 Oct 2007 03:16
Posts: 92
Location: West Australia
Filip,
Thanks for your advice - I've ordered both the PIC18F4550 and PIC18F46K22 and will give them a go.
I did not realise that the newer PICF47K42 was a problem child!

Regards Bill Legge
In Australia


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: