PIC24FV32KA304 Seemed to be 3 founded bugs

A forums to allow bugs and problems with Flowcode v6 to be reported and resolved.

Moderator: Benj

Jörg Güldner
Posts: 71
Joined: Wed Jun 22, 2011 3:32 pm
Has thanked: 16 times
Been thanked: 5 times
Contact:

PIC24FV32KA304 Seemed to be 3 founded bugs

Postby Jörg Güldner » Mon Oct 03, 2016 7:43 pm

Hello Benj,
my topic was already written to

viewtopic.php?f=54&t=18079

but now I found now a third point, who is not running. Below are all 3 points described again:

CPU = PIC24FV32KA304

1.) Sometimes a additional signal on the port!
External clock signals are counted with timer4. The interrupt of timer4 toggles a bit and write it to a pin
on the port. That works! A additional write to a other pin on the same port in a loop makes confusion. The
timer4 gets from writing to the port sometimes a additional signal??? Please have a look to the attachments to
the topic address. In the program I use A10 for the output. If I replace the output-box A10 and place a
c-Icon with "PORTA |= (1 << 10);" or "PORTA &= ~(1 << 10);" all is running well ?!?!?!?!?


2.) I2C b8/b9
a.) Channel 1 hardware 100KHz --> Initialize, Send byte transaction = no signals coming out !!!
b.) Channel 1 software 100KHz --> Initialize, Send byte transaction = no signals coming out !!!
c.) Channel 1 software 100KHz --> Initialize with my own software, Send byte transaction = Data signals are
coming, no clock !!!
d.) My own software 100KHz --> Initialize with by my own software, Send with own software = Data and clock
signals are coming.


3.) timer4 and adc (File in the attachment)
timer4 is clocked internal and the interrupt toggles an output. Thats running.
Placing an adc-trimmer and set to do a average 5 times with 50us as int stops the
toggle output and it look like an input in this moment. After setting the adc to
"read as int" the output toggles again.


Can you have a further look to them?


Best regards
Jorg
Attachments
adc & Timer4_PIC24FV32KA304_V6.fcfx
(16.68 KiB) Downloaded 101 times

User avatar
Benj
Matrix Staff
Posts: 14247
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4370 times
Been thanked: 4104 times
Contact:

Re: PIC24FV32KA304 Seemed to be 3 founded bugs

Postby Benj » Tue Oct 04, 2016 12:00 pm

Hi Jorg,

1.) Sometimes a additional signal on the port!


The output icon sets the TRIS and PORT registers, maybe it is the TRIS instruction that is somehow causing the extra timer clock. As you have a C workaround this sounds like a good solution for now but it would be nice to know what is causing this.

2.) I2C b8/b9


This seems strange, I wonder if pins B8 and B9 are responsible for anything else by default on this device? I will investigate this for you. Strange that the Software channel is not working but your own code is. Does your own code use I/O icons or C code? Could you provide an example of your working code?

3.) timer4 and adc (File in the attachment)


I'll also investigate this for you, the read average should certainly not be effecting your interrupts or I/O states on other pins.

User avatar
Benj
Matrix Staff
Posts: 14247
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4370 times
Been thanked: 4104 times
Contact:

Re: PIC24FV32KA304 Seemed to be 3 founded bugs

Postby Benj » Tue Oct 04, 2016 12:08 pm

I've just checked the chip's errata document but nothing is jumping out at me as being the cause of the issues.


2.) I2C b8/b9


The hardware pins SCL1/SDA1 do have an alt setting which is controlled by the configuration settings. However in your attached program the setting is correctly set to use the default pins and the value generated matches up with the datasheet.

Jörg Güldner
Posts: 71
Joined: Wed Jun 22, 2011 3:32 pm
Has thanked: 16 times
Been thanked: 5 times
Contact:

Re: PIC24FV32KA304 Seemed to be 3 founded bugs

Postby Jörg Güldner » Wed Oct 05, 2016 6:32 am

Hello Benj,
with I2C is very difficult. Yesterday I´ve only 1 hour time to built back my software. What happens during buliding back is, that if I write to SPI the I2C is dead. When I disable writing to SPI, I2C is running.
Can it happens that the SPI-component changes the routing way of the I2C. Pin b8/9 were in this situation low and high and no voltage between the supply. Means, that the pins are set to digital.
In my software I use 2x uart, 2x spi and 1x I2C. In conjunction of this components happens something. So if you found nothing in advanced, I will go on searching in the next weeks.

The other points are more importend for me.


Best regards

Jorg