lcgamboa / picsimlab Goto Github PK
View Code? Open in Web Editor NEWPICsimLab - Programmable IC Simulator Laboratory
License: GNU General Public License v2.0
PICsimLab - Programmable IC Simulator Laboratory
License: GNU General Public License v2.0
Hi, wrote code with asm that uses pin PD1 for an ATmega328P and can't use it properly in PICSimLab. Verified it works in the Atmel simulator and that UART communication it's disabled.
Board 2 - LCD locks up when defining custom characters.
I can provide code when you review this issue.
Olá Luis,
Para tentar implementar o RTOS no STM32, inicialmente tentei testar um programa para enviar um caracter pela porta serial. No entanto, quando inicio a placa, a porta COM aparece com status de erro: "Serial: COM1' (ERROR)".
Teria como resolver este problema?
Hello,
This is not really a bug, but a feature request maybe: The qemu stm32 is too old, and projects using zephyr are crashing the emulator.
So I've created a branch and ported the stm32 machines to the latest qemu. You can give it a try in my fork, branch is picsimlab :)
i don't know when the maintainer of the stm32 port of qemu will do the merge.
I would like to add esp32 support too. but this is an other story.
During build I get the following error:
boards/board_avr.cc:137:28: error: invalid conversion from ‘char’ to ‘unsigned char*’ [-fpermissive]
pins[p].port = pname[1];
~~~~~~~^
To me it seems that some conversion is missing, but couldn't figure out what would be right to do.
Also this error pops up:
boards/board_avr.cc:140:48: error: invalid operands of types ‘int’ and ‘unsigned char*’ to binary ‘operator|’
avr_irq_t* stateIrq = avr_io_getirq (avr, AVR_IOCTL_IOPORT_GETIRQ (pins[p].port), pins[p].pord);
^
Any ideas?
Hi,
Firstly, great job!
The binaries on this site are with version 0.7.5, and this repository here seems to be 0.7.7 if it is possible, please update the precompiled files.
Thank you.
Hello,
A student of mine is not able to view the spare parts window. They are supposed to load the configuration through the workspace/spare parts window but the window only shows up in the taskbar, it is not visible. Could you please help us solve the problem? The screenshot and the configuration files are attached.
Version: 0.8.6
OS: Windows 10 x64
Regards,
A. Cem Onem
I am trying to run BWM at 5khz, but it seems that picsimlab cannot generate the same code listed in real ardunio uno where it works perfectly.
Hi,
I'm working to get the LCD1602 embedded in PICGenios board using PIC16F877A.
I've tried this code but it's not working.
`
void pic_init(void){
TRISA = 0b00000000;
TRISB = 0b00000000;
TRISD = 0b00000000;
TRISC = 0b00000000;
TRISE = 0b00000000;
}
void lcd_init(void){
__delay_ms(25);
ADCON1 = 0b00001111;
lcd_cmd(0x33);lcd_cmd(0x32);lcd_cmd(0x28);
lcd_cmd(0x0f);lcd_cmd(0x01);lcd_cmd(0x80);
}
void lcd_cmd(char cmd){
PORTD = cmd;
PORTE &= ~(1 << LCD_RS);
PORTE |= (1 << LCD_EN);
__delay_us(10);
PORTE &= ~(1 << LCD_EN);
__delay_ms(5);
}
void lcd_data(char dat){
PORTD = dat;
PORTE |= (1 << LCD_RS);
PORTE |= (1 << LCD_EN);
__delay_us(10);
PORTE &= ~(1 << LCD_EN);
__delay_ms(5);
}
void move_cursor (unsigned char row, unsigned char col){
if(row == 1){
lcd_cmd(FIRST_ROW + col);
}
if(row == 2){
lcd_cmd(SECOND_ROW + col);
}
}
void lcd_string_arr(char str[]){
char i;
for(i=0; str[i] != 0; i++){
lcd_data(str[i]);
}
}
void lcd_string_ptr(const char *msg){
unsigned char cnt=1;
while((*msg) != 0){
lcd_data(*msg);__delay_ms(2);
msg++; cnt++;
if(cnt == DDRAM_AFTER_CHAR16){
lcd_cmd(SECOND_ROW);
msg--;
}
if(cnt == DDRAM_AFTER_CHAR32){
lcd_cmd(CLEAR_DISPLAY);
}
}
}
void lcd_string_xy(unsigned char row, unsigned char col, char str[]){
if(row == 1){
lcd_cmd(FIRST_ROW + col);
}
if(row == 2){
lcd_cmd(SECOND_ROW + col);
}
lcd_string_arr(str);
}`
In this main I'm using this test code:
`void main(void) {
pic_init();
lcd_init();
lcd_string_xy(0, 1, "lcd test");
__delay_ms(2000);
lcd_cmd(CLEAR_DISPLAY);
while(1){
}
}`
Hi,
There is some problem linking to some of the functions (statically) defined in sim_gdb.c
/usr/bin/ld: boards/board_simavr.o: in function avr_callback_run_gdb_(avr_t*)': /home/luiz/Desktop/Sim/picsimlab/src/boards/board_simavr.cc:328: undefined reference to
gdb_watch_find'
/usr/bin/ld: /home/luiz/Desktop/Sim/picsimlab/src/boards/board_simavr.cc:335: undefined reference to gdb_send_quick_status' /usr/bin/ld: /home/luiz/Desktop/Sim/picsimlab/src/boards/board_simavr.cc:344: undefined reference to
gdb_network_handler'
/usr/bin/ld: boards/board_simavr.o: in function board_simavr::DebugLoop()': /home/luiz/Desktop/Sim/picsimlab/src/boards/board_simavr.cc:408: undefined reference to
gdb_network_handler'
Hello,
I am on Ubuntu 20.04.2 LTS and I have g++ 9.3.0 and I get the errors at Linking:
/usr/bin/ld : /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o : dans la fonction « start » :
(.text+0x24) : référence indéfinie vers « main »
/usr/bin/ld : /tmp/picsimlab.dMLM2C.ltrans24.ltrans.o : dans la fonction « avr_callback_run_gdb(avr_t*) » :
/home/alberic/bin/picsimlab/src/boards/bsim_simavr.cc:418 : référence indéfinie vers « gdb_watch_find »
/usr/bin/ld : /home/alberic/bin/picsimlab/src/boards/bsim_simavr.cc:425 : référence indéfinie vers « gdb_send_quick_status »
/usr/bin/ld : /tmp/picsimlab.dMLM2C.ltrans24.ltrans.o : dans la fonction « bsim_simavr::DebugLoop() » :
/home/alberic/bin/picsimlab/src/boards/bsim_simavr.cc:505 : référence indéfinie vers « gdb_network_handler »
/usr/bin/ld : /tmp/picsimlab.dMLM2C.ltrans24.ltrans.o : dans la fonction « avr_callback_run_gdb_(avr_t*) » :
/home/alberic/bin/picsimlab/src/boards/bsim_simavr.cc:434 : référence indéfinie vers « gdb_network_handler »
collect2: error: ld returned 1 exit status
I tried using clang++ but I have the same issue. What are the dependencies for this?
imagine this situation...
suppose i have 10 arduinos, each one with a different sketch loaded, and different eeprom contents (and maybe different connected modules too)..... is there a way to simulate this in picsimlab too? ... i mean "interchange" arduino states (flash+eeprom) through memory dump files or something?
some game emulators (mame, zsnes, neoragex, pcsx2, etc) have an option to save current machine state to files, and then restore states and continue playing ... i mean not specifically "state" (wich includes sram state) but more like a way to be able to have different boards with different programs
i suspect the menu > file > save/load workspace has something to do with it, but the picsimlab help menu is not so helpy on the program usage
.... going further... could different picsimlab instances with different "states" run and interact each other?
thanks
where can i view/configure additional serial parameters for the uart virtual interface?
i had tried many combinations but the only i get is garbage :(
terminal picsimlab uart terminal
.-------,
,======, com0com |] # | com0com ,======,
|>_ | | ', ,----, |>_ |
| |-----------|] ## |----| # |-----------| |
'======' '--------' '----' '======'
text --------> garbage
garbage <-------- text
OK <--- same text ---> garbage
i am trying to use the virtual arduino with a software serial passthtough sketch to test serial comm
i use the usb serial on one side and a couple pins with the uart interface on the other
i use com2com and a serial terminal emulator on both sides
the usb serial side works fine, but the uart virtual device side goes crazy
where can i view/configure additional serial parameters for the uart virtual interface?... thanks
tip to install deb on Ubuntu 18.04
wget http://mirrors.edge.kernel.org/ubuntu/pool/main/g/gcc-10/gcc-10-base_10-20200411-0ubuntu1_amd64.deb
wget http://mirrors.xmission.com/ubuntu/pool/main/g/gcc-10/libgcc-s1_10-20200411-0ubuntu1_amd64.deb
sudo dpkg -i gcc-10-base_10-20200411-0ubuntu1_amd64.deb
sudo dpkg -i libgcc-s1_10-20200411-0ubuntu1_amd64.deb
sudo dpkg -i picsimlab_0.8.10_220311_Ubuntu_18.04.6_LTS_amd64.deb
I modify the RTC date and clock, but it reverts to a default value. Below is the code where I change it to 12/2/20, 10:40:15, but what appears on the LCD is 12/31/69, 21:00:01. I believe it's a simulator bug (PICGenios - PIC18F4520). Thanks for the help!
#define _XTAL_FREQ 8000000
#include "configbits.h"
#include <xc.h>
#include "flexlcd.h"
#include <stdio.h>
#include "i2c.h"
#include "rtc.h"
#include "eeprom.h"
#include "eeprom_ext.h"
//Variables
unsigned int duty = 100, count = 0; // 0 a 255
unsigned char str[5];
// saídas (colunas), ativadas por 0
#define C1 LATBbits.LB0
#define C2 LATBbits.LB1
#define C3 LATBbits.LB2
// entradas (linhas), com pull-up externo
#define L1 PORTDbits.RD3
#define L2 PORTDbits.RD2
#define L3 PORTDbits.RD1
#define L4 PORTDbits.RD0
void main(void)
{
//ADCON0 = 0b00000000; // Configura todos pinos para digital
ADCON1 = 0b00001111; // desabilita o conversor A/D
//ADCON2 = 0b00000000;
//INTCON2 = 0b00000000;
INTCON2bits.RBPU = 1; // Pull-up resistors off
T1CON = 0b10000011; // configura Timer1
//PIE1bits.TMR1IE = 1; // TMR1 enable interrupt
//PIR1bits.TMR1IF = 0; // TMR1 interrupt flag
TMR1L = 0;
TMR1H = 0; // valor inicial
// Input or Output
TRISA = 0xFF;
TRISB = 0b00000000;
TRISC = 0b00000001;
TRISD = 0b00000000;
TRISE = 0b00000000;
// Clear ports
PORTA = 0;
LATA = 0;
PORTB = 0;
LATB = 0;
PORTC = 0;
LATC = 0;
PORTD = 0;
LATD = 0;
PORTE = 0;
LATE = 0;
//adc_init(); // configura registradores ADCON
Lcd_Init();
Lcd_Cmd(LCD_CURSOR_OFF);
i2c_init();
i2c_start();
//day, mth, year, dow, hr, min, sec)
rtc_w(02, 12, 20, 4, 10, 40, 15);
__delaywdt_ms(200);
e2prom_w(0, 33); // interna
e2pext_w(0, 47); // externa
while(1)
{
CLRWDT();
rtc_r(); // ler valores date e time
__delaywdt_ms(50);
Lcd_Out(1, 0, date);
Lcd_Out(2, 0, time);
__delaywdt_ms(2000);
}
return;
}
PicsimLab was working until I tried to change the board to STM32. Ever since I cannot run PicsimLab for the life of me. All the other applications that come with it works. I have tried reinstalling and restarting my PC. Nothing is working. If I try opening the program it just does not open. Please help.
This problem report concerns the use of two 74xx595 chips interfaced to a PIC16F628A processor in a cascaded connection. This design has been implemented on PICSimLab version 0.8.9 210727 Windows64_WX.
I use the Breadboard board with a PIC16F628A processor on it. I connect a 74xx595 device to the PIC and then another 74xx595 to the first one in a cascaded connection. Each 74xx595 device drives 8 LEDs on their outputs. The 74xx595 device placed to the left side of the design layout is the one connected to the PIC.
I have attached a ZIP file containing a source file hc595_demo.c illustrating the problem. The ZIP file also contains other supporting files as well as the screen shots. Thanks and regards.
Dependency is not satisfiable :libwxbase3.0-0v5 (>=3.0.5.1+dfsg)
tried app image also previous version
also updated from linux mint 20.04 to 20.10 but no lu
Prezado Luis Claudio Gambôa,
Estou tentando fazer funcionar o aquecedor e o ventilador na placa PICGenios usando o microcontrolador PIC18F4520.
Quando não aciono o ventilador via PWM, o aquecedor funciona.
Quando rodo a função PWM1_Start(), o aquecedor para de funcionar. Mais especificamente quando o registrador T2CONbits.TMR2ON é ativado, dentro de pwm.c.
Achei que pudesse ser alguma configuração de RC5 no modo SPI. Inclui SSPCON1bits.SSPEN = 0, mas sem sucesso.
Poderia me ajudar?
Seguem mais detalhes do código:
==============================================================
#define _XTAL_FREQ 8000000
#include "configbits.h"
#include <xc.h>
#include "flexlcd.h"
#include "adc.h"
#include <stdio.h>
#include "itoa.h"
#include "pwm.h"
#include "serial.h"
//Variables
unsigned int duty = 100, infrav = 0, count = 0, result = 0; // 0 a 255
char str[5], buffer_tx[20], buffer_rx[20];
// resistência de aquecimento RC5
#define aquec PORTCbits.RC5
void main(void)
{
ADCON0 = 0b00000000; // Configura todos pinos para digital
ADCON1 = 0x00; // habilita todas as portas analógicas
INTCON2bits.RBPU = 1; // Pull-up resistors off
T1CON = 0b10000011; // configura Timer1
TMR1L = 0;
TMR1H = 0; // valor inicial
// Input or Output
TRISA = 0xFF;
TRISB = 0b00000000;
TRISC = 0b10000001;
TRISD = 0b00000000;
TRISE = 0b00000001;
// Clear ports
PORTA = 0;
LATA = 0;
PORTB = 0;
LATB = 0;
PORTC = 0;
LATC = 0;
PORTD = 0;
LATD = 0;
PORTE = 0;
LATE = 0;
aquec = 1; // aquecedor ligado
serial_init();
adc_init(); // configura registradores ADCON
Lcd_Init();
Lcd_Cmd(LCD_CURSOR_OFF);
PWM1_Init(1000); // configura frequencia do PWM para 1kHz
PWM1_Start(); // configura registradores e inicia PWM
//Timer 0 config
INTCONbits.TMR0IF = 0; // TMR0 register has overflowed (must be cleared in software)
INTCONbits.TMR0IE = 1; //1 = Enables the TMR0 overflow interrupt
T0CON = 0b11000101; // 8bit and 1:64 Prescale
TMR0 = 131;
INTCON = 0b11100000; // enable gobal and peripheric interrupts
while(1)
{
CLRWDT();
serial_rx_str_until(buffer_rx,20,'\n');
Lcd_Out(2, 0, buffer_rx);
}
return;
}
void interrupt isr(void)
{
if (INTCONbits.TMR0IF == 1)
{
INTCONbits.TMR0IF = 0; // Clear interrupt flag
TMR0 = 131;
count ++;
if (count == 250)
{
count = 0;
LATDbits.LATD1 = ~LATDbits.LATD1; // Toggle led
PWM1_Set_Duty(duty);
infrav = TMR1L;
infrav += TMR1H<<8;
sprintf(str, "%05u", infrav);
Lcd_Out(1, 0, str);
result = adc_amostra(1); // sensor de temperatura LM35 canal 1,
sprintf(buffer_tx, "/*%04d/", result);
serial_tx_str(buffer_tx);
}
}
}
============================================================
CÓDIGO DE pwm.c
#include <xc.h>
#include"pwm.h"
void PWM1_Init(unsigned int f)
{
unsigned int temp;
//PWM Period = [(PR2) + 1] * 4 * TOSC *(TMR2 Prescale Value)
//PWM Duty Cycle = (CCPRXL:CCPXCON<5:4>) *TOSC * (TMR2 Prescale Value)
//desliga PWM
CCP1CON=0x00;//CCP disabled
TRISCbits.TRISC2=1; //desliga saídas PWM
TRISDbits.TRISD5=1;
PORTCbits.RC2=0; //deliga saídas PWM
PORTDbits.RD5=0;
CCPR1L=0;//ou 255?
//calculo TMR2
T2CONbits.TMR2ON=0;
temp=_XTAL_FREQ/(f*4l);
if (temp < 256)
{
T2CONbits.T2CKPS=0; //1
PR2=temp;
}
else if(temp/4 < 256 )
{
T2CONbits.T2CKPS=1; //4
PR2=(temp+2)/4;
}
else
{
PR2=(temp+8)/16;
T2CONbits.T2CKPS=2; //16
}
T2CONbits.T2OUTPS=0; //1-16
}
void PWM1_Start(void)
{
TRISCbits.TRISC2=0; //liga saídas PWM
TRISDbits.TRISD5=0;
CCP1CON=0x0F; //CCP -> PWM mode 0x0F
T2CONbits.TMR2ON=1;
// tentativa de acionar LC5, sem sucesso
SSPCON1bits.SSPEN = 0;
TRISCbits.TRISC5=0;
LATCbits.LC5 = 1;
//espera PWM normalizar
PIR1bits.TMR2IF=0;
while(PIR1bits.TMR2IF == 0);
PIR1bits.TMR2IF=0;
while(PIR1bits.TMR2IF == 0);
}
void PWM1_Set_Duty(unsigned char d)
{
unsigned int temp;
temp=(((unsigned long)(d))*((PR2<<2)|0x03))/255;
CCPR1L= (0x03FC&temp)>>2;
CCP1CON=((0x0003&temp)<<4)|0x0F;
}
Gtk-Message: 19:15:05.979: Failed to load module "canberra-gtk-module"
Gtk-Message: 19:15:05.979: Failed to load module "appmenu-gtk-module"
Gtk-Message: 19:15:06.007: Failed to load module "colorreload-gtk-module"
Gtk-Message: 19:15:06.007: Failed to load module "window-decorations-gtk-module"
Gtk-Message: 19:15:06.007: Failed to load module "appmenu-gtk-module"
PICSimLab: Load Config from file "/home/qie2035/.picsimlab/picsimlab.ini"
PICSimLab: Opening "/home/qie2035/.picsimlab/mdump_Blue_Pill_stm32f103c8t6.hex"
osc: 8000000
reset is called!
PICSimLab: qemu-stm32 -M stm32-f103c8-picsimlab-new -drive file=/home/qie2035/.picsimlab/mdump_Blue_Pill_stm32f103c8t6.bin,if=pflash,format=raw -d unimp -rtc clock=vm -icount shift=5,align=off,sleep=on
reset is called!
(picsimlab:162511): Gtk-WARNING **: 19:15:06.253: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/breeze/status/16/image-missing.svg: Unable to load image-loading module: /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so: /usr/lib/librsvg-2.so.2: undefined symbol: pango_coverage_get_type (gdk-pixbuf-error-quark, 5)
I have just installed the latest version of PICSimLab and was pleased to see the "BreadBoard" option and its updated Device list.
Unfortunately the first devices that I tested with it, namely the PIC16f18855 and PIC16f1788, both crashed the simulator upon loading the HEX file.
In Both cases I was using a Simple GCBASIC source that was compiled and verified on real hardware first.
`
#chip 16f18855
Dir PortA Out
Do
PortA = NOT PortA
Wait 250 ms
Loop
`
The older devices that were included in the previous versions of PICSimLab appear to work in the Breadboard but not the newer 28 Pin Devices.
Regards
Chris
According to the datasheet of PIC18F4620 (Page 305), SUBLW instruction must affect the N bit of STATUS register. It should be 1 if the result is negative, and 0 otherwise.
Regardless of the subtraction result, SUBLW instruction does not modify the N bit of STATUS register on PIC18F4620. Both PICSimLab versions 0.8.6 and 0.8.7 exhibit the same behavior.
I'm using MPLAB X IDE v5.40 on Ubuntu 20.04.
Prezado Luis,
Quando instalei a versão 0.8.5 eu percebi instabilidade na comunicação serial.
Na versão 0.8.2 tudo rodava normalmente, quando atualizei, comecei a ter problemas. Os bytes começaram a tramitar com atraso, o que comprometeu a comunicação.
Alan.
Hi! Is PIC microcontrollers compatible with PICKit protocol? For example. I need to connect virtual PICKit to virtual PIC and overwrite one section of eeprom and then reboot the controller.
Board 2 with 16f648a - how do I make the MCLR an input?
Tried lot of options - all failed. Or, is this a limitation of the 16f648a and you are emulating that?
Is it possible to install PICSimLab on a drive other than C: using the installer for Windows?
The installer seems to provide no way of setting the install location.
Good Morning,
I have downloaded picsimlab and compiled (cross compiled the win version in to Ubuntu) the experimental version to try the new spare part ETH w5500.
I have attached an Arduino Uno to w5500 and have run the telent client example. The windows machine running picsimlab has IP: 192.168.1.22, while I have statically assigned the IP 192.168.1.240 to the w5500 (I have even tried with 192.168.1.22);
On a machine (192.168.2.214) on the same network I have used netcat listening on port 2000 for incoming TCP connection.
echo "Hello" | nc -l 2000
When Arduino try to connect, the connection is established but it is immediately closed (RST) by picsimlab;
This is what I have the captured using wireshark about the network activity:
1 192.168.1.22 192.168.1.214 TCP 66 51004 → 2000 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 WS=256 SACK_PERM=1
2 192.168.1.214 192.168.1.22 TCP 66 2000 → 51004 [SYN, ACK] Seq=0 Ack=1 Win=64240 Len=0 MSS=1460 SACK_PERM=1 WS=1024
3 192.168.1.22 192.168.1.214 TCP 54 51004 → 2000 [ACK] Seq=1 Ack=1 Win=2102272 Len=0
4 192.168.1.214 192.168.1.22 TCP 60 2000 → 51004 [PSH, ACK] Seq=1 Ack=1 Win=64512 Len=6
This is the message on the Arduino Serial Terminal:
connecting...
connection failed
disconnecting.
BTW.
The w5500 web server example seem to work perfectly!
Any help will be appreciated.
Thank you very much
Hi, I'm Luca from Genova Italy.
I'm going to write an article in the online magazine https://all3dp.com/ titled "X Best Arduino Simulators (Online & Offline)".
I'm testing your software and I'm having issues with the serial output.
Installed com0com on Windows 10 and it works properly (see image)
But if I load a hex file as simple as just printing output to the serial, it doesn't work.
At first, tried your example AnalogInOutSerial.pzw
I know it's surely my mistake, but can you give me some hints? Thank you in advance.
Luca Dinale
Ah, forgot to say. I'm trying to reproduce this simple circuit, but can't find the HC-SR04 part. How can I simulate this part? I'm not a programmer :/
I downloaded and installed the new update (v0.8.7) today on my Windows 10 (20H2 - Build 19042.928), but its memory consumption is crazy. It keeps allocating about 5 MBs every second, I stopped it after it had already allocated more than 6 GBs of RAM! It barely even reached 10 MBs with v0.8.6
However, this doesn't seem to happen with all boards. I selected Arduino Uno, and the leak stopped (but memory usage didn't go down again). I go back to PICGenios (which is what I need to use) and it goes back to eat more RAM than Google Chrome ever did.
I tried uninstalling and reinstalling from scratch after also removing everything in %APPDATA%\picsimlab
(I had previously installed it without first removing the previous version, 0.8.6), but that didn't help.
I got the installer from the releases section in this repo (in particular, the picsimlab_0.8.7_win64_setup.exe file).
Please help with this memory leak as I really liked the new SVG pictures, but had to revert back to v0.8.6 just to be able to use it
picsimlab/src/boards/board_picsim.cc
Line 35 in 355f26d
I think you should set the name of serial port also for the second usart !
pic_set_serial (&pic,1, port, 0, 0, 0);
PS: i have tested this solution on the PIC18F27K40 in the Curiosity HPC board .
Best regards,
Describe the bug
PICSimLab don't resize or refresh this window on wayland
To Reproduce
Open PICSimLab on wayland
Expected behavior
The PICSimlab window don´t refresh or resize correctly.
Desktop:
Workaround
Set gdk backend before run picsimlab:
GDK_BACKEND=x11 picsimlab
picsimlab depende de libc6 (>= 2.28); porém:
Versão de libc6:amd64 no sistema é 2.27-3ubuntu1.
picsimlab depende de libwxgtk3.0-gtk3-0v5 (>= 3.0.4+dfsg-10~); porém:
Versão de libwxgtk3.0-gtk3-0v5:amd64 no sistema é 3.0.4+dfsg-3.
Describe the bug
AppImage version doesn't launch in Fedora 35
I tested it with and without AppImageLauncher.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The App runs and works as it should do.
Desktop (please complete the following information):
Hello, I tried to run the BMP280 module on the BluePill board, but I could not get the I2C communication to work. When I observed from the oscilloscope module, I saw that the I2C pins were 0V. Although I set the GPIO pins as pullup, I could not set them to 3.3V.
Does the BluePill board support I2C communication?
I did track them down, but it is not straightforward.
Hi,
PicSimLb is a very nice project, thanks for the good work.
I am trying to port a small board we use with our students. The MCU is a PIC16F1788. One of the ADC does not work : it's AN12, on pin 21. I had a look into PIC16F1788.c, and I think some lines are missing in function PIC16F1788_reset() :
pic->adc[0] = 2;
...
pic->adc[10] = 22; // OK
pic->adc[11] = 25; // Missing ?
pic->adc[12] = 21; // Missing ?
pic->adc[13] = 26; // Missing ?
... and a line in PIC16F1788_start() should be corrected:
pic->ADCCOUNT = 14; // instead of 11
Am I right ?
Best Regards
board 2. The RTCC is losing time. Seconds are passing me by and the clock is not correct after only 60 secs.
Oh why?
In the process of creating an initial Flatpak packaging for picsimlab I'm also adding proper entries in release-monitoring.org
(Anitya) as it helps update automation of the Flatpak manifest, and it's also a useful tool for distro maintainers.
I already added entries for picsimlab, lxrad, and lunasvg, but I haven't added yet a picsimlab-simavr
entry as there's no tag naming scheme that could help differentiate upstream simavr
releases from the picsimlab-simavr
releases.
There's a 1.6a
picsimlab-simavr
release, which is a bit confusing way to tag a fork release.
I suggest to tag picsimlab-simavr
releases as picsimlab-MAJOR.MINOR.PATCH
as Anitya should be able to filter tags with a prefix.
I'm not sure about tagging releases as picsimlab-vMAJOR.MINOR.PATCH
. I guess it should also work, but I recommend against it, as I haven't confirmed that the Anitya filter does not split on dash/hyphen, and Anitya has its quirks.
p.s. I suggest turning on the issues in the simavr fork, as long as it's expected to be shipped with picsimlab, and not just a downstream development fork.
hi... i am trying to run a virtual arduino with this configuration for testing...
terminal picsimlab uart terminal
.-------,
,======, com0com |] # | com0com ,======,
|>_ | | ', ,----, |>_ |
| |-----------|] ## |----| # |-----------| |
'======' '--------' '----' '======'
i try to set like real parameters (16mhz)... but it runs at 0.02x speed!! ... and eats 20% of my cpu time!
i can't imagine why is so slow, is just an arduino... my playstation2 emulator runs faster with all enabled
i have a pentium xeon 3.6ghz 12 cores, 12gb ram, windows 8.1 x64
... is there some optimization i could do??
https://github.com/lcgamboa/picsimlab/blob/master/docs/examples/board_4/PIC18F4550/test_b4/src/test_b4.X/i2c.c
TRISC=0x01; needs to move from main to a i2c_init
As in the title, is there a way to do so?
I'm having hard time trying to understand how to do so using all of the available APIs in lcgamboa/picsimlab_examples
The code (1), (2) I found on the internet compiles well, but doesn't seem to display anything from the CGRAM. Either I'm missing something or I simply don't quite understand the basics ;/
Can anyone explain me how to do so? It also may be a bug, hence the issue. If it turns out to be just my misunderstanding then feel free to close the issue without an answer, I won't be mad :p
Picsimlab not starting after I've installed MPLABX. It was running without problems before installing MPLABX.
picsimlab4.cc: In member function ‘void CPWindow4::SetSample()’: picsimlab4.cc:340:4: error: reference to ‘data’ is ambiguous 340 | data[fp][0][is] = -pins[0]+((1.0 * rand () / RAND_MAX) - 0.5)*0.1; | ^~~~ In file included from /usr/local/include/c++/11.1.0/string:54, from /usr/local/include/c++/11.1.0/bits/locale_classes.h:40, from /usr/local/include/c++/11.1.0/bits/ios_base.h:41, from /usr/local/include/c++/11.1.0/ios:42, from /usr/local/include/c++/11.1.0/ostream:38, from /usr/local/include/c++/11.1.0/iostream:39, from /usr/include/lxrad/clxrad.h:52, from /usr/include/lxrad/lxrad.h:45, from picsimlab4.h:29, from picsimlab4.cc:29: /usr/local/include/c++/11.1.0/bits/range_access.h:319:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(std::initializer_list<_Tp>)’ 319 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/local/include/c++/11.1.0/bits/range_access.h:310:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’ 310 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/local/include/c++/11.1.0/bits/range_access.h:300:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’ 300 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/local/include/c++/11.1.0/bits/range_access.h:290:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’ 290 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Files
If applicable, add a minimal source code together with a PICSimLab workspace (.pzw file) to help reproduce your problem.
Desktop (please complete the following information):
Troubleshooting:
The simulation in PICSimLab consists of 3 parts:
When a problem occurs it is important to detect where it is occurring.
One of the most common problems is the error in the microcontroller program. Before creating an issue, test your code on a real circuit (even partially) to make sure the problem is not there.
Errors in the microcontroller simulation can be detected using code debugging. Any instruction execution or peripheral behavior outside the expected should be reported in the project of simulator used (picsim or simavr).
If the problem is not in either of the previous two options, the problem is probably in PICSimLab. A good practice is to send a source code together with a PICSimLab workspace (.pzw file) to open the issue about the problem.
This code should show D0 and B7 Lit on Board 4 - PICGenios
;Start of the main program
;test dir
;
;PortD = 0b00000001 ; Initial LED Pattern
movlw 1
movwf PORTD
;PortB = 0b10000000 ; Initial LED Pattern
movlw 128
movwf PORTB
;Dir PortD Out ; All PortD Pins as Outputs
banksel TRISD
clrf TRISD
;Dir PortB Out ; All PortB Pins as Outputs
clrf TRISB
However, when clrf TRISB executes all of the PortD LED's light.
Regards,
Chris Roper
Hey, this is in follow up on buserror/simavr#345. I have this sketch:
https://github.com/TomasHubelbauer/arduino-nmea-checksum
The repository documents how to compile it to HEX and as you can see in the sketch source code, it writes into serial. When I open its HEX it picsimlab and choose the board 5 (Arduino Uno) and open the serial viewer, I don't see any output. The port selector is empty, so I cannot select one and click Open either. Is this a problem with my sketch or the order of actions I took in picsimlab?
Also, this project is beyond amazing, I wasn't even hoping there would be something like this. It's criminal that it is not more well-known. I find it crucial for people to be able to simulate Arduino sketches locally and offline, the abundance of SaaS offerings to do this doesn't work for people like me because I don't like that they require you to make an account and require you to be online to simulate.
I got a problem with PicSimLab 7.5. It's closing suddenly when I'm trying to use it with MPlabX.
Prezado colega,
Quando abro algum projeto de exemplo do PICsimLab no MPLab X IDE v5.35 surgem alguns erros na hora de compilar. Estou usando o compilador XC8 v2.10.
Os dois primeiros erros eu consegui resolver substituindo
#asm
NOP
NOP
NOP
NOP
NOP
#endasm
por
asm("NOP");
asm("NOP");
...
asm("NOP");
Os outros problemas eu não consegui resolver.
Poderia me ajudar?
Parabéns pelo trabalho!
Seguem as telas de saída:
CLEAN SUCCESSFUL (total time: 108ms)
make -f nbproject/Makefile-16F877A.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'C:/Users/alank/Downloads/picsimlab-master/docs/examples/board_3/PIC16F877A/test_b3/src/test_b3.X'
make -f nbproject/Makefile-16F877A.mk dist/16F877A/production/test_b3.X.production.hex
make[2]: Entering directory 'C:/Users/alank/Downloads/picsimlab-master/docs/examples/board_3/PIC16F877A/test_b3/src/test_b3.X'
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=16F877A -c -fno-short-double -fno-short-float -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=0 -Wa,-a -DXPRJ_16F877A=16F877A -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/16F877A/production/display7s.p1 display7s.c
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=16F877A -c -fno-short-double -fno-short-float -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=0 -Wa,-a -DXPRJ_16F877A=16F877A -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/16F877A/production/eeprom.p1 eeprom.c
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=16F877A -c -fno-short-double -fno-short-float -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=0 -Wa,-a -DXPRJ_16F877A=16F877A -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/16F877A/production/atraso.p1 atraso.c
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=16F877A -c -fno-short-double -fno-short-float -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=0 -Wa,-a -DXPRJ_16F877A=16F877A -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/16F877A/production/adc.p1 adc.c
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
atraso.c:36:7: error: invalid preprocessing directive
#asm
^
atraso.c:42:6: error: invalid preprocessing directive
#endasm;
^
2 errors generated.
(908) exit status = 1
make[2]: *** [nbproject/Makefile-16F877A.mk:190: build/16F877A/production/atraso.p1] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory 'C:/Users/alank/Downloads/picsimlab-master/docs/examples/board_3/PIC16F877A/test_b3/src/test_b3.X'
make[1]: Leaving directory 'C:/Users/alank/Downloads/picsimlab-master/docs/examples/board_3/PIC16F877A/test_b3/src/test_b3.X'
make[1]: *** [nbproject/Makefile-16F877A.mk:91: .build-conf] Error 2
make: *** [nbproject/Makefile-impl.mk:39: .build-impl] Error 2
BUILD FAILED (exit value 2, total time: 17s)
CLEAN SUCCESSFUL (total time: 235ms)
make -f nbproject/Makefile-16F877A.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'C:/Users/alank/Downloads/picsimlab-master/docs/examples/board_3/PIC16F877A/test_b3/src/test_b3.X'
make -f nbproject/Makefile-16F877A.mk dist/16F877A/production/test_b3.X.production.hex
make[2]: Entering directory 'C:/Users/alank/Downloads/picsimlab-master/docs/examples/board_3/PIC16F877A/test_b3/src/test_b3.X'
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=16F877A -c -fno-short-double -fno-short-float -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=0 -Wa,-a -DXPRJ_16F877A=16F877A -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/16F877A/production/display7s.p1 display7s.c
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=16F877A -c -fno-short-double -fno-short-float -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=0 -Wa,-a -DXPRJ_16F877A=16F877A -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/16F877A/production/atraso.p1 atraso.c
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=16F877A -c -fno-short-double -fno-short-float -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=0 -Wa,-a -DXPRJ_16F877A=16F877A -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/16F877A/production/eeprom.p1 eeprom.c
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=16F877A -c -fno-short-double -fno-short-float -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=0 -Wa,-a -DXPRJ_16F877A=16F877A -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/16F877A/production/adc.p1 adc.c
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=16F877A -c -fno-short-double -fno-short-float -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=0 -Wa,-a -DXPRJ_16F877A=16F877A -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/16F877A/production/i2c.p1 i2c.c
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=16F877A -c -fno-short-double -fno-short-float -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=0 -Wa,-a -DXPRJ_16F877A=16F877A -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/16F877A/production/itoa.p1 itoa.c
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=16F877A -c -fno-short-double -fno-short-float -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=0 -Wa,-a -DXPRJ_16F877A=16F877A -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/16F877A/production/eeprom_ext.p1 eeprom_ext.c
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=16F877A -c -fno-short-double -fno-short-float -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=0 -Wa,-a -DXPRJ_16F877A=16F877A -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/16F877A/production/lcd.p1 lcd.c
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=16F877A -c -fno-short-double -fno-short-float -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=0 -Wa,-a -DXPRJ_16F877A=16F877A -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/16F877A/production/teste_b3.p1 teste_b3.c
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=16F877A -c -fno-short-double -fno-short-float -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=0 -Wa,-a -DXPRJ_16F877A=16F877A -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/16F877A/production/serial.p1 serial.c
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
teste_b3.c:66:6: error: variable has incomplete type 'void'
void interrupt isrh(void);
^
teste_b3.c:66:15: error: expected ';' after top level declarator
void interrupt isrh(void);
^
;
teste_b3.c:542:6: error: variable has incomplete type 'void'
void interrupt isrh()
^
teste_b3.c:542:15: error: expected ';' after top level declarator
void interrupt isrh()
^
;
4 errors generated.
(908) exit status = 1
make[2]: *** [nbproject/Makefile-16F877A.mk:254: build/16F877A/production/teste_b3.p1] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [nbproject/Makefile-16F877A.mk:91: .build-conf] Error 2
make: *** [nbproject/Makefile-impl.mk:39: .build-impl] Error 2
make[2]: Leaving directory 'C:/Users/alank/Downloads/picsimlab-master/docs/examples/board_3/PIC16F877A/test_b3/src/test_b3.X'
make[1]: Leaving directory 'C:/Users/alank/Downloads/picsimlab-master/docs/examples/board_3/PIC16F877A/test_b3/src/test_b3.X'
BUILD FAILED (exit value 2, total time: 20s)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.