CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Search found 14 matches
CCS Forum Index
Author Message
  Topic: F46J50 RTCC with internal oscillator
WrySun

Replies: 8
Views: 7969

PostForum: General CCS C Discussion   Posted: Sun Dec 10, 2023 2:17 pm   Subject: F46J50 RTCC with internal oscillator
With the software RTC I measured the drift to be 9 seconds too fast per hour at room temperature, which is sufficient accuracy for my application.
  Topic: F46J50 RTCC with internal oscillator
WrySun

Replies: 8
Views: 7969

PostForum: General CCS C Discussion   Posted: Sun Dec 10, 2023 10:16 am   Subject: F46J50 RTCC with internal oscillator
Thank you, that explains it. I successfully switched to using Neutone's software RTC instead, posted by ckielstra here:
https://www.ccsinfo.com/forum/viewtopic.php?t=26177
  Topic: F46J50 RTCC with internal oscillator
WrySun

Replies: 8
Views: 7969

PostForum: General CCS C Discussion   Posted: Sun Dec 10, 2023 5:08 am   Subject: F46J50 RTCC with internal oscillator
Hi Guys,

I'm using the built in RTCC on a PIC18F46J50 with the internal oscillator. The RTCC ticks fine but runs 5% slow, making it lose ~3-4 seconds every minute.

Using the calibrate argument t ...
  Topic: Porting stepper motor library for TMC2209 driver
WrySun

Replies: 22
Views: 44614

PostForum: General CCS C Discussion   Posted: Fri Jan 20, 2023 2:11 am   Subject: Porting stepper motor library for TMC2209 driver
Yes, I tested reversing the pins and can confirm this was my mistake. Read and write both work properly now which is a great relief.

This is the TMC2209 v3.0 module I'm using:
https://www.aliexpre ...
  Topic: Porting stepper motor library for TMC2209 driver
WrySun

Replies: 22
Views: 44614

PostForum: General CCS C Discussion   Posted: Fri Jan 20, 2023 1:35 am   Subject: Porting stepper motor library for TMC2209 driver
Are you sure you have the wiring right?.

Understand it is the RX pin on the PIC, that has to connect to the UART
pin on the TMC2209. If you connect the TX pin, you won't be able to get
any data b ...
  Topic: Porting stepper motor library for TMC2209 driver
WrySun

Replies: 22
Views: 44614

PostForum: General CCS C Discussion   Posted: Thu Jan 19, 2023 2:30 am   Subject: Porting stepper motor library for TMC2209 driver
I did manage to read it.
Was not using a PIC for this, but the way it was done was that the receive
interrupt routine, was given the count of sent bytes, and it simply read
and threw away each 'se ...
  Topic: Porting stepper motor library for TMC2209 driver
WrySun

Replies: 22
Views: 44614

PostForum: General CCS C Discussion   Posted: Thu Jan 19, 2023 2:24 am   Subject: Porting stepper motor library for TMC2209 driver
I imagine most applications, including mine, will be fine just writing to the driver. Reading is mostly for error checking, such as the IFCNT register that increments on each successful write datagram ...
  Topic: Porting stepper motor library for TMC2209 driver
WrySun

Replies: 22
Views: 44614

PostForum: General CCS C Discussion   Posted: Wed Jan 18, 2023 2:41 am   Subject: Porting stepper motor library for TMC2209 driver
I've enabled interrupts to get the RECEIVE_BUFFER=12 working. It is able to accurately buffer 12 bytes. If a 13th arrives the buffer is reset to 0 and starts over.

enable_interrupts(GLOBAL) ...
  Topic: Porting stepper motor library for TMC2209 driver
WrySun

Replies: 22
Views: 44614

PostForum: General CCS C Discussion   Posted: Mon Jan 16, 2023 1:40 pm   Subject: Porting stepper motor library for TMC2209 driver
I've experimented with all of the write settings of the TMC2209. Even got CoolStep and StallGuard working which are really useful features that I didn't have on the L6470 driver I used before this one ...
  Topic: Porting stepper motor library for TMC2209 driver
WrySun

Replies: 22
Views: 44614

PostForum: General CCS C Discussion   Posted: Fri Jan 13, 2023 3:39 am   Subject: Porting stepper motor library for TMC2209 driver
Thank you so very much to you both! Ttelmah spotted my mistake and the motor started spinning as soon as I changed to %c. You're an absolute lifesaver. Finally some progress.
  Topic: Porting stepper motor library for TMC2209 driver
WrySun

Replies: 22
Views: 44614

PostForum: General CCS C Discussion   Posted: Thu Jan 12, 2023 11:17 am   Subject: Porting stepper motor library for TMC2209 driver
Some success. I'm now able to compile the C library for the TMC2209 driver with CCS. The library does not include any documentation, comments or example code unfortunately.

With my current set up I ...
  Topic: Porting stepper motor library for TMC2209 driver
WrySun

Replies: 22
Views: 44614

PostForum: General CCS C Discussion   Posted: Wed Jan 04, 2023 2:21 am   Subject: Porting stepper motor library for TMC2209 driver
Checking the TMC2209 datasheet, I see that you are absolutely right. The FCLKTRIM is 5 bits, not 4. Seems I can't trust this library to have everything right. Thanks for the insight.
  Topic: Porting stepper motor library for TMC2209 driver
WrySun

Replies: 22
Views: 44614

PostForum: General CCS C Discussion   Posted: Tue Jan 03, 2023 4:17 pm   Subject: Porting stepper motor library for TMC2209 driver
Thanks for the reply. The following works in this instance, padding the struct into even bytes:

uint32_t
fclktrim :4,
reserved1 :3,
ottrim_lo :1,
ottrim_hi :1,
reserved2 : ...
  Topic: Porting stepper motor library for TMC2209 driver
WrySun

Replies: 22
Views: 44614

PostForum: General CCS C Discussion   Posted: Tue Jan 03, 2023 3:41 pm   Subject: Porting stepper motor library for TMC2209 driver
I'm trying to port the following library to use a TMC2209 stepper motor driver through UART (not step/dir pins):
typedef union {
uint32_t value;
struct {
uint32_t
...
 
Page 1 of 1
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group