UART pic 18f45k22

General discussion on mikroBasic.
Post Reply
Author
Message
guevas
Posts: 4
Joined: 23 Jan 2015 14:44

UART pic 18f45k22

#1 Post by guevas » 23 Jan 2015 14:56

Hello guys !, I need help.

I have knowledge in microcontrollers, but have difficulty writing the code. Descul-pe I do not speak English'm using Goolgle translator.

Well I need to send the status of 21 keys, through the serial port to 9600 :roll: bps.
these keys is to load the bytes, 0x00H to 0x15H (dec, 0 to 21).

before I need to create a code to write, in a memory E2PROM 25AA320, this type of memory uses the ISP protocol, I will need also control seven segment display with the MAX 7219 chip, this chip also uses the ISP protocol.
Good and great job.
  I will need also control a clock RTC DS 1307, and an LCD disply.

I need by INT1, iserir pulses, these pulses will be saved in e2pron, must be shown on the seven-segment display, as I push a button, I decrement pulses, which are stored in the E2PROM.

when I push, the keys must be sent through the serial port the value of each button.

Well if anyone can help me, I agadeço now because I need a lot.

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: UART pic 18f45k22

#2 Post by marina.petrovic » 26 Jan 2015 17:05

Hi,

You can start from some basic codes which can be found in our compiler and on LibStock Website.
You should adjust this examples for hardware which you use and test module functionality separately and
then combine them in your project.

For example, for:
- EEPROM:...\mikroBasic PRO for PIC\Examples\Internal MCU modules\P18F45K22\EEPROM in MCU
http://www.libstock.com/projects/view/3 ... ck-example
- MAX7219: http://www.libstock.com/projects/view/8 ... ed-library
- RTC: ...\mikroBasic PRO for PIC\Examples\Extra Boards\RTC (Soft I2C)
http://www.libstock.com/projects/view/2 ... ck-example

For any additional information you should consult datasheet of the MCU and modules which you use.

Best regards,
Marina

guevas
Posts: 4
Joined: 23 Jan 2015 14:44

Re: UART pic 18f45k22

#3 Post by guevas » 01 Feb 2015 08:45

thank you very much!
for your help, I will try to use these files, I'm using the compiler, C Micro pro

guevas
Posts: 4
Joined: 23 Jan 2015 14:44

Re: UART pic 18f45k22

#4 Post by guevas » 01 Feb 2015 08:50

which of these frequencies is used to generate baud rate? HS-PLL 320,000 MHz, 8.0000 MHz Crystal.

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: UART pic 18f45k22

#5 Post by marina.petrovic » 04 Feb 2015 17:19

Hi,

Baud rate is strictly related with the clock in your project.
You can use 8MHz clock without PLL (crystal) or higher clock value with PLL enabled - 32 MHz.
If you use PLL, please, make sure that you set oscillator settings properly in Project -> Edit Project.

Best regards,
Marina

guevas
Posts: 4
Joined: 23 Jan 2015 14:44

Re: UART pic 18f45k22

#6 Post by guevas » 13 Aug 2015 19:48

Thank you! Hello, I still have doubts, please see the electrical scheme is correct. I need to interface to work with memory, SPI. and led drive also uses SPI protocol. I want to know is, when I send data to EEPROM, if there will be no conflict with the LED drives?
Attachments
DISPLAY_KARAOKE.PDF
(36.13 KiB) Downloaded 191 times

User avatar
aleksa.jovanovic
Posts: 526
Joined: 30 Jun 2015 08:48

Re: UART pic 18f45k22

#7 Post by aleksa.jovanovic » 14 Aug 2015 15:07

Hi,

The chip select (or load on the MAX7219) determines what device will be active.
With SPI you can have as many devices you want on the same lines, but every device has to have each own chip select pin.
It should't be a problem.

Best regards,
Aleksa

Post Reply

Return to “mikroBasic General”