Oi
Preciso de mais uma ajuda, agora é com o dspic30f4013, uso a versão 7 para tentar programar o mesmo, comecei com fazer o led piscar num intervalo de tempo de um segundo, utilizando um oscilador externo de 12mhz e configurado para HS/2W/PLL4x, compila normalmente e sem erros, mas o difícil é que não consigo sequer acender o led, na simulação funciona tudo normalmente.
É a primeira vez que programo esse micro processador, comprei via aliexpress um kit com 10 unidades, já troquei 3 pensando que havia queimado.
Nunca apanhei tanto para acender um led.
Por favor me explica o que estou fazendo de errado.
Dspic30f4013
Moderator: Benj
Re: Dspic30f4013
Good evening everyone
I solved my problem with 30f4013, believe me soi pickit3 was doing something wrong, maybe not writing the .hex correctly.
I solved this problem but I waited next, added an RS232 port, and enabled rxINIT1, the program goes into infinite loop, as would be receiving data in RX, already disconnected the RX TX port, but the problem is only solved when I disable rxINIT1. Has anyone had a similar problem?
I solved my problem with 30f4013, believe me soi pickit3 was doing something wrong, maybe not writing the .hex correctly.
I solved this problem but I waited next, added an RS232 port, and enabled rxINIT1, the program goes into infinite loop, as would be receiving data in RX, already disconnected the RX TX port, but the problem is only solved when I disable rxINIT1. Has anyone had a similar problem?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Dspic30f4013
Hello,
Can we see your program to make sure that's not doing something strange in the interrupt and causing the lockup?
Can we see your program to make sure that's not doing something strange in the interrupt and causing the lockup?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Dspic30f4013
Hello benj
Thanks for answering,
In the previous post I complained about RXINIT that was supposed to be in constant loop, but I solved what I imagined was a problem creating a new project, I didn't find what I was wrong but now RXINIT is ok. Now I'm having trouble receiving a string, in 18f works perfectly, I changed to input a byte array to convert to a string, but also can not display in the display, the simulation is perfect. When working with receive string, in the end I get character "0" identifying the end of the receive string to leave the receive loop, but I also do not receive this character to the end of the array, put a led to identify when it enters the routine of RX, for TX everything is normal in send the string.
Thanks for answering,
In the previous post I complained about RXINIT that was supposed to be in constant loop, but I solved what I imagined was a problem creating a new project, I didn't find what I was wrong but now RXINIT is ok. Now I'm having trouble receiving a string, in 18f works perfectly, I changed to input a byte array to convert to a string, but also can not display in the display, the simulation is perfect. When working with receive string, in the end I get character "0" identifying the end of the receive string to leave the receive loop, but I also do not receive this character to the end of the array, put a led to identify when it enters the routine of RX, for TX everything is normal in send the string.
- Attachments
-
- Receive string from TX
- Receive tx.JPG (46.01 KiB) Viewed 8329 times
-
- Does not print string
- 20190811_114434.jpg (68.8 KiB) Viewed 8329 times
-
- Flowcode1.fcfx
- (17.46 KiB) Downloaded 279 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Dspic30f4013
Hello,
You're doing quite a lot in your interrupt macro. Ideally this should just pull in a single received byte and add this to a buffer to be processed later.
Here's how I might do it, note the sender would have to add a "\n" carriage return to the end of each section of data.
You're doing quite a lot in your interrupt macro. Ideally this should just pull in a single received byte and add this to a buffer to be processed later.
Here's how I might do it, note the sender would have to add a "\n" carriage return to the end of each section of data.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Dspic30f4013
Good night Benj
I used your program to test my pic, even adding "\ n" at the end of each string sent to pic just printed as attachment.
I also changed return type to 16bit RS232 module, printed "yx" and send the string "test"
I used your program to test my pic, even adding "\ n" at the end of each string sent to pic just printed as attachment.
I also changed return type to 16bit RS232 module, printed "yx" and send the string "test"
- Attachments
-
- 20190812_205316.jpg
- (64.92 KiB) Downloaded 1581 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Dspic30f4013
Hello,
You could change the program so it instead looks for another delimiter e.g. a semicolon or a full stop.
For the program to work you need to add "\n" no space between the slash and the n. This is an escape sequence carriage return. i.e. ASCII 10.I used your program to test my pic, even adding "\ n" at the end of each string sent to pic just printed as attachment.
You could change the program so it instead looks for another delimiter e.g. a semicolon or a full stop.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel