Search found 619 matches

by Sobrietytest
14 Jun 2021 09:20
Forum: PIC PRO Compilers
Topic: Switch statement not working
Replies: 1
Views: 1273

Re: Switch statement not working <SOLVED>

As the switch can only concur with one case, I didn't think the break; was necessary. Turns out it is! switch (readbuff[3]){ // Speed select case '1': DelayCnt = 500; break; case '2': DelayCnt = 250; break; case '3': DelayCnt = 167; break; case '4': DelayCnt = 125; break; case '5': DelayCnt = 100; b...
by Sobrietytest
14 Jun 2021 08:11
Forum: PIC PRO Compilers
Topic: Switch statement not working
Replies: 1
Views: 1273

Switch statement not working

I have a PIC Clicker set up driving a stepper motor, it is set up for USB and it decodes the incoming commands from a PC. One of the incoming commands invokes a motor test whereby the speed and direction of the motor can be set on the PC. The decoder reads the first byte ('$') to check whether the m...
by Sobrietytest
09 Jun 2021 15:21
Forum: mikroC PRO for PIC General
Topic: USB interrupt - when to read data?
Replies: 4
Views: 985

Re: USB interrupt - when to read data?

Solved... // USB INTERRUPT ****************************************************** void interrupt(){ USB_Interrupt_Proc(); // USB interrupt servicing if(HID_Read()){ USB_Comms_Decoder(); } } //********************************************************************* So, calling the USB decoder directly w...
by Sobrietytest
09 Jun 2021 11:35
Forum: mikroC PRO for PIC General
Topic: USB interrupt - when to read data?
Replies: 4
Views: 985

Re: USB interrupt - when to read data?

Hmm, I thought the purpose of the USB interrupt was so you didn't need to poll the USB flag?
by Sobrietytest
09 Jun 2021 05:56
Forum: mikroC PRO for PIC General
Topic: USB interrupt - when to read data?
Replies: 4
Views: 985

USB interrupt - when to read data?

Hi, I'm working on a coil winding machine which is controlled by software on a PC. I chose to use a PIC Clicker (18F47J53) as the USB interface and motor controller. Using the Clicker's USB interrupt demo is fine because the only thing it does is respond to USB input messages. In my case, the main()...
by Sobrietytest
02 Mar 2018 16:20
Forum: mikroC PRO for ARM General
Topic: Problems with I2C
Replies: 11
Views: 3903

Re: Problems with I2C

Hi Lana, Not sure what you mean by using a Library? I'm using the I2C library to communicate with the IMU which is the point of the original post. As far as I can tell, there is no difference (electronically) between the PIC circuit and the STM32 circuit. Therefore I'm assuming this is a software is...
by Sobrietytest
26 Feb 2018 13:19
Forum: mikroC PRO for ARM General
Topic: Problems with I2C
Replies: 11
Views: 3903

Re: Problems with I2C

Okay, this is the code in its entirety... char readbuff[64]; char writebuff[64]; char cnt; char x; char y; char I2CReadByte; char reg1; char reg2; int MSAngle; int Angle; char AngleStr[7]; char test[4]; void USB0Interrupt() iv IVT_INT_OTG_FS{ USB_Interrupt_Proc(); } void IMU_Init(){ // Initialises t...
by Sobrietytest
24 Feb 2018 13:35
Forum: mikroC PRO for ARM General
Topic: Problems with I2C
Replies: 11
Views: 3903

Re: Problems with I2C

Hi Lana,

Thanks for the suggestion but that code package is incomplete - and useless - why is it even on Libstock???

I expected better from ME.

ST.
by Sobrietytest
15 Feb 2018 11:13
Forum: mikroC PRO for ARM General
Topic: Problems with I2C
Replies: 11
Views: 3903

Re: Problems with I2C

Hi Lana, I am using the Bosch BNO055 on a breakout board from Adafruit, this has the ability to output Heading, Pitch and Roll angles from it's internal fusion algorithm. The calling function sets the register addresses (reg1 & reg2) and the Read_IMU_Data() function should retrieve the data, convert...
by Sobrietytest
12 Feb 2018 14:59
Forum: mikroC PRO for ARM General
Topic: Problems with I2C
Replies: 11
Views: 3903

Re: Problems with I2C

Hi Wolfgang, I'm running this firmware on a Clicker 2 for STM32, the two I2C pins are on PB10(SCL) and PB11(SCA), these relate to I2C channel 2. I have initialised this using the standard 100kbps bit rate as follows... void SystemInit(){ I2C2_Init(); // Initialises the I2C2 module at PB10/11 IMU_Ini...
by Sobrietytest
10 Feb 2018 06:32
Forum: mikroC PRO for ARM General
Topic: Problems with I2C
Replies: 11
Views: 3903

Problems with I2C

I have been using a Bosch IMU as part of a system that I'm building, up until recently I was using a PIC but, for various reasons, I need to upgrade the system to STM32. I had no problems reading data from the IMU with the PIC but I cannot get the ARM to read the data. This is the PIC code first, th...
by Sobrietytest
20 Mar 2011 11:48
Forum: mikroC PRO for PIC General
Topic: SPI SPI1_read not seeming to work right
Replies: 5
Views: 2939

Re: SPI SPI1_read not seeming to work right

Your question is missing some important information, most of which could be answered if you post your code and schematic. Your RF transceiver uses standard SPI so the MikroC functions should work fine, it's just a matter of having the right connections and initialising the SPI correctly. Incidentall...
by Sobrietytest
04 Mar 2011 10:58
Forum: mikroC PRO for PIC General
Topic: USART string send
Replies: 2
Views: 1192

Re: USART string send

char MyStr[10] = "ABCDEFG111"

Uart_Write_Text(MyStr);
by Sobrietytest
03 Mar 2011 10:12
Forum: mikroC PRO for PIC General
Topic: mikroe usb uart 2 question?
Replies: 3
Views: 1220

Re: mikroe usb uart 2 question?

Hi Nart,

Have a look at the circuit diagram in the user manual, Vcc (5V) is supplied from the USB port.

ST.
by Sobrietytest
28 Jan 2011 11:25
Forum: mikroC PRO for PIC General
Topic: ARM 7
Replies: 17
Views: 4428

Re: ARM 7

This has been a truely enlightening thread, especially for me because I was confronted with the choice of PIC/ARM/FPGA a couple of years ago. What doesn't surprise me is that everyone puts a lot of emphasis on the quality and availability of development tools; this was a major part of our decision m...

Go to advanced search