Author |
Message |
Topic: USB Descriptors |
Wilksey
Replies: 7
Views: 8079
|
Forum: General CCS C Discussion Posted: Mon Nov 13, 2023 10:31 am Subject: USB Descriptors |
So, I installed LibUSBDotNet and compiled the Show.Info example and the product field says CCS HID Demo, so I don't know why Windows is blank?? |
Topic: USB Descriptors |
Wilksey
Replies: 7
Views: 8079
|
Forum: General CCS C Discussion Posted: Mon Nov 13, 2023 5:37 am Subject: USB Descriptors |
Odd, it works, just the descriptor missing, is it a Windows 11 thing? |
Topic: USB Descriptors |
Wilksey
Replies: 7
Views: 8079
|
Forum: General CCS C Discussion Posted: Sun Nov 12, 2023 7:03 am Subject: USB Descriptors |
I tried the CCS example and that tab shows nothing, it's blank.
[img]https://ibb.co/XFG83zR[/img] |
Topic: USB Descriptors |
Wilksey
Replies: 7
Views: 8079
|
Forum: General CCS C Discussion Posted: Sat Nov 11, 2023 3:12 pm Subject: USB Descriptors |
Yeah, I was more after changing the description, I changed that file, but Window 11 just shows it as a "USB Input device", it doesn't even say "CCS Demo", does Windows 11 not show ... |
Topic: USB Descriptors |
Wilksey
Replies: 7
Views: 8079
|
Forum: General CCS C Discussion Posted: Fri Nov 10, 2023 1:31 pm Subject: USB Descriptors |
Apologies if this has been answered before, I had a quick scour and couldn't find what I wanted.
I am after changing the HID and PID so it shows something meaningful rather than "USB Input Devic ... |
Topic: EEPROM read anomaly |
Wilksey
Replies: 20
Views: 18004
|
Forum: General CCS C Discussion Posted: Fri Nov 10, 2023 10:59 am Subject: EEPROM read anomaly |
Fair point, I should have said every other compiler I have used. |
Topic: EEPROM read anomaly |
Wilksey
Replies: 20
Views: 18004
|
Forum: General CCS C Discussion Posted: Fri Nov 10, 2023 10:46 am Subject: EEPROM read anomaly |
BYTE loaded_code
Yeah that doesn't work, when the EEPROM is cleared it shows 1 instruction where it should show 0, which the for loop does. |
Topic: EEPROM read anomaly |
Wilksey
Replies: 20
Views: 18004
|
Forum: General CCS C Discussion Posted: Fri Nov 10, 2023 10:25 am Subject: EEPROM read anomaly |
Yes, the do while loop does the same thing though, yes I see the issue of evaluating the byte before reading it in, I could do an EEPROM read before going into the loop, but the for loop works as expe ... |
Topic: EEPROM read anomaly |
Wilksey
Replies: 20
Views: 18004
|
Forum: General CCS C Discussion Posted: Fri Nov 10, 2023 10:18 am Subject: EEPROM read anomaly |
Remember integers in CCS by default are unsigned....
-1 = 255
Do they? I didn't realise that every other compiler defaults to signed. |
Topic: EEPROM read anomaly |
Wilksey
Replies: 20
Views: 18004
|
Forum: General CCS C Discussion Posted: Fri Nov 10, 2023 8:51 am Subject: EEPROM read anomaly |
It increments before it reads so in reality it always reads x[0], with the for loop I can set it explicitly to 0, do while didn't work either until I put the increment above, very odd, never had that ... |
Topic: EEPROM read anomaly |
Wilksey
Replies: 20
Views: 18004
|
Forum: General CCS C Discussion Posted: Fri Nov 10, 2023 8:20 am Subject: EEPROM read anomaly |
I can get around it by reverting to for loop or setting the variable to -1, which seems to work |
Topic: EEPROM read anomaly |
Wilksey
Replies: 20
Views: 18004
|
Forum: General CCS C Discussion Posted: Fri Nov 10, 2023 7:24 am Subject: EEPROM read anomaly |
Yesh that's what I thought but the int long came from ccs c driver folder, , changing it to unsigned remains the same, maybe it's because it's only 512? |
Topic: EEPROM read anomaly |
Wilksey
Replies: 20
Views: 18004
|
Forum: General CCS C Discussion Posted: Fri Nov 10, 2023 4:12 am Subject: EEPROM read anomaly |
number_of_lines is defined as EEPROM_ADDRESS, and for 2404 it is a long int,
The fix was to move the variable increment to the top before the assignment.
while (loaded_code[number_of_lines ... |
Topic: EEPROM read anomaly |
Wilksey
Replies: 20
Views: 18004
|
Forum: General CCS C Discussion Posted: Thu Nov 09, 2023 4:32 pm Subject: EEPROM read anomaly |
Going back to the old code, number_of_lines goes from 0 to 511 then 767 to 985 for some reason but the data is correct it just doeesn't stop at byte 29 which s 0xff, the for loop goes from 0 to 28 whi ... |
Topic: EEPROM read anomaly |
Wilksey
Replies: 20
Views: 18004
|
Forum: General CCS C Discussion Posted: Thu Nov 09, 2023 3:46 pm Subject: EEPROM read anomaly |
the array is all 0's before the loop starts, so it would only read 0xff from within the loop after it has read the E2PROM.
This code works:
for(number_of_lines = 0; number_of_lines < EE ... |
|